Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS1jeGd2LXB4MzctNG1wMs4AA-Yf
Nuxt Icon affected by a Server-Side Request Forgery (SSRF)
Summary
nuxt/icon
provides an API to allow client side icon lookup. This endpoint is at /api/_nuxt_icon/[name]
.
The proxied request path is improperly parsed, allowing an attacker to change the scheme and host of the request. This leads to SSRF, and could potentially lead to sensitive data exposure.
Details
The new URL
constructor is used to parse the final path. This constructor can be passed a relative scheme or path in order to change the host the request is sent to. This constructor is also very tolerant of poorly formatted URLs.
As a result we can pass a path prefixed with the string http:
. This has the effect of changing the scheme to HTTP. We can then subsequently pass a new host, for example http:127.0.0.1:8080
. This would allow us to send requests to a local server.
PoC
Make a request to /api/_nuxt_icon/http:example.com
, observe the data returned has been fetched from a different resource than intended.
I typically try to find an example within Nuxt infrastructure that is vulnerable to these types of bugs, but I could not identify any with this endpoint enabled.
Impact
- SSRF, potential sensitive data exposure.
- I do not believe this can be chained into an XSS, but it may be possible.
- Does not have a security impact on services deployed on Cloudflare Workers.
- Does not impact certain builds and modes (like static builds).
- Can be mitigated using by disabling the
fallbackToApi
option.
Fix
- Ensure the host has not been changed after the path is parsed.
- Alternatively, prefix the path with
./
.
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1jeGd2LXB4MzctNG1wMs4AA-Yf
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 4 months ago
Updated: 4 months ago
CVSS Score: 8.6
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
Identifiers: GHSA-cxgv-px37-4mp2, CVE-2024-42352
References:
- https://github.com/nuxt/icon/security/advisories/GHSA-cxgv-px37-4mp2
- https://github.com/nuxt/icon/commit/4564518c2b2ed8235a7715056ccdfce96ca3d0ff
- https://nvd.nist.gov/vuln/detail/CVE-2024-42352
- https://github.com/advisories/GHSA-cxgv-px37-4mp2
Blast Radius: 1.0
Affected Packages
npm:@nuxt/icon
Dependent packages: 0Dependent repositories: 0
Downloads: 294,032 last month
Affected Version Ranges: <= 1.4.4
Fixed in: 1.4.5
All affected versions: 1.0.0, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4
All unaffected versions: 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.6.0, 1.6.1, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.8.0, 1.8.1, 1.8.2