Description
Craft CMS is a content management system (CMS). Versions 5.0.0-RC1 through 5.9.20, and 4.0.0-RC1 through 4.17.13 contain an authorization issue in the AssetsController::actionReplaceFile that can delete a source asset without source delete permission by supplying both assetId and sourceAssetId. AssetsController::actionReplaceFile() supports replacing a target asset file using another existing asset as the source. The action loads: assetId -> $assetToReplace and sourceAssetId -> $sourceAsset, then enforces replace permissions using ($assetToReplace ?: $sourceAsset). When both IDs are provided, this expression resolves to the target asset so no permission check is performed against the source asset volume. When both assets are present, Craft copies the source file into the target and then deletes the source asset. There is no deletion check for for the source asset. An authenticated user who can replace files in one volume can delete assets in another volume where they do not have delete permission, as long as they can obtain a sourceAssetId, leading to broken content references and data loss. This issue has been fixed in versions 4.17.14 and 5.9.21.
Published: 2026-07-01
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Craft CMS’s AssetsController::actionReplaceFile allows an authenticated user with file‑replacement rights to delete a source asset when both assetId and sourceAssetId are supplied. The method first loads the specified assets, then checks replace permissions only on the target asset, because ($assetToReplace ?: $sourceAsset) evaluates to the target. Since there is no permission check for deleting the source asset, the source file is copied to the target and the source asset is removed without the user having delete permission. This enables an attacker who can replace files in one volume to delete assets in another volume where delete rights are absent, causing broken content references and data loss.

Affected Systems

Versions 4.0.0‑RC1 to 4.17.13 and 5.0.0‑RC1 to 5.9.20 of Craft issue is fixed in Craft CMS 4.17.14 and 5.9.21, which should be deployed to eliminate the vulnerability.

Risk and Exploitability

The CVSS score of 5.3 reflects moderate risk. The EPSS score is below 1%, meaning the probability of exploitation is low. An authenticated user with file‑replacement rights can delete a source asset in another volume where delete permission is absent, leading to irreversible data loss.

Generated by OpenCVE AI on July 21, 2026 at 13:11 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to Craft CMS 4.17.14 or later (or 5.9.21) to apply the vendor fix.
  • Restrict replace‑file permissions to only trusted, privileged accounts to limit who can trigger the deletion.
  • Perform regular audits of asset references and check for broken links or missing assets after updates or deletions.

Generated by OpenCVE AI on July 21, 2026 at 13:11 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-qh45-9g5p-m2v4 Craft CMS: Unauthorized Deletion of Source Assets During File Replacement
History

Thu, 02 Jul 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 01 Jul 2026 22:45:00 +0000

Type Values Removed Values Added
Description Craft CMS is a content management system (CMS). Versions 5.0.0-RC1 through 5.9.20, and 4.0.0-RC1 through 4.17.13 contain an authorization issue in the AssetsController::actionReplaceFile that can delete a source asset without source delete permission by supplying both assetId and sourceAssetId. AssetsController::actionReplaceFile() supports replacing a target asset file using another existing asset as the source. The action loads: assetId -> $assetToReplace and sourceAssetId -> $sourceAsset, then enforces replace permissions using ($assetToReplace ?: $sourceAsset). When both IDs are provided, this expression resolves to the target asset so no permission check is performed against the source asset volume. When both assets are present, Craft copies the source file into the target and then deletes the source asset. There is no deletion check for for the source asset. An authenticated user who can replace files in one volume can delete assets in another volume where they do not have delete permission, as long as they can obtain a sourceAssetId, leading to broken content references and data loss. This issue has been fixed in versions 4.17.14 and 5.9.21.
Title Craft CMS: Unauthorized Deletion of Source Assets During File Replacement
Weaknesses CWE-639
CWE-862
References
Metrics cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-02T14:47:28.384Z

Reserved: 2026-06-04T16:26:05.985Z

Link: CVE-2026-50283

cve-icon Vulnrichment

Updated: 2026-07-02T14:47:01.003Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-21T13:15:05Z

Weaknesses
  • CWE-639

    Authorization Bypass Through User-Controlled Key

  • CWE-862

    Missing Authorization