Impact
Craft CMS's AssetsController->replaceFile() method permits authenticated users with replaceFiles permission to delete arbitrary files within the same filesystem root by injecting .. path traversal sequences into the targetFilename. The issue arises because the filename is used unsanitized in a deleteFile() call before the value is sanitized by Assets::prepareAssetName(), allowing deletion of any file under the shared root and thereby compromising the integrity of the site’s content stored on local filesystems.
Affected Systems
Craft CMS versions 4.0.0-RC1 through 4.17.4 and 5.0.0-RC1 through 5.9.10 are vulnerable. The vulnerability was addressed in version 4.17.5 and version 5.9.11.
Risk and Exploitability
The CVSS score for this vulnerability is 5.3, indicating moderate severity. EPSS is below 1% and the flaw is not listed in the CISA KEV catalog, suggesting a low exploitation probability. Exploitation requires an authenticated user with replaceFiles permission and is limited to local filesystem volumes, resulting in the potential removal of critical assets and undermining content integrity.
OpenCVE Enrichment
Github GHSA