craftcms/cms
Affected
- introduced
4.0.0-RC1, fixed4.17.7(ecosystem)
Fixed versions
4.17.7
Fix
The export has no generic command for this ecosystem.
Advisory
Also known as: CVE-2026-56394
Craft CMS has authenticated path traversal in assets/icon, allowing local .svg file read
Summary
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-1123actionIcon(string $extension) calls Assets::iconPath($extension) and returns sendFile($path, ...).In Assets::iconPath():
extension:src/helpers/Assets.php:906-909file_exists($path) is true, path is returned immediately:src/helpers/Assets.php:910-912Validation exists in Assets::iconSvg():
preg_match('/^\w+$/', $extension)src/helpers/Assets.php:927-931However, 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
References
Low Basis: The source's own band: LOW
4.0.0-RC1, fixed 4.17.7 (ecosystem)4.17.7
The export has no generic command for this ecosystem.
5.0.0-RC1, fixed 5.9.13 (ecosystem)5.9.13
The export has no generic command for this ecosystem.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0