Kestrel
대시보드로 돌아가기
CVE-2026-50284HIGHMITRENVDGHSA대응게시일: 2026. 07. 01.수정일: 2026. 07. 02.

Craft CMS: Missing peer-permission check in `AssetsController::actionDeleteFolder` allows deletion of other users' assets

Auth

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
high

이론적 심각도 점수

EPSS
0.2%상위 83.6%

30일 내 악용 확률 예측

KEV
미등재

실측 악용 기록 없음

권장 대응 기한60일 이내CISA SSVC 기준

계획된 패치 주기 내 조치(60일 이내)

외부 노출· KEV 미등재 · 자동화 어려움 · 부분 영향 · 외부 노출

CVSS 벡터 · 메트릭

CVSS 벡터 정보 없음

상세 설명

Summary

AssetsController::actionDeleteFolder() only requires the deleteAssets:<volume-uid> permission for the target folder. It never enforces deletePeerAssets:<volume-uid>, even though Assets::deleteFoldersByIds() cascades deletion to every descendant folder and every asset inside, regardless of who uploaded them. A low-privilege user who has been granted folder-management rights on a shared volume can therefore destroy assets uploaded by other users (peer assets), bypassing the per-asset peer-permission check that the sibling actionDeleteAsset endpoint correctly applies.

This is the same bug class that was just fixed in actionMoveFolder as GHSA-3w32-23wj-rxg3 (commit 05c2042, Apr 23 2026); the fix added requireVolumePermissionByFolder('deletePeerAssets', …) and savePeerAssets checks to the move endpoint but did not propagate to the delete-folder endpoint.

Details

src/controllers/AssetsController.php:552-569:

bash
1public function actionDeleteFolder(): Response
2{
3 $this->requireAcceptsJson();
4 $folderId = $this->request->getRequiredBodyParam('folderId');
5
6 $assets = Craft::$app->getAssets();
7 $folder = $assets->getFolderById($folderId);
8
9 if (!$folder) {
10 throw new BadRequestHttpException('The folder cannot be found');
11 }
12
13 // Check if it's possible to delete objects in the target volume.
14 $this->requireVolumePermissionByFolder('deleteAssets', $folder); // <-- only checks deleteAssets
15 $assets->deleteFoldersByIds($folderId);
16
17 return $this->asSuccess();
18}

requireVolumePermissionByFolder() (src/controllers/AssetsControllerTrait.php:75-88) only resolves to a single requirePermission('deleteAssets:<vol-uid>') call. The peer-equivalent helper (requirePeerVolumePermissionByAsset) is never invoked because there is no folder-level peer helper that iterates the folder's contents.

Assets::deleteFoldersByIds() (src/services/Assets.php:311-349) then enumerates the folder + every descendant folder, queries every asset under those IDs, and calls Craft::$app->getElements()->deleteElement($asset, true) directly:

bash
1$assetQuery = Asset::find()->folderId($allFolderIds);
2$elementService = Craft::$app->getElements();
3
4foreach (Db::each($assetQuery) as $asset) {
5 $asset->keepFileOnDelete = !$deleteDir;
6 $elementService->deleteElement($asset, true);
7}

This bypasses Asset::canDelete() (src/elements/Asset.php:1515-1536):

bash
1public function canDelete(User $user): bool
2{
3 if ($this->isFolder) { return false; }
4 if (parent::canDelete($user)) { return true; }
5 $volume = $this->getVolume();
6 if (Assets::isTempUploadFs($volume->getFs())) { return true; }
7
8 if ($this->uploaderId !== $user->id) {
9 return $user->can("deletePeerAssets:$volume->uid"); // <-- never reached on cascade delete
10 }
11 return $user->can("deleteAssets:$volume->uid");
12}

Compare to actionDeleteAsset (src/controllers/AssetsController.php:579-613), which correctly does:

bash
1$this->requireVolumePermissionByAsset('deleteAssets', $asset);
2$this->requirePeerVolumePermissionByAsset('deletePeerAssets', $asset);

The fix that landed in 05c2042 for actionMoveFolder (src/controllers/AssetsController.php:733-765) added both savePeerAssets and deletePeerAssets requireVolumePermissionByFolder checks to mirror the per-asset pattern, but the same hardening was not applied to actionDeleteFolder or actionRenameFolder (which also calls deleteFoldersByIds indirectly through later logic).

The asymmetry between the two endpoints demonstrates the missing check.

Impact

  • Integrity / availability of other users' assets on any volume where the attacker has deleteAssets but not deletePeerAssets: the attacker can permanently delete peer-owned files (and their parent folder structure) on the underlying filesystem, with no recovery via Craft's UI.
  • The Craft permission model explicitly distinguishes "delete your own assets" (deleteAssets) from "delete other users' assets" (deletePeerAssets) precisely so administrators can grant the former without the latter on shared volumes — this finding renders that distinction unenforceable for any user given folder-delete rights.
  • No information disclosure or remote code execution; impact is bounded to the affected volume's contents.
  • Does not require any non-default configuration: the affected endpoint is enabled by default and only requires that an administrator has split deleteAssets from deletePeerAssets (the documented, supported permission model).

AI 심층 분석

공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.