# CVE-2024-54132: GitHub CLI allows downloading malicious GitHub Actions workflow artifact to result in path traversal vulnerability

> Attackers can overwrite files outside the intended directory by tricking users into downloading malicious GitHub Actions artifacts with specific names.

- **Severity:** Medium 6.3 (`CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/U:Green`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 4 Dec 2024
- **Updated:** 4 Dec 2024
- **Also known as:** AZL-53996, AZL-54009, DEBIAN-CVE-2024-54132, GHSA-2m9h-r57g-45pj, GO-2024-3310, UBUNTU-CVE-2024-54132

## What is CVE-2024-54132?

CVE-2024-54132 is a medium-severity path traversal vulnerability in cli, published on 4 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The GitHub CLI is GitHub’s official command line tool. A security vulnerability has been identified in GitHub CLI that could create or overwrite files in unintended directories when users download a malicious GitHub Actions workflow artifact through gh run download. This vulnerability stems from a GitHub Actions workflow artifact named .. when downloaded using gh run download. The artifact name and --dir flag are used to determine the artifact’s download path. When the artifact is named .., the resulting files within the artifact are extracted exactly 1 directory higher than the specified --dir flag value. This vulnerability is fixed in 2.63.1.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2024-54132?

6 open source packages ship an affected version, including github.com/cli/cli and github.com/cli/cli/v2.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/cli/cli` | Go | All versions | None |
| `github.com/cli/cli` | Go | All versions to 1.14.0 | None |
| `github.com/cli/cli` | Go | All versions to 1.14.0 | None |
| `github.com/cli/cli/v2` | Go | All versions | 2.63.1 |
| `github.com/cli/cli/v2` | Go | All versions | 2.63.1 |
| `github.com/cli/cli/v2` | Go | All versions | 2.63.1 |

## How do I fix CVE-2024-54132?

Upgrade to a fixed version.

## Is CVE-2024-54132 being exploited?

There is no known exploitation of CVE-2024-54132 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-54132 and fix it if it is affected.

What it is: CVE-2024-54132 is a medium-severity path traversal vulnerability in cli, published on 4 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-54132 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/cli/cli (Go): affected all versions; no fix listed
- github.com/cli/cli (Go): affected all versions up to 1.14.0; no fix listed
- github.com/cli/cli (Go): affected all versions up to 1.14.0; no fix listed
- github.com/cli/cli/v2 (Go): affected all versions; fixed in 2.63.1
- github.com/cli/cli/v2 (Go): affected all versions; fixed in 2.63.1
- github.com/cli/cli/v2 (Go): affected all versions; fixed in 2.63.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-54132/ (Markdown: https://insights.sbomify.com/CVE-2024-54132/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-54132
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-54132
- OSV: https://osv.dev/vulnerability/CVE-2024-54132

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-54132/
Summaries are generated and may contain mistakes; the official description above is the record.
