5.5medium
Craft CMS has a host header injection leading to SSRF via resource-js endpoint
- Severity
- 5.5medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.94% (higher than 61% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-95wr-3f2v-v2wh
Description
Craft CMS is a content management system (CMS). In versions on the 4.x branch through 4.17.8 and the 5.x branch through 5.9.14, the `resource-js` endpoint in Craft CMS allows unauthenticated requests to proxy remote JavaScript resources. When `trustedHosts` is not explicitly restricted (default configuration), the application trusts the client-supplied Host header. This allows an attacker to control the derived `baseUrl`, which is used in prefix validation inside `actionResourceJs()`. By supplying a malicious Host header, the attacker can make the server issue arbitrary HTTP requests, leading to Server-Side Request Forgery (SSRF). Versions 4.17.9 and 5.9.15 patch the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| craftcms cms | >= 5.0.0-RC1, < 5.9.15, >= 4.0.0-RC1, < 4.17.9 | CVE List |
| craftcms/cms (Packagist) | from 5.0.0-RC1 before 5.9.15, from 4.0.0-RC1 before 4.17.9 | GitHub Advisory Database |
All scores
| GitHub_M | 5.5medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
Craft CMS is a content management system (CMS). In versions on the 4.x branch through 4.17.8 and the 5.x branch through 5.9.14, the `resource-js` endpoint in Craft CMS allows unauthenticated requests to proxy remote JavaScript resources. When `trustedHosts` is not explicitly restricted (default configuration), the application trusts the client-supplied Host header. This allows an attacker to control the derived `baseUrl`, which is used in prefix validation inside `actionResourceJs()`. By supplying a malicious Host header, the attacker can make the server issue arbitrary HTTP requests, leading to Server-Side Request Forgery (SSRF). Versions 4.17.9 and 5.9.15 patch the issue.
GitHub Advisory Database
Summary
The resource-js endpoint in Craft CMS allows unauthenticated requests to proxy remote JavaScript resources.
When trustedHosts is not explicitly restricted (default configuration), the application trusts the client-supplied Host header.
This allows an attacker to control the derived baseUrl, which is used in prefix validation inside actionResourceJs().
By supplying a malicious Host header, the attacker can make the server issue arbitrary HTTP requests, leading to Server-Side Request Forgery (SSRF).
Details
The vulnerability exists in AppController::actionResourceJs().
The function validates that the url parameter starts with assetManager->baseUrl. However, baseUrl is derived from the current request host. If trustedHosts is not configured, the Host header is fully attacker-controlled.
Attack chain:
- Attacker sends request with controlled
Hostheader. - Application derives
baseUrlfrom the malicious Host. urlparameter is required to start with thisbaseUrl.- Validation passes.
- Guzzle performs a server-side HTTP request to the attacker-controlled host.
- SSRF occurs.
This does not rely on string parsing bypass. It relies on Host header trust.
PoC (safe reproduction steps)
Environment:
- Craft CMS 5.9.12
- Default configuration (no trustedHosts restriction)
- Docker deployment
-
Start a listener inside the container: python3 -m http.server 9999
-
Send a request to resource-js with a controlled Host header.
-
Observe that the internal listener receives a request (OOB confirmation).
NVD (es)
Craft CMS es un sistema de gestión de contenido (CMS). En las versiones de la rama 4.x hasta la 4.17.8 y de la rama 5.x hasta la 5.9.14, el endpoint ’resource-js’ en Craft CMS permite peticiones no autenticadas para hacer proxy de recursos JavaScript remotos. Cuando ’trustedHosts’ no está explícitamente restringido (configuración por defecto), la aplicación confía en el encabezado Host proporcionado por el cliente. Esto permite a un atacante controlar la ’baseUrl’ derivada, que se utiliza en la validación de prefijos dentro de ’actionResourceJs()’. Al proporcionar un encabezado Host malicioso, el atacante puede hacer que el servidor emita peticiones HTTP arbitrarias, lo que lleva a la falsificación de petición del lado del servidor (SSRF). Las versiones 4.17.9 y 5.9.15 aplican un parche al problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-41130 changed 2026-04-22 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-95wr-3f2v-v2wh changed 2026-05-05 | CC-BY-4.0 |
| NVD | CVE-2026-41130 changed 2026-10-26 | Public domain |