// For flags

CVE-2024-24806

Improper Domain Lookup that potentially leads to SSRF attacks in libuv

Severity Score

7.3
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

1
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

libuv is a multi-platform support library with a focus on asynchronous I/O. The `uv_getaddrinfo` function in `src/unix/getaddrinfo.c` (and its windows counterpart `src/win/getaddrinfo.c`), truncates hostnames to 256 characters before calling `getaddrinfo`. This behavior can be exploited to create addresses like `0x00007f000001`, which are considered valid by `getaddrinfo` and could allow an attacker to craft payloads that resolve to unintended IP addresses, bypassing developer checks. The vulnerability arises due to how the `hostname_ascii` variable (with a length of 256 bytes) is handled in `uv_getaddrinfo` and subsequently in `uv__idna_toascii`. When the hostname exceeds 256 characters, it gets truncated without a terminating null byte. As a result attackers may be able to access internal APIs or for websites (similar to MySpace) that allows users to have `username.example.com` pages. Internal services that crawl or cache these user pages can be exposed to SSRF attacks if a malicious user chooses a long vulnerable username. This issue has been addressed in release version 1.48.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.

libuv es una librería de soporte multiplataforma centrada en E/S asíncrona. La función `uv_getaddrinfo` en `src/unix/getaddrinfo.c` (y su contraparte de Windows `src/win/getaddrinfo.c`), trunca los nombres de host a 256 caracteres antes de llamar a `getaddrinfo`. Este comportamiento se puede aprovechar para crear direcciones como `0x00007f000001`, que `getaddrinfo` considera válidas y podrían permitir a un atacante crear payloads que se resuelvan en direcciones IP no deseadas, evitando las comprobaciones de los desarrolladores. La vulnerabilidad surge debido a cómo se maneja la variable `hostname_ascii` (con una longitud de 256 bytes) en `uv_getaddrinfo` y posteriormente en `uv__idna_toascii`. Cuando el nombre de host supera los 256 caracteres, se trunca sin un byte nulo final. Como resultado, los atacantes pueden acceder a API internas o a sitios web (similares a MySpace) que permiten a los usuarios tener páginas `nombre de usuario.ejemplo.com`. Los servicios internos que rastrean o almacenan en caché estas páginas de usuario pueden quedar expuestos a ataques SSRF si un usuario malintencionado elige un nombre de usuario largo y vulnerable. Este problema se solucionó en la versión 1.48.0. Se recomienda a los usuarios que actualicen. No se conocen workarounds para esta vulnerabilidad.

A server-side request forgery (SSRF) flaw was found in the libuv package due to how the `hostname_ascii` variable is handled in `uv_getaddrinfo` and `uv__idna_toascii`. When the hostname exceeds 256 characters, it gets truncated without a terminating null byte. As a result, attackers may be able to access internal APIs or for websites that allow users to have `username.example.com` pages. Internal services that crawl or cache these user pages can be exposed to SSRF attacks if a malicious user chooses a long vulnerable username. This issue could allow an attacker to craft payloads that resolve to unintended IP addresses, bypassing developer checks.

*Credits: N/A
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2024-01-31 CVE Reserved
  • 2024-02-07 CVE Published
  • 2024-08-14 EPSS Updated
  • 2024-09-02 CVE Updated
  • 2024-09-02 First Exploit
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-918: Server-Side Request Forgery (SSRF)
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Libuv
Search vendor "Libuv"
Libuv
Search vendor "Libuv" for product "Libuv"
>= 1.24.0 < 1.48.0
Search vendor "Libuv" for product "Libuv" and version " >= 1.24.0 < 1.48.0"
-
Affected