CVE-2025-0725: Heap overflow in curl with Content-Encoding gzip and old libz versions
An integer overflow in curl's handling of gzip headers when built against old libz versions can be triggered by a malicious HTTP server sending abnormally large gzip headers, leading to a heap overflow with attacker-controlled data. The attacker could potentially corrupt memory when curl processes a response with Content-Encoding: gzip.
- Disclosed after 3 months
Hello, I would like to report a vulnerability here that I previously reported to the curl project.
In curl's support for old libz version lies an integer overflow that can be triggered by a malicious http server by serving
abnormally large gzip headers that then leads to a heap overflow with attacker-controlled data when Content-Encoding: gzip
is used.
Original report: https://hackerone.com/reports/2956023 CVE: CVE-2025-0725 Severity: Low Official Advisory: https://curl.se/docs/CVE-2025-0725.html
Impact
-
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely an integer overflow in curl's gzip decompression code when using old libz versions, where a size calculation wraps around and leads to a heap buffer overflow.
Impact
A malicious HTTP server could cause a heap overflow with attacker-controlled data, potentially leading to memory corruption, though the report rates severity as low.
What the attacker needed
Curl built with an old libz version; malicious HTTP server; victim uses curl to fetch from server
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
curl downloads things from the internet. When it gets gzip-compressed data, it uses libz to decompress it. With old libz versions, a maths mistake (integer overflow) can happen when the gzip header is very large, causing curl to write outside the intended memory area, a heap overflow.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.