From 2a7adbb2fa22e1a94083a2664ef8accf6f3468a0 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Tue, 19 Mar 2024 09:14:56 +0300 Subject: [PATCH] check orgId on delete --- pkg/api/dashboard_snapshot.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/api/dashboard_snapshot.go b/pkg/api/dashboard_snapshot.go index 2b0c5e5471b..84ea9563cd8 100644 --- a/pkg/api/dashboard_snapshot.go +++ b/pkg/api/dashboard_snapshot.go @@ -356,6 +356,9 @@ func (hs *HTTPServer) DeleteDashboardSnapshot(c *contextmodel.ReqContext) respon if queryResult == nil { return response.Error(http.StatusNotFound, "Failed to get dashboard snapshot", nil) } + if queryResult.OrgID != c.OrgID { + return response.Error(http.StatusUnauthorized, "OrgID mismatch", nil) + } if queryResult.External { err := deleteExternalDashboardSnapshot(queryResult.ExternalDeleteURL)