PoC Archive PoC Archive
High CVE-2026-46680 unpatched

Kubernetes `runAsNonRoot` Bypass via UID Integer Overflow (CVE-2026-46680)

by r0binak · 2026-07-05

Severity
High
CVE
CVE-2026-46680
Category
cloud
Affected product
Kubernetes (kubelet / container runtime UID handling)
Affected versions
Per source repository (affected Kubernetes releases enforcing runAsNonRoot via UID checks)
Disclosed
2026-07-05
Patch status
unpatched

Metadata

FieldValue
Date Added2026-07-05
Last Updated2026-07
Author / Researcherr0binak
CVE / AdvisoryCVE-2026-46680
Categorycloud
SeverityHigh
CVSS ScoreNot specified in source
StatusPoC
Tagskubernetes, container-escape, runasnonroot, uid-overflow, security-context-bypass, privilege-escalation
RelatedN/A

Affected Target

FieldValue
Software / SystemKubernetes (kubelet / container runtime UID handling)
Versions AffectedPer source repository (affected Kubernetes releases enforcing runAsNonRoot via UID checks)
Language / PlatformKubernetes manifests / OCI container image (Dockerfile)
Authentication RequiredRequires ability to deploy a Pod (namespace-scoped deploy access)
Network Access RequiredNo (cluster API/deploy access is sufficient; no external network exploitation needed)

Summary

Kubernetes’ securityContext.runAsNonRoot: true admission check is meant to prevent Pods from running as UID 0 (root). This PoC demonstrates that a crafted container image with a numeric UID value that overflows the integer type used internally by the runtime’s non-root check can cause the effective runtime UID to wrap around to 0, even though the declared/checked UID appears non-zero. This lets a Pod pass the runAsNonRoot policy check while its container process actually executes as root inside the container, undermining a commonly relied-upon Pod Security Standard control.


Vulnerability Details

Root Cause

The runAsNonRoot enforcement compares a UID value against zero using a numeric type/range that does not match the full range accepted by the underlying container runtime or /etc/passwd-less numeric UID assignment in the image. By setting a UID large enough to overflow the check’s integer representation (wrapping to 0), the validation logic sees a “non-zero” value while the actual OS-level UID the container runs as resolves to root (UID 0).

Attack Vector

  1. Attacker builds (or is otherwise able to supply) a container image (Dockerfile) whose default user is set to a specially chosen large numeric UID designed to overflow to 0 under the runtime’s non-root validation.
  2. Attacker (or any principal with permission to create Pods in the target namespace) deploys a Pod manifest (pod.yaml) that sets securityContext.runAsNonRoot: true and specifies the crafted UID, satisfying the admission-time non-root check.
  3. The container runtime starts the container; due to the overflow, the process’s effective in-container UID is 0 (root) despite the declared security context appearing compliant.
  4. The attacker now has a running container process with root privileges inside a Pod that was believed to be constrained to non-root execution, undermining any security controls (e.g. Pod Security Admission, OPA/Gatekeeper policies) that depend on runAsNonRoot being enforced correctly.

Impact

Bypass of the runAsNonRoot Pod Security Standard/admission control, allowing a Pod to run its container as root despite passing policy validation. This can facilitate container breakout attempts, abuse of root-only capabilities inside the container, and undermines defense-in-depth assumptions made by cluster operators who rely on runAsNonRoot as a compensating control for other risks (e.g. permissive hostPath mounts, weaker seccomp/AppArmor profiles).


Environment / Lab Setup

Target:    Kubernetes cluster (kubelet + container runtime enforcing runAsNonRoot)
Attacker:  kubectl access sufficient to build/push a custom image and create a Pod
Tooling:   Docker (to build the crafted image from Dockerfile), kubectl apply -f pod.yaml

Proof of Concept

PoC Script

See Dockerfile and pod.yaml in this folder.

1
2
3
docker build -t runasnonroot-uid-overflow-poc .
kubectl apply -f pod.yaml
kubectl exec -it <pod-name> -- id

Building the image and deploying pod.yaml (which sets runAsNonRoot: true with the crafted UID) demonstrates that the Pod is admitted despite the non-root policy, and id executed inside the running container shows an effective UID of 0, confirming the bypass.


Detection & Indicators of Compromise

kubectl get pods -A -o json | jq '.items[] | select(.spec.securityContext.runAsUser > 65535 or .spec.containers[].securityContext.runAsUser > 65535)'

kubectl exec <pod> -- id -u

Signs of compromise:

  • Pods passing runAsNonRoot: true admission checks yet reporting UID 0 when inspected at runtime (id, /proc/self/status).
  • Container images with unusually large numeric USER values in their Dockerfile/image config.
  • Unexpected root-level file writes or capability usage inside Pods labeled/expected to run non-root.

Remediation

ActionDetail
Primary fixUpgrade Kubernetes/kubelet and the container runtime to a version that validates runAsUser/runAsNonRoot using a correctly-ranged integer type and rejects out-of-range UID values.
Interim mitigationEnforce an explicit allow-listed UID range via admission policy (e.g. Pod Security Admission restricted profile, OPA/Gatekeeper, Kyverno) rather than relying solely on runAsNonRoot; scan images for anomalous UID declarations before deployment.

References


Notes

Mirrored from https://github.com/r0binak/CVE-2026-46680 on 2026-07-05. Source repository README was minimal; details above are derived from inspecting the provided Dockerfile and pod.yaml.