KubernetesApplication

CVE-2021-25741

HIGH · 8.1 CVSS v3.1 Published 2021-09-20
Fix available
A fix is available. Upgrade to after 1.22.1 or later.
See remediation →
87/100
Remediation priority · High
Remotely reachable Zero-click

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 · unedited
A 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 confidence

In 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.

MitigationUpgrade 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.

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
KubernetesApplication
Affected:<= 1.19.14>= 1.20.0, <= 1.20.10>= 1.21.0, <= 1.21.4>= 1.22.0, <= 1.22.1

CVSS 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 checks

Work through these to decide whether this CVE applies to you.

  1. Identify Kubernetes API server version
    Run `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 components
    Affected 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
  2. Identify pods using subpath volume mounts
    Review 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
  3. Audit RBAC permissions for pod creation
    Run `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
  4. Check for admission controller enforcement
    Review 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Upgrade available Upgrade to a release after 1.22.1
Interim mitigation

Upgrade 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.

Recommended fix Moderate confidence

Kubernetes 1.19.15+, 1.20.11+, 1.21.5+, or 1.22.2+ (depending on your current branch)

  1. Identify your current Kubernetes version using: kubectl version --short or kubectl get nodes
  2. 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+
  3. Plan the upgrade following Kubernetes version skew policy: upgrade one minor version at a time if jumping multiple versions
  4. For managed Kubernetes (EKS, GKE, AKS), use cloud provider's recommended upgrade procedure
  5. For self-managed clusters, upgrade control plane first, then worker nodes
  6. After upgrade, verify the fix by checking the kubelet version: kubectl get nodes
Caveat Upgrading Kubernetes may require updates to manifests or tools; ensure compatibility with other cluster components and check release notes for breaking changes

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Kubernetes Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing6.0 h
  • Review / QA2.0 h
20.0 hours of engineering $3,500
Get the upgrade done

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2021-25741 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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