
====================================================================

                              CERT-Renater

                 Note d'Information No. 2017/VULN312
_____________________________________________________________________

DATE                : 30/10/2017

HARDWARE PLATFORM(S): /

OPERATING SYSTEM(S): Systems running GNU Wget versions prior to 1.19.2.

=====================================================================
http://seclists.org/oss-sec/2017/q4/136
https://www.viestintavirasto.fi/en/2017/haavoittuvuus-2017-037
____________________________________________________________________


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,
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.

Patch attached, original at:

http://git.savannah.gnu.org/cgit/wget.git/commit/?id=d892291fb8ace4c3b73
4ea5125770989c215df3f

CVE-2017-13090:

The retr.c:fd_read_body() 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: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.

Patch attached, original at:

http://git.savannah.gnu.org/cgit/wget.git/commit/?id=ba6b44f6745b14dce41
4761a8e4b35d31b176bba

Reported by:

Antti Levomäki, Christian Jalio, Joonas Pihlaja from Forcepoint

Advisory:

https://www.viestintavirasto.fi/en/2017/haavoittuvuus-2017-037

Also attached are JSON versions of the vulnerability details (in the
CVE 4.0 schema as formatted by Vulnogram, https://vulnogram.github.io/).

Regards,

- -Jussi / NCSC-FI

==========================================================
+ CERT-RENATER          | tel : 01-53-94-20-44           +
+ 23 - 25 Rue Daviel    | fax : 01-53-94-20-41           +
+ 75013 Paris           | email: cert@support.renater.fr +
==========================================================




