# CVE-2024-52005: The sideband payload is passed unfiltered to the terminal in git

> Malicious remote messages can inject terminal escape sequences to mislead users into executing untrusted scripts during Git operations.

- **Severity:** High 7.5 (`CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 15 Jan 2025
- **Updated:** 15 Jan 2025
- **Also known as:** ALSA-2025:7409, ALSA-2025:7482, ALSA-2025:8414, AZL-56370, AZL-56373, BELL-CVE-2024-52005, BIT-git-2024-52005, CLSA-2025-1751142973, CLSA-2026-1776687226, DEBIAN-CVE-2024-52005, ECHO-c63d-3f15-6e1f, GHSA-7jjc-gg6m-3329, MINI-8f3x-wm75-6446, OESA-2025-1115, RHSA-2025:7409, RHSA-2025:7482, RHSA-2025:7640, RHSA-2025:7641, RHSA-2025:8414, RLSA-2025:7409, RLSA-2025:7482, RLSA-2025:8414, ROOT-OS-UBUNTU-2404-CVE-2024-52005, UBUNTU-CVE-2024-52005

## What is CVE-2024-52005?

CVE-2024-52005 is a high-severity vulnerability in git, published on 15 Jan 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Git is a source code management tool. When cloning from a server (or fetching, or pushing), informational or error messages are transported from the remote Git process to the client via the so-called "sideband channel". These messages will be prefixed with "remote:" and printed directly to the standard error output. Typically, this standard error output is connected to a terminal that understands ANSI escape sequences, which Git did not protect against. Most modern terminals support control sequences that can be used by a malicious actor to hide and misrepresent information, or to mislead the user into executing untrusted scripts. As requested on the git-security mailing list, the patches are under discussion on the public mailing list. Users are advised to update as soon as possible. Users unable to upgrade should avoid recursive clones unless they are from trusted sources.

Weakness: CWE-150 (Improper Neutralization of Escape, Meta, or Control Sequences), CWE-116 (Improper Encoding or Escaping of Output)

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

1 open source package ship an affected version, including git. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `git` | Bitnami | All versions | 2.40.5, 2.41.4, 2.42.5, 2.43.7, 2.44.4, 2.45.4, 2.46.4, 2.47.2, 2.48.2 |
| `git` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `git-all` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `git-core` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `git-core-doc` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `git-credential-libsecret` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `git-daemon` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `git-email` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `git-gui` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `git-instaweb` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `git-subtree` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `git-svn` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `gitk` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `gitweb` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `perl-Git` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `perl-Git-SVN` | AlmaLinux:10 | All versions | 2.47.1-2.el10_0 |
| `git` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `git-all` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `git-core` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `git-core-doc` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `git-credential-libsecret` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `git-daemon` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `git-email` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `git-gui` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `git-instaweb` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `git-subtree` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `git-svn` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `gitk` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `gitweb` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `perl-Git` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `perl-Git-SVN` | AlmaLinux:8 | All versions | 2.43.5-3.el8_10 |
| `git` | AlmaLinux:9 | All versions | 2.47.1-2.el9_6 |
| `git-all` | AlmaLinux:9 | All versions | 2.47.1-2.el9_6 |
| `git-core` | AlmaLinux:9 | All versions | 2.47.1-2.el9_6 |
| `git-core-doc` | AlmaLinux:9 | All versions | 2.47.1-2.el9_6 |
| `git-credential-libsecret` | AlmaLinux:9 | All versions | 2.47.1-2.el9_6 |
| `git-daemon` | AlmaLinux:9 | All versions | 2.47.1-2.el9_6 |
| `git-email` | AlmaLinux:9 | All versions | 2.47.1-2.el9_6 |
| `git-gui` | AlmaLinux:9 | All versions | 2.47.1-2.el9_6 |
| `git-instaweb` | AlmaLinux:9 | All versions | 2.47.1-2.el9_6 |

Products: Git Git.

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

Upgrade git to a fixed version for your release line: 2.40.5, 2.41.4, 2.42.5 or 2.43.7.

## Is CVE-2024-52005 being exploited?

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

Public exploit code:

- Proof-of-Concept for CVE-2024-52005: ANSI escape sequence injection in Git. Demonstrates incorrect 'not_affected' VEX claims in hardened container images. (github_poc): https://github.com/andrewd-cg/cve-2024-52005-poc

## Other vulnerabilities in git

- [CVE-2024-32002](https://insights.sbomify.com/CVE-2024-32002/): Git's recursive clones on case-insensitive filesystems that support symlinks are susceptible to Remote Code Execution (critical 9.1)
- [CVE-2008-5517](https://insights.sbomify.com/CVE-2008-5517/): Command injection in n/a (high 7.5)
- [CVE-2008-3546](https://insights.sbomify.com/CVE-2008-3546/): Memory corruption in n/a (high 7.5)
- [CVE-2006-0477](https://insights.sbomify.com/CVE-2006-0477/): Memory corruption in n/a (high 7.5)
- [CVE-2009-2108](https://insights.sbomify.com/CVE-2009-2108/): Denial of service in n/a (medium 5.0)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-52005 is a high-severity vulnerability in git, published on 15 Jan 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-52005 in the wild and no public exploit code.

Affected packages and fixed versions:
- git (Bitnami): affected all versions; fixed in 2.40.5, 2.41.4, 2.42.5, 2.43.7, 2.44.4, 2.45.4, 2.46.4, 2.47.2, 2.48.2

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-52005/ (Markdown: https://insights.sbomify.com/CVE-2024-52005/index.md)
```

## Sources

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

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