· via dev.to (home feed)
Kyverno 1.19.2 fixes CVSS 10.0 bug where a single ? bypassed namespace checks
A CVSS 10.0 flaw fixed in Kyverno 1.19.2 let namespace-restricted policies read cluster-wide ConfigMaps by hiding a fake namespace path in a URL query string. Akamai saw 4% of monitored enterprise networks exposed.

On November 24, Akamai published the story behind a CVSS 10.0 vulnerability in Kyverno, the CNCF policy engine many teams use to keep Kubernetes tenants inside their own namespaces. The fix shipped in Kyverno 1.19.2, and according to the Kyverno security advisory GHSA-pcx2-xcq4-65vf, the root cause came down to a single character: a question mark.
Akamai's telemetry showed 4% of the enterprise networks it monitors were running vulnerable Kyverno instances. A user allowed to write policies only in the default namespace could make Kyverno read ConfigMaps from kube-system, then read the stolen data back out of an admission error message.
How the bypass worked
Kyverno policies can fetch extra data during admission with an apiCall block: the policy author supplies a urlPath, and Kyverno, which runs with broad cluster permissions, makes the request. Because that is an obvious confused-deputy risk, an earlier fix (CVE-2026-22039) added a guard requiring a namespaced policy to call only URLs inside its own namespace.
As a dev.to write-up of the advisory explains, the guard worked in three steps: percent-decode the path with Go's url.PathUnescape, normalise it with path.Clean, then match a regex, ^/api(s)?/.*?/namespaces/([^/]+)/?.*$, and compare the captured namespace with the policy's own.
The flaw is that path.Clean is a file-path function, and in a file name ? is just a character. The input /api/v1/configmaps?x=/namespaces/default/ emerged from the cleaner almost unchanged: the regex found /namespaces/default/ inside the query string, the namespace matched, and the check passed. Kyverno then handed the original string to client-go, which parsed it as a real URL, with path /api/v1/configmaps and query x=/namespaces/default/. The API server ignored the unknown parameter and returned ConfigMaps from every namespace.
The advisory, as the write-up relays, flags two distinct problems. One is a parser differential: the code that validates a URL and the code that uses it must parse it the same way. The other is validating one string while executing another: Kyverno checked the cleaned path but sent the raw one, which the advisory calls a TOCTOU-style flaw in its own right.
Leaking the data through denial messages
Exfiltration needed no second bug. The proof of concept, described on dev.to, used a policy that always denies, with a message template along the lines of LEAKED DATA: {{ leakedData }}. Creating any ConfigMap triggered the policy, and the denial message shown to the attacker contained the secret value. Error messages that interpolate fetched data are an exfiltration channel of their own.
The bug class travels beyond Kubernetes
The dev.to author's central point is that Kubernetes is not the interesting part. The disagreement between the validator and the HTTP client is, and that bug can be written in a few lines of Python. The post recreates the check with posixpath.normpath standing in for path.Clean, then compares what the check permits against the path the requests library actually sends.
The same divergences appear. A query string or a # fragment satisfies the naive check while the HTTP client drops or reinterprets it, and the fragment variant is described as new even to the author. The reverse mistake also exists: percent-decoding before splitting turns %3F into a real ? in the validator's copy while the client sends the encoded form. The one benign case in the tests was where both the validator and the client collapsed .. segments; the gap opens only when exactly one of them normalises.
Ordinary web applications hit the same class of issue in open-redirect checks on ?next= parameters, the post notes: browsers follow WHATWG URL rules, which treat a backslash like a forward slash in HTTP URLs, while Python's urlsplit does not.
The fix pattern
The remedy from the advisory, restated in the post, works in any language: parse the string with a real URL parser first, validate the parsed pieces, then send exactly the string you validated. The author's stricter version rejects any input containing a query, fragment, host or percent-encoded characters rather than repairing it, reads the namespace from a fixed path segment instead of a permissive regex, and returns a canonical string the caller must use for the request. Where query parameters are genuinely needed, such as a labelSelector, the advice is to build them from an allowlist so they can never be confused with the path.
Why it matters
Kyverno is the enforcement layer that multi-tenant clusters depend on, so a CVSS 10.0 flaw in the engine means the guardrail itself was the escape hatch. Akamai's 4% figure implies a meaningful slice of monitored enterprise networks were exposed, and policies written against the old check may still be deployed.
The wider lesson is that the bug class is language-agnostic. Any code that checks a URL with one parser and then fetches it with another, whether a redirect validator, an internal API proxy or a path-based permission check, has the same gap. The defences are concrete: parse once, validate the parsed structure, execute the canonical form, and treat error messages that echo fetched data as a leak surface in their own right.
- #kubernetes
- #security
- #kyverno
- #cve
- #url-parsing