GitHub Advisoryadvisory · Packagist
GHSA-3w32-23wj-rxg3 Craft CMS Vulnerable to Unauthorized Deletion of Destination Folders During Forced Moves
HIGH
Official page ↗
- Aliases
- CVE-2026-50282
- Ecosystem
- Packagist
- Packages
- craftcms/cms
- Severity
- High
- CVSS vector
- CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
- Weaknesses
- CWE-862
- Reviewed
- 2026-07-02
Affected packages
• Packagist craftcms/cms: >= 5.0.0-RC1, < 5.9.21 → fixed in 5.9.21
• Packagist craftcms/cms: >= 4.0.0-RC1, < 4.17.14 → fixed in 4.17.14
Description
We have identified an authorization issue in Craft CMS where a forced folder move can delete a conflicting destination folder without destination delete permission.
Description
Craft CMS’s `craft\\controllers\\AssetsController::actionMoveFolder()` supports moving an asset folder into a destination parent folder. If a folder with the same name already exists at the destination, the action can be called with `force=true` to overwrite the destination.
The permission checks for this action allow:
• `deleteAssets:` for the folder being moved
• `createFolders:` for the destination parent folder
• `saveAssets:` for the destination parent folder
The action does not require `deleteAssets` on the destination volume or destination conflict folder. When `force=true` and a name conflict exists, the code deletes the destination folder to resolve the conflict.
```php
$this->requireVolumePermissionByFolder('deleteAssets', $folderToMove);
$this->requireVolumePermissionByFolder('createFolders', $destinationFolder);
$this->requireVolumePermissionByFolder('saveAssets', $destinationFolder);
```
*src/controllers/AssetsController.php:L751-L753*
Indexed destination conflicts are deleted via the Assets service:
```php
$assets->deleteFoldersByIds($existingFolder->id);
```
*src/controllers/AssetsController.php:L798-L798*
Unindexed destination conflicts are deleted directly in the volume filesystem:
```php
$targetVolume->deleteDirectory(rtrim($destinationFolder->path, '/') . '/' . $folderToMove->name);
```
*src/controllers/AssetsController.php:L815*
Impact
A user who cannot delete assets in a destination volume can still delete a destination folder and its contents by triggering a forced move into a conflicting name. This can cause asset loss, broken references in entries and fields that point to deleted assets, and operational disruption.
Related
Alias · CVE (1)
- CVE-2026-50282 Craft CMS is a content management system (CMS). vulnerability
Weakness · CWE (1)
- CWE-862 Missing Authorization weakness