GHSA-C43V-4CR8-6MVP
Vulnerability from github – Published: 2026-07-09 13:44 – Updated: 2026-07-09 13:44Summary
An authenticated path traversal in assets/icon allows local SVG file read by passing traversal sequences in the extension parameter. The issue is caused by file existence checks happening before extension validation.
Details
The endpoint:
- src/controllers/AssetsController.php:1115-1123
- actionIcon(string $extension) calls Assets::iconPath($extension) and returns sendFile($path, ...).
In Assets::iconPath():
- Path is built from user-controlled extension:
- src/helpers/Assets.php:906-909
- If file_exists($path) is true, path is returned immediately:
- src/helpers/Assets.php:910-912
Validation exists in Assets::iconSvg():
- preg_match('/^\w+$/', $extension)
- src/helpers/Assets.php:927-931
However, that validation is only reached if iconPath() does not find a file.
So traversal payloads that resolve to existing .svg files bypass validation and are served by sendFile().
Impact
- Authenticated users can read local .svg files accessible to the application process.
References
- https://github.com/craftcms/cms/commit/30f5f1a8d6edf0f3a00be72c42c78d9dc7d72d5c
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 4.17.6"
},
"package": {
"ecosystem": "Packagist",
"name": "craftcms/cms"
},
"ranges": [
{
"events": [
{
"introduced": "4.0.0-RC1"
},
{
"fixed": "4.17.7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 5.9.12"
},
"package": {
"ecosystem": "Packagist",
"name": "craftcms/cms"
},
"ranges": [
{
"events": [
{
"introduced": "5.0.0-RC1"
},
{
"fixed": "5.9.13"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-09T13:44:06Z",
"nvd_published_at": null,
"severity": "LOW"
},
"details": "### Summary\n\nAn authenticated path traversal in `assets/icon` allows local SVG file read by passing traversal sequences in the `extension` parameter. The issue is caused by file existence checks happening before extension validation.\n\n### Details\nThe endpoint:\n- `src/controllers/AssetsController.php:1115-1123`\n- `actionIcon(string $extension)` calls `Assets::iconPath($extension)` and returns `sendFile($path, ...)`.\n\nIn `Assets::iconPath()`:\n- Path is built from user-controlled `extension`:\n - `src/helpers/Assets.php:906-909`\n- If `file_exists($path)` is true, path is returned immediately:\n - `src/helpers/Assets.php:910-912`\n\nValidation exists in `Assets::iconSvg()`:\n - `preg_match(\u0027/^\\w+$/\u0027, $extension)`\n - `src/helpers/Assets.php:927-931`\n\nHowever, that validation is only reached if `iconPath()` does **not** find a file.\nSo traversal payloads that resolve to existing `.svg` files bypass validation and are served by `sendFile()`.\n\n### Impact\n\n- Authenticated users can read local .svg files accessible to the application process.\n\n### References\n\n- https://github.com/craftcms/cms/commit/30f5f1a8d6edf0f3a00be72c42c78d9dc7d72d5c",
"id": "GHSA-c43v-4cr8-6mvp",
"modified": "2026-07-09T13:44:06Z",
"published": "2026-07-09T13:44:06Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/craftcms/cms/security/advisories/GHSA-c43v-4cr8-6mvp"
},
{
"type": "WEB",
"url": "https://github.com/craftcms/cms/commit/30f5f1a8d6edf0f3a00be72c42c78d9dc7d72d5c"
},
{
"type": "PACKAGE",
"url": "https://github.com/craftcms/cms"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Craft CMS has authenticated path traversal in `assets/icon`, allowing local `.svg` file read"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.