CVE-2021-25741
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedA security issue was discovered in Kubernetes where a user may be able to create a container with subpath volume mounts to access files & directories outside of the volume, including on the host filesystem.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceIn Kubernetes, a flaw in subpath volume mount handling allows an attacker with pod creation permissions to escape the container's allocated volume and access the host filesystem or other volumes outside the container's scope. By specifying a modified subpath in a volume mount, containers can traverse upward directory references to reach host paths.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data<= 1.19.14>= 1.20.0, <= 1.20.10>= 1.21.0, <= 1.21.4>= 1.22.0, <= 1.22.1CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify Kubernetes API server versionRun `kubectl get nodes` and then `kubectl get nodes <node-name> -o yaml` to check kubelet version, or check the API server version via `kubectl version --short` or check the Kubernetes control plane componentsAffected if The installed Kubernetes version falls within any of these ranges: <= 1.19.14, 1.20.0-1.20.10, 1.21.0-1.21.4, or 1.22.0-1.22.1
-
Identify pods using subpath volume mountsReview pod specifications for volume mounts that use the `subPath` field: `kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{.spec.volumes[*].volumeMounts[*].subPath}{end}'`Affected if Any pod spec contains a volume mount with a `subPath` field defined, especially if it accepts user input or uses variable substitution
-
Audit RBAC permissions for pod creationRun `kubectl auth can-i create pods --as=<username>` for each service account or user, or review RBAC policies with `kubectl get roles,clusterroles -o yaml` focusing on verbs that include 'create' on 'pods'Affected if Users or service accounts outside a dedicated security team have permissions to create pods, as this grants the capability to exploit the subpath vulnerability
-
Check for admission controller enforcementReview the Kubernetes API server configuration for enabled admission controllers: check the `--enable-admission-plugins` flag or the admission webhook configurations via `kubectl get validatingwebhookconfigurations` and `kubectl get mutatingwebhookconfigurations`Affected if No pod security admission, PodSecurityPolicy, or custom admission webhooks are actively blocking privileged pod creation or subpath usage
You are affected if your Kubernetes version is 1.22.1 or earlier (excluding 1.19.15+, 1.20.11+, 1.21.5+, 1.22.2+) AND users with pod creation permissions exist AND subpath volume mounts are in use.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedUpgrade Kubernetes to versions 1.22.2, 1.21.4, 1.20.10, or later which contain the patch for this vulnerability. If immediate patching is not possible, restrict pod creation permissions using admission controls and avoid allowing users to specify custom subpath volume mounts.
Kubernetes 1.19.15+, 1.20.11+, 1.21.5+, or 1.22.2+ (depending on your current branch)
- Identify your current Kubernetes version using: kubectl version --short or kubectl get nodes
- Determine which release branch you need based on your current version: 1.19.x -> upgrade to 1.19.15+, 1.20.x -> upgrade to 1.20.11+, 1.21.x -> upgrade to 1.21.5+, 1.22.x -> upgrade to 1.22.2+
- Plan the upgrade following Kubernetes version skew policy: upgrade one minor version at a time if jumping multiple versions
- For managed Kubernetes (EKS, GKE, AKS), use cloud provider's recommended upgrade procedure
- For self-managed clusters, upgrade control plane first, then worker nodes
- After upgrade, verify the fix by checking the kubelet version: kubectl get nodes
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation4.0 h
- Implementation8.0 h
- Testing6.0 h
- Review / QA2.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,600.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2021-25741 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2021-25741 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data