Compare commits

...

3 Commits

Author SHA1 Message Date
github-actions[bot]
f974c99f30 apply security patch: release-11.5.4/379-202504030825.patch
commit deaee13004775ae589adb374666cc07bab17f114
Author: nmarrs <nathanielmarrs@gmail.com>
Date:   Thu Apr 3 09:22:04 2025 +0100

    backport commit
2025-04-18 21:51:03 +00:00
github-actions[bot]
a659da6b1d apply security patch: release-11.5.4/374-202504022116.patch
commit dc7b6533ba9f3c823230c71c0a14c06ac9e04df0
Author: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
Date:   Wed Apr 2 16:55:01 2025 -0400

    require editor to fetch config
2025-04-18 21:51:03 +00:00
github-actions[bot]
b3569971da apply security patch: release-11.5.4/365-202504020730.patch
commit d96895e4f98d1d8cce6d731f6421f6fd1fb6dd94
Author: Andres Martinez Gotor <andres.martinez@grafana.com>
Date:   Mon Mar 31 12:15:52 2025 +0200

    Sanitize paths before evaluating access to route
2025-04-18 21:51:03 +00:00
4 changed files with 20 additions and 3 deletions

View File

@@ -302,7 +302,15 @@ func (proxy *DataSourceProxy) validateRequest() error {
}
// route match
if !strings.HasPrefix(proxy.proxyPath, route.Path) {
r1, err := util.CleanRelativePath(proxy.proxyPath)
if err != nil {
return err
}
r2, err := util.CleanRelativePath(route.Path)
if err != nil {
return err
}
if !strings.HasPrefix(r1, r2) {
continue
}

View File

@@ -274,6 +274,14 @@ func TestDataSourceProxy_routeRule(t *testing.T) {
err = proxy.validateRequest()
require.NoError(t, err)
})
t.Run("path with slashes and user is editor", func(t *testing.T) {
ctx, _ := setUp()
proxy, err := setupDSProxyTest(t, ctx, ds, routes, "//api//admin")
require.NoError(t, err)
err = proxy.validateRequest()
require.Error(t, err)
})
})
t.Run("plugin route with RBAC protection user is allowed", func(t *testing.T) {

View File

@@ -39,7 +39,7 @@
{
"method": "GET",
"path": "api/v1/alerts",
"reqRole": "Admin"
"reqRole": "Editor"
}
],
"info": {

View File

@@ -641,7 +641,8 @@ function fieldValueColors(f: Field, theme: GrafanaTheme2): FieldColorValues {
let lasti = steps.length - 1;
for (let i = lasti; i > 0; i--) {
conds += `v >= ${steps[i].value} ? ${i} : `;
let rhs = Number(steps[i].value);
conds += `v >= ${rhs} ? ${i} : `;
}
conds += '0';