Server-Side Request Forgery (SSRF) Affecting node package, versions [,18.19.1) [19.0.0,20.11.1) [21.0.0,21.6.2)
Threat Intelligence
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-UPSTREAM-NODE-8379641
- published 14 Nov 2024
- disclosed 7 Feb 2024
- credit Arash Shakery
Introduced: 7 Feb 2024
CVE-2024-24806 Open this link in a new tabHow to fix?
Upgrade node
to version 18.19.1, 20.11.1, 21.6.2 or higher.
Overview
node is a JavaScript runtime built on Chrome's V8 JavaScript engine.
Affected versions of this package are vulnerable to Server-Side Request Forgery (SSRF) due to the handling of the hostname_ascii
variable in the uv_getaddrinfo
function. Attackers can exploit the creation of addresses that bypass developer checks and resolve to unintended IP addresses, to access internal APIs or for websites that allow users to have username.example.com
pages, potentially exposing internal services to attacks.
Notes:
- Depending on the build and runtime environment, it can lead to different exploitation scenarios:
The last byte of the hostname is a random value (0-256) but identical in successive calls, and the subsequent byte is a null byte. This situation can be exploited through brute force, especially in production environments where many Node.js instances run in parallel (pm2, kubernetes, etc).
Since the last byte is random, there are cases where it's one of 0-9a-f, which makes 16 possible cases (out of 256) useful for calling localhost (127.0.0.x) and potentially bypassing security measures on internal APIs. The same is true for calling other IP-ranges.
- When deployed in an environment with multiple pods (e.g., Kubernetes), is vulnerable to the attack described above, potentially allowing unauthorized access to internal APIs.