apply security patch: release-10.4.16/323-202502130512.patch
commit 5538b821399261c0e0a423e7ac86c1b034d9fae3 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:
@@ -46,6 +46,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,
|
||||
|
||||
@@ -115,6 +115,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 {
|
||||
|
||||
Reference in New Issue
Block a user