Skip to content
GHSA-pcx2-xcq4-65vf

GHSA-pcx2-xcq4-65vf

github.com • November 25, 2026

Reported by: Akamai Security Group Date: September 3, 2026 Severity: Critical Affected Component: pkg/engine/apicall/apiCall.go -- Fetch() Classification: URL Parser Differential / Namespace Isolation Bypass

We have identified a bypass of the namespace isolation fix introduced in CVE-2026-22039 (commit e0ba4de4f1e0ca325066d5095db51aec45b1407b ). The original fix enforces that namespaced Kyverno policies can only access Kubernetes API resources within their own namespace by matching the URLPath against a namespace-extracting regex. However, this validation can be circumvented by embedding the namespace segment inside a query string parameter, exploiting a fundamental mismatch between how the validator and the HTTP execution layer parse the URL.

This bypass remains exploitable on the current main branch, including after the subsequent hardening in commit 7ac176ac8 ( GHSA-c5qq-7g2q-cpqp , GHSA-5qq8-67g6-4h2w , GHSA-743g-m34m-94rq), which addressed percent-encoded path traversal but not query string injection.

Vulnerability Details

The namespace validation in Fetch() (lines 68--106 of pkg/engine/apicall/apiCall.go ) processes the URLPath through url.PathUnescape and path.Clean before matching it against namespacePathRegex :

The critical flaw is that Go's path.Clean (from the path package) operates on slash-separated path segments and has no concept of query strings -- the ? character is treated as an ordinary path character. As a result, the regex validation runs against a string that still contains query parameters fused into the path.

Meanwhile, the execution path passes the original, un-cleaned call.APICall.URLPath to executor.Execute() -> executeK8sAPICall() -> client.RawAbsPath() -> c.rest.Get().RequestURI(path) , where client-go's RequestURI uses standard URL parsing ( net/url ) that properly separates the path from the query string.

This creates a validator/executor mismatch : the validator sees a path that includes the query string (and finds a namespace match within it), while the HTTP layer sends the request to a completely different -- potentially cluster-scoped -- endpoint.

A user with permission to create a namespaced Kyverno Policy can craft an APICall with a URLPath such as:

What the validator sees:

url.PathUnescape -- no change (no percent-encoded characters)

path.Clean -- produces /api/v1/nodes?x=/namespaces/default (trailing slash removed, ? preserved as path character)

namespacePathRegex.FindStringSubmatch(cleanPath) -- the lazy .*? consumes v1/nodes?x= , then /namespaces/ matches literally, and ([^/]+) captures default

Validation passes : captured namespace default matches the policy namespace

What the HTTP layer sends:

RequestURI("/api/v1/nodes?x=/namespaces/default/") in client-go uses net/url.Parse

Parsed path: /api/v1/nodes

Parsed query: x=/namespaces/default/

Actual request : GET /api/v1/nodes -- a cluster-scoped resource

The Kubernetes API server routes based on the URL path, ignoring unrecognized query parameters. The response returns all nodes in the cluster , despite the namespaced policy being restricted to its own namespace.

This technique generalizes to any cluster-scoped or cross-namespace resource:

Additional Concern: Validator/Executor Data Mismatch (TOCTOU)

Beyond the query string issue, there is an architectural concern: validation runs on the cleaned/unescaped path ( cleanPath ), but execution uses the original call.APICall.URLPath . Even if query string handling were fixed, operating on different representations of the same input is a TOCTOU-style flaw that could enable future bypasses.

A user who can create namespaced Kyverno Policies (a normal privilege in multi-tenant Kyverno deployments) can:

Read cluster-scoped resources (nodes, clusterroles, clusterrolebindings, persistent volumes, etc.)

Read secrets and other resources in arbitrary namespaces , breaking tenant isolation

Exfiltrate sensitive configuration that the namespace boundary was designed to protect

This directly undermines the security guarantee introduced by CVE-2026-22039 's fix.

A namespaced Policy in the default namespace with the following context entry bypasses namespace isolation:

Once this policy would be triggered - for example, by creating a config map, it would leak the config-map in the namespace "kube-system", which requires elevated permissions to read.

Parse the URL before validation. Use net/url.Parse (or url.ParseRequestURI ) on the URLPath before running any namespace or traversal validation. Run namespacePathRegex and path.Clean against only the parsed u.Path component -- never against the raw string that includes the query.

Parse the URL before validation. Use net/url.Parse (or url.ParseRequestURI ) on the URLPath before running any namespace or traversal validation. Run namespacePathRegex and path.Clean against only the parsed u.Path component -- never against the raw string that includes the query.

Unify validation and execution data. Pass the same canonicalized, validated path to Execute() / RawAbsPath() , eliminating the validator/executor mismatch. The cleaned path should be the single source of truth for both validation and execution.

Unify validation and execution data. Pass the same canonicalized, validated path to Execute() / RawAbsPath() , eliminating the validator/executor mismatch. The cleaned path should be the single source of truth for both validation and execution.

Add test coverage. The existing tests ( Test_PercentEncodedPathTraversal , Test_CrossNamespaceAccess ) do not cover query-string-based bypass. Add test cases for: Namespace segment embedded in query parameters Cross-namespace access via query injection Combined percent-encoding and query string attacks

Add test coverage. The existing tests ( Test_PercentEncodedPathTraversal , Test_CrossNamespaceAccess ) do not cover query-string-based bypass. Add test cases for:

Namespace segment embedded in query parameters

Cross-namespace access via query injection

Combined percent-encoding and query string attacks

Sketch of the fix in Fetch() :

Responsible Disclosure

In accordance with responsible disclosure practices, we plan to publish our findings 90 days from the date of this report . We are fully committed to working with you to ensure this is resolved effectively and are happy to coordinate the timeline if you need additional time to roll out a patch.

Thank you for your time. We're happy to provide additional details or assist with a fix.

: Akamai Security Group

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.