The vulnerability description clearly indicates an SSRF vulnerability in the GraphQL save_<VolumeName>_Asset mutation due to improper validation of a URL provided for asset uploads. The provided commit 013db636fdb38f3ce5657fd196b6d952f98ebc52 directly addresses this issue. The patch modifies the src/gql/resolvers/mutations/Asset.php file, specifically within the handleUpload method. Before the patch, this method would take a URL from the user input and use it to fetch a file, without checking if the URL pointed to an internal or restricted resource. The patch introduces validation to ensure the URL's hostname is a valid domain and not an IP address, thus preventing the SSRF attack. Therefore, the craft\gql\resolvers\mutations\Asset::handleUpload function is the precise location of the vulnerability and would be present in a runtime profile during exploitation.
craft\gql\resolvers\mutations\Asset::handleUploadsrc/gql/resolvers/mutations/Asset.php
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| craftcms/cms | composer | >= 5.0.0-RC1, <= 5.8.20 | 5.8.21 |
| craftcms/cms | composer | >= 3.5.0, <= 4.16.16 | 4.16.17 |