apply security patch: release-11.2.7/320-202502130525.patch

commit ade17b4335e796e7410b6f91341b92d2139e772e
Author: AgnesToulet <35176601+AgnesToulet@users.noreply.github.com>
Date:   Tue Feb 11 10:57:05 2025 +0100

    Dashboards: Prevent title longer than 5 000 characters

    (cherry picked from commit f9e0789210004b0bd7902255644ef348ae7b3aa8)
This commit is contained in:
github-actions[bot]
2025-02-14 15:23:15 +00:00
parent 848c99ad0c
commit 33d374ec7b
2 changed files with 9 additions and 0 deletions
+5
View File
@@ -47,6 +47,11 @@ var (
StatusCode: 400,
Status: "empty-name",
}
ErrDashboardTitleTooLong = DashboardErr{
Reason: "Dashboard title cannot contain more than 5 000 characters",
StatusCode: 400,
Status: "title-too-long",
}
ErrDashboardFolderCannotHaveParent = DashboardErr{
Reason: "A Dashboard Folder cannot be added to another folder",
StatusCode: 400,
@@ -113,6 +113,10 @@ func (dr *DashboardServiceImpl) BuildSaveDashboardCommand(ctx context.Context, d
return nil, dashboards.ErrDashboardTitleEmpty
}
if len(dash.Title) > 5000 {
return nil, dashboards.ErrDashboardTitleTooLong
}
metrics.MFolderIDsServiceCount.WithLabelValues(metrics.Dashboard).Inc()
// nolint:staticcheck
if dash.IsFolder && dash.FolderID > 0 {