KubernetesApplication

CVE-2023-2728

MEDIUM · 6.5 CVSS v3.1 Published 2023-07-03
Fix available
A fix is available. Upgrade to after 1.27.2 or later.
See remediation →
71/100
Remediation priority · Elevated
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
Users may be able to launch containers that bypass the mountable secrets policy enforced by the ServiceAccount admission plugin when using ephemeral containers. The policy ensures pods running with a service account may only reference secrets specified in the service account’s secrets field. Kubernetes clusters are only affected if the ServiceAccount admission plugin and the `kubernetes.io/enforce-mountable-secrets` annotation are used together with ephemeral containers.

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

Ephemeral containers in Kubernetes can bypass the ServiceAccount admission plugin's mountable secrets policy. When the plugin enforces the `kubernetes.io/enforce-mountable-secrets` annotation, pods should only access secrets listed in their service account's secrets field, but ephemeral containers circumvent this enforcement.

MitigationUpgrade Kubernetes to a patched version and audit ephemeral container usage in clusters relying on the mountable secrets policy enforcement.

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.24.14>= 1.25.0, <= 1.25.10>= 1.26.0, <= 1.26.5>= 1.27.0, <= 1.27.2

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
High
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:H/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. Check your Kubernetes version
    Run `kubectl get nodes` or check the API server version with `kubectl version --short`
    Affected if The version falls within any of these ranges: <= 1.24.14, 1.25.0-1.25.10, 1.26.0-1.26.5, or 1.27.0-1.27.2
  2. Identify ServiceAccounts with mountable secrets enforcement
    Check for the annotation `kubernetes.io/enforce-mountable-secrets=true` on ServiceAccount objects: `kubectl get serviceaccounts -o jsonpath='{range .items[?(@.metadata.annotations.kubernetesio/enforce-mountable-secrets)]}{.metadata.namespace}/{.metadata.name}{end}'`
    Affected if Any ServiceAccount has the enforce-mountable-secrets annotation set, indicating reliance on this security policy
  3. Find pods using ephemeral containers
    Run `kubectl get pods --all-namespaces -o json` and search for containers defined under `.spec.ephemeralContainers`
    Affected if Any pod in the cluster has ephemeral containers defined, which could bypass the mountable secrets policy
  4. Audit secret access patterns for ephemeral containers
    Review pod specifications with ephemeral containers and compare against their service account's secrets list to identify unauthorized secret access attempts
    Affected if Ephemeral containers exist in namespaces with enforced mountable secrets and are accessing secrets not listed in their service account's secrets field

You are affected if your Kubernetes version is within the affected ranges AND you rely on the enforce-mountable-secrets annotation while also using ephemeral containers in your cluster.

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.27.2
Interim mitigation

Upgrade Kubernetes to a patched version and audit ephemeral container usage in clusters relying on the mountable secrets policy enforcement.

Recommended fix High confidence

Kubernetes v1.24.15 / v1.25.11 / v1.26.6 / v1.27.3 or later (choose the appropriate release line for your environment)

  1. Identify your current Kubernetes version using `kubectl get nodes` and checking the kubelet version
  2. Plan for a controlled upgrade following your cluster's upgrade procedure (e.g., control plane first, then worker nodes)
  3. Upgrade Kubernetes to one of the fixed versions: v1.24.15+, v1.25.11+, v1.26.6+, or v1.27.3+
  4. After upgrade, verify the control plane components are running the new version: `kubectl version --short`
  5. Test that ephemeral containers work correctly with the ServiceAccount admission plugin enforce-mountable-secrets policy
Caveat Minor version upgrades (e.g., 1.26 to 1.27) may introduce breaking changes; patch releases (e.g., 1.26.5 to 1.26.6) are generally safe updates with minimal risk

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

Fix this in Kubernetes Scoped from the published advisory
  • Consultation3.0 h
  • Implementation8.0 h
  • Testing4.0 h
  • Review / QA2.0 h
17.0 hours of engineering $3,000
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,800.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2023-2728 — 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-2023-2728 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