CVE-2026-41130: Craftcms/cms Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-95wr-3f2v-v2wh
CWE-918
Published
Advisory Summary

CVE-2026-41130 is a MODERATE remote code execution vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Craftcms/cms libraries in the Packagist ecosystem. The issue involves craft cms has a host header injection leading to ssrf via resource-js endpoint. Remediation is available by upgrading affected packages to version 5.9.15, 4.17.9.

CVE-2026-41130 at a Glance

CVE Identifier CVE-2026-41130
GHSA Identifier GHSA-95wr-3f2v-v2wh
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Craftcms/cms
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-41130

To remediate this vulnerability, upgrade all affected Craftcms/cms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

craftcms/cms fixed: 5.9.15
Upgrade craftcms/cms to 5.9.15
craftcms/cms fixed: 4.17.9
Upgrade craftcms/cms to 4.17.9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for craftcms/cms

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-41130, inspect your project dependencies for Craftcms/cms:

inspect dependencies for craftcms/cms

Analyze the terminal output to locate any version of Craftcms/cms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.9.15), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Craftcms/cms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: 1. Attacker sends request with controlled `Host` header. 2. Application derives `baseUrl` from the malicious Host. 3. `url` parameter is required to start with this `baseUrl`. 4. Validation passes. 5. Guzzle performs a server-side HTTP request to the attacker-controlled host. 6. 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 1. Start a listener inside the container: python3 -m http.server 9999 2. Send a request to resource-js with a controlled Host header. 3. Observe that the internal listener receives a request (OOB confirmation).

CVE-2026-41130 Affected Craftcms/cms Versions

2 component(s)
Fixed Versions:
5.9.154.17.9
Product / Package Ecosystem Affected Versions Fixed Version
craftcms/cms
Packagist
≥ 5.0.0-RC1
< 5.9.15
5.9.15
craftcms/cms
Packagist
≥ 4.0.0-RC1
< 4.17.9
4.17.9

References

Frequently Asked Questions

What is CVE-2026-41130?
CVE-2026-41130 is a security vulnerability in Craftcms/cms involving Craft CMS has a host header injection leading to SSRF via resource-js endpoint under CWE-918: Server-Side Request Forgery (SSRF).
Which Craftcms/cms versions are affected?
Affected versions include releases prior to 5.9.15, 4.17.9 across affected packages: craftcms/cms.
What version fixes CVE-2026-41130?
Upgrading to 5.9.15, 4.17.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is craftcms/cms affected?
Yes, craftcms/cms is affected in releases prior to 5.9.15, 4.17.9. Upgrade your dependency to 5.9.15, 4.17.9 or later.
What CWE is associated with CVE-2026-41130?
CVE-2026-41130 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Packagist dependencies for CVE-2026-41130?
Run the dependency tree command: 'inspect dependencies for craftcms/cms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-95wr-3f2v-v2wh",
  "modified" : "2026-04-24T20:42:23Z",
  "published" : "2026-04-14T23:36:09Z",
  "aliases" : [ "CVE-2026-41130" ],
  "summary" : "Craft CMS has a host header injection leading to SSRF via resource-js endpoint",
  "details" : "### Summary\n\nThe `resource-js` endpoint in Craft CMS allows unauthenticated requests to proxy remote JavaScript resources. \nWhen `trustedHosts` is not explicitly restricted (default configuration), the application trusts the client-supplied Host header. \n\nThis allows an attacker to control the derived `baseUrl`, which is used in prefix validation inside `actionResourceJs()`. \nBy supplying a malicious Host header, the attacker can make the server issue arbitrary HTTP requests, leading to Server-Side Request Forgery (SSRF).\n\n### Details\n\nThe vulnerability exists in `AppController::actionResourceJs()`.\n\nThe 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.\n\nAttack chain:\n\n1. Attacker sends request with controlled `Host` header.\n2. Application derives `baseUrl` from the malicious Host.\n3. `url` parameter is required to start with this `baseUrl`.\n4. Validation passes.\n5. Guzzle performs a server-side HTTP request to the attacker-controlled host.\n6. SSRF occurs.\n\nThis does not rely on string parsing bypass. It relies on Host header trust.\n\n### PoC (safe reproduction steps)\n\nEnvironment:\n- Craft CMS 5.9.12\n- Default configuration (no trustedHosts restriction)\n- Docker deployment\n\n1. Start a listener inside the container:\n   python3 -m http.server 9999\n\n2. Send a request to resource-js with a controlled Host header.\n\n3. Observe that the internal listener receives a request (OOB confirmation).",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "craftcms/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0-RC1"
      }, {
        "fixed" : "5.9.15"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.9.14"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "craftcms/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0-RC1"
      }, {
        "fixed" : "4.17.9"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.17.8"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/security/advisories/GHSA-95wr-3f2v-v2wh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41130"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/commit/ebe7e85f1c89700d64332f72492be2e9a594e783"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/craftcms/cms"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-14T23:36:09Z",
    "nvd_published_at" : "2026-04-22T00:16:28Z"
  }
}