CVE-2023-23939

Azure/setup-kubectl: Escalation of privilege vulnerability for v3 and lower

3.9 low EPSS 0.47%

Published 6 Mar 2023 Updated 25 Feb 2025 CNA: GitHub_M

Check your servers for CVE-2023-23939

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-23939 affects setup-kubectl, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

Azure/setup-kubectl is a GitHub Action for installing Kubectl. This vulnerability only impacts versions before version 3. An insecure temporary creation of a file allows other actors on the Actions runner to replace the Kubectl binary created by this action because it is world writable. This Kubectl tool installer runs `fs.chmodSync(kubectlPath, 777)` to set permissions on the Kubectl binary, however, this allows any local user to replace the Kubectl binary. This allows privilege escalation to the user that can also run kubectl, most likely root. This attack is only possible if an attacker somehow breached the GitHub actions runner or if a user is utilizing an Action that maliciously executes this attack. This has been fixed and released in all versions `v3` and later. 775 permissions are used instead. Users are advised to upgrade. There are no known workarounds for this issue.

Severity (CVSS)

3.9 low CVSS 3.1 from GitHub_M (CNA)
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:L
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
high: an attack depends on conditions outside the control of the attacker, such as a race
Privileges required
high: the attacker needs an administrative account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality low, integrity low, availability low: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.47%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 33.1% of all scored CVEs. Scores of 29 Nov 2026.

The assessment of CISA (SSVC, 25 Feb 2025):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Weakness

  • CWE-732 Incorrect Permission Assignment for Critical Resource

Affected products

As the CNA lists them.

ProductVersions
setup-kubectl
affected < 3

Is my server affected?

Find the installed version of setup-kubectl and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i setup-kubectl
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2023-23939 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2023-23939

RHEL, Rocky, Alma, Fedora

rpm -q setup-kubectl
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2023-23939

Alpine

apk list --installed | grep -i setup-kubectl

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2023-23939
trivy image --scanners vuln IMAGE | grep CVE-2023-23939

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Advisories

Other references

Source: the record CVE-2023-23939 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.