CVE-2017-13090: GNU Wget: heap overflow in HTTP protocol handling
A heap-based buffer overflow vulnerability was found in HTTP protocol handling, potentially allowing a code execution.
The retr.c:fdreadbody() function is called when processing OK responses. When the response is sent chunked, the chunk parser uses strtol() to read each chunk's length, but doesn't check that the chunk length is a non-negative number. The code then tries to read the chunk in pieces of 8192 bytes by using the MIN() macro, but ends up passing the negative chunk length to retr.c:fdread(). As fdread() takes an int argument, the high 32 bits of the chunk length are discarded, leaving fdread() with a completely attacker controlled length argument. The attacker can corrupt malloc metadata after the allocated buffer.
Other sources
The retr.c:fdreadbody() function is called when processing OK responses. When the response is sent chunked in wget before 1.19.2, the chunk parser uses strtol() to read each chunk's length, but doesn't check that the chunk length is a non-negative number. The code then tries to read the chunk in pieces of 8192 bytes by using the MIN() macro, but ends up passing the negative chunk length to retr.c:fdread(). As fdread() takes an int argument, the high 32 bits of the chunk length are discarded, leaving fdread() with a completely attacker controlled length argument. The attacker can corrupt malloc metadata after the allocated buffer.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2017-13090?
The severity of CVE-2017-13090 is classified as moderate, as it can lead to improper parsing of chunked responses.
How do I fix CVE-2017-13090?
To fix CVE-2017-13090, upgrade to GNU Wget version 1.19.2 or later.
Which software versions are affected by CVE-2017-13090?
CVE-2017-13090 affects GNU Wget versions prior to 1.19.2, and specific Debian releases including Debian 8.0 and 9.0.
What type of vulnerability is CVE-2017-13090?
CVE-2017-13090 is a vulnerability related to improper validation of chunked HTTP response lengths.
Can CVE-2017-13090 be exploited remotely?
Yes, CVE-2017-13090 can potentially be exploited remotely if an attacker sends malicious chunked responses.