# CVE-2026-124077: Apache Commons Codec: NUL bytes in tree entry names cause Git/SWHID identifier collisions (GitIdentifiers class)


- **Severity:** Medium 4.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 9 Nov 2026
- **Updated:** 12 Nov 2026
- **Also known as:** CLEANSTART-2026-EU04352, GHSA-26mf-gqw6-894w, UBUNTU-CVE-2026-124077

## What is CVE-2026-124077?

CVE-2026-124077 is a medium-severity vulnerability in Apache Commons Codec, published on 9 Nov 2026. 

### Official description

The GitIdentifiers class in Apache Commons Codec did not reject NUL bytes in tree entry names. Because Git uses a NUL byte to mark the end of each entry name in a tree object, a crafted name could make one tree serialize to the same bytes as a different tree. Two different directory trees could then receive the same Git tree identifier or SWHID.

The impact is limited: common file systems do not allow NUL bytes in file names, so trees built by walking a file system are not affected. Only applications that build trees from names supplied by other sources, such as entries of archive formats that permit NUL bytes in names (e.g. ZIP) or names passed directly to the API, are exposed.

This issue affects Apache Commons Codec: from 1.22.0 before 1.23.0.

Users are recommended to upgrade to version 1.23.0, which fixes the issue.

Weakness: CWE-158 (Improper Neutralization of Null Byte or NUL Character)

## Which versions are affected by CVE-2026-124077?


## How do I fix CVE-2026-124077?

Upgrade to a fixed version.

## Is CVE-2026-124077 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-124077 and fix it if it is affected.

What it is: CVE-2026-124077 is a medium-severity vulnerability in Apache Commons Codec, published on 9 Nov 2026. 
Exploitation: There is no known exploitation of CVE-2026-124077 in the wild and no public exploit code.

Affected product: Apache Commons Codec. No package-level version data is available, so check the vendor advisory linked from the reference page.

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

## Sources

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

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