[3.6] wget: Multiple vulnerabilities (CVE-2017-13089, CVE-2017-13090)
CVE-2017-13089: The http.c:skip_short_body() function is called in
some circumstances, such as when processing redirects. 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 skip the chunk in pieces of 512 bytes
by using the MIN() macro, but ends up passing the negative chunk length
to connect.c:fd_read(). As fd_read() takes an int argument, the high
32 bits of the chunk length are discarded,
leaving fd_read() with a completely attacker controlled length
argument.
References:
https://nvd.nist.gov/vuln/detail/CVE-2017-13089
http://openwall.com/lists/oss-security/2017/10/27/1
Patch:
http://git.savannah.gnu.org/cgit/wget.git/commit/?id=d892291fb8ace4c3b734ea5125770989c215df3f
CVE-2017-13090: The retr.c:fd_read_body() 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:fd_read(). As fd_read()
takes an int argument, the high 32 bits of the chunk length are
discarded, leaving fd_read() with a completely attacker
controlled length argument. The attacker can corrupt malloc metadata
after the allocated buffer.
References:
https://nvd.nist.gov/vuln/detail/CVE-2017-13090
http://openwall.com/lists/oss-security/2017/10/27/1
Patch:
http://git.savannah.gnu.org/cgit/wget.git/commit/?id=ba6b44f6745b14dce414761a8e4b35d31b176bba
(from redmine: issue id 8074, created on 2017-10-30, closed on 2018-05-24)
- Relations:
- parent #8073 (closed)
- Changesets:
- Revision de6df5d6 on 2018-01-05T13:21:45Z:
main/wget: security upgrade to 1.19.2 (CVE-2017-13089, CVE-2017-13090)
Fixes #8074