// For flags

CVE-2017-13089

GNU Wget: stack overflow in HTTP protocol handling

Severity Score

8.8
*CVSS v3

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

2
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

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.

Se llama a la función http.c:skip_short_body() en ciertas circunstancias, como cuando se procesan redirecciones. Cuando la respuesta se envía fragmentada en wget en versiones anteriores a la 1.19.2, el analizador de fragmentos utiliza srtol() para leer la longitud de cada fragmento, pero no comprueba si esta longitud es un número no negativo. El código entonces intenta saltarse el fragmento en partes de 512 bytes utilizando la macro MIN(), pero acaba pasando la longitud negativa del fragmento a connect.c:fd_read(). Ya que fd_read() toma un argumento int, los 32 bits de la longitud del fragmento se descartan, dejando fd_read() con un argumento de longitud controlado por completo por el atacante.

A stack-based buffer overflow when processing chunked, encoded HTTP responses was found in wget. By tricking an unsuspecting user into connecting to a malicious HTTP server, an attacker could exploit this flaw to potentially execute arbitrary code.

*Credits: Antti Levomäki, Christian Jalio, Joonas Pihlaja from Forcepoint
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Network
Attack Complexity
Medium
Authentication
None
Confidentiality
Complete
Integrity
Complete
Availability
Complete
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2017-08-22 CVE Reserved
  • 2017-10-26 CVE Published
  • 2017-11-15 First Exploit
  • 2024-08-13 EPSS Updated
  • 2024-09-17 CVE Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer
  • CWE-121: Stack-based Buffer Overflow
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Gnu
Search vendor "Gnu"
Wget
Search vendor "Gnu" for product "Wget"
<= 1.19.1
Search vendor "Gnu" for product "Wget" and version " <= 1.19.1"
-
Affected
Debian
Search vendor "Debian"
Debian Linux
Search vendor "Debian" for product "Debian Linux"
8.0
Search vendor "Debian" for product "Debian Linux" and version "8.0"
-
Affected
Debian
Search vendor "Debian"
Debian Linux
Search vendor "Debian" for product "Debian Linux"
9.0
Search vendor "Debian" for product "Debian Linux" and version "9.0"
-
Affected