fix(kubernetes): sanitize non-UTF-8 host in metrics (#7998)

This commit is contained in:
Ville Vesilehto
2026-04-02 00:19:29 +03:00
committed by GitHub
parent 529320db4b
commit 503c2d7ea3
3 changed files with 56 additions and 2 deletions

View File

@@ -25,6 +25,22 @@ acl
"hosts#\x90\xD0{lc\x0C{\n" +
"'{mport\xEF1\x0C}\x0B''",
},
{
// A kubernetes endpoint URL with invalid UTF-8 caused a
// panic in Prometheus WithLabelValues.
// See OSS-Fuzz issue: https://issues.oss-fuzz.com/issues/498472468
name: "FuzzCore_InvalidUTF8InKubernetesEndpoint",
corefile: "\xf6\xe6*S65558::65535\n" +
"kubernetes idd\x0cd\xc8:0\x00,\x13" +
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfd" +
"\x00\x00\x00\x00\x00\x00\x00-\x00\x00\x00\x00" +
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" +
"\t{\tendpoint m\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
"\xff\xff\xff\xffFFFFFF%FFFFFFFF\xff\xff\xff\xff\xff" +
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +
"\xff\xff\tuil{ticll{ticl\x00,1:*\x0cd}\x0c}",
},
}
for _, tc := range cases {