# CVE-2024-6874: macidn punycode buffer overread

> An attacker can trigger a buffer overread in libcurl's macidn backend, potentially leaking stack contents when processing specific IDN names.

- **Severity:** Low 3.1 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 Jul 2024
- **Updated:** 13 Feb 2025
- **Also known as:** ALPINE-CVE-2024-6874, AZL-47020, AZL-47046, AZL-49664, BELL-CVE-2024-6874, CLEANSTART-2026-AW71894, CURL-CVE-2024-6874, DEBIAN-CVE-2024-6874, GHSA-chhh-4xrf-42pg, JLSEC-2025-37

## What is CVE-2024-6874?

CVE-2024-6874 is a low-severity vulnerability in Haxx Libcurl, published on 24 Jul 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

libcurl's URL API function
[curl_url_get()](https://curl.se/libcurl/c/curl_url_get.html) offers punycode
conversions, to and from IDN. Asking to convert a name that is exactly 256
bytes, libcurl ends up reading outside of a stack based buffer when built to
use the *macidn* IDN backend. The conversion function then fills up the
provided buffer exactly - but does not null terminate the string.

This flaw can lead to stack contents accidently getting returned as part of
the converted string.

Weakness: CWE-125 (Out-of-bounds Read)

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

It affects 1 product.


Products: Haxx Libcurl.

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

Upgrade to a fixed version.

## Is CVE-2024-6874 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-6874 exists.

## Other vulnerabilities in Haxx Libcurl

- [CVE-2024-6197](https://insights.sbomify.com/CVE-2024-6197/): freeing stack buffer in utf8asn1str (high 7.5)
- [CVE-2017-1000254](https://insights.sbomify.com/CVE-2017-1000254/): Memory corruption in n/a (high 7.5)
- [CVE-2016-7141](https://insights.sbomify.com/CVE-2016-7141/): Auth bypass in n/a (high 7.5)
- [CVE-2017-1000099](https://insights.sbomify.com/CVE-2017-1000099/): Information disclosure in n/a (medium 6.5)
- [CVE-2017-1000100](https://insights.sbomify.com/CVE-2017-1000100/): Information disclosure in n/a (medium 6.5)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-6874 is a low-severity vulnerability in Haxx Libcurl, published on 24 Jul 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-6874 exists.

Affected product: Haxx Libcurl. 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-2024-6874/ (Markdown: https://insights.sbomify.com/CVE-2024-6874/index.md)
```

## Sources

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

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