{"id":"CVE-2026-50283","published":"2026-07-01T22:20:01Z","modified":"2026-07-02T14:47:28Z","title":"Craft CMS: Unauthorized Deletion of Source Assets During File Replacement","vendor":"Craft CMS","product":"cms","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00364,"percentile":0.31059,"provenance":"source"},"cwes":[{"id":"CWE-862","name":"Missing Authorization"},{"id":"CWE-639","name":"Authorization Bypass Through User-Controlled Key"}],"references":[{"url":"https://github.com/craftcms/cms/security/advisories/GHSA-qh45-9g5p-m2v4","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/craftcms/cms/commit/2c2579c7f1030872423f268d0c8b48377101961d","tags":["x_refsource_MISC"]}],"priority":{"score":9.9,"factors":[{"name":"EPSS percentile","points":6.21},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"craft-cms","affectedVersions":[{"vendor":"craftcms","product":"cms","versions":[">= 5.0.0-RC1, < 5.9.21",">= 4.0.0-RC1, < 4.17.14"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-07-02T14:46:55.781150Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"craftcms/cms","vulnerableRanges":[">=5.0.0-RC1, <5.9.21",">=4.0.0-RC1, <4.17.14"],"patched":["5.9.21","4.17.14"],"from":["GHSA-qh45-9g5p-m2v4"],"provenance":"source"}],"summary":{"text":"The flaw is an authorization issue in Craft CMS's AssetsController::actionReplaceFile, where supplying both an assetId and a sourceAssetId causes the replace-permission check to be applied to the target asset rather than the source, so no check is made against the source asset's volume. An authenticated user who has file-replace rights in one volume and can obtain a sourceAssetId from another volume can cause the source asset to be deleted despite lacking delete permission there, resulting in broken content references and data loss.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:06:28Z"},"euvd":{"id":"EUVD-2026-41154","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-craft-cms-cms-cve-2023-30177","parents":[{"from":"CVE-2023-30177","to":"CVE-2026-50283","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/elements/Asset.php"],"commits":["https://github.com/craftcms/cms/commit/00fb253d5318e10204433e5d93934108e574005e","https://github.com/craftcms/cms/commit/2c2579c7f1030872423f268d0c8b48377101961d"],"basis":"rarely changed file"}]},{"from":"CVE-2026-32262","to":"CVE-2026-50283","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/controllers/AssetsController.php"],"commits":["https://github.com/craftcms/cms/commit/c997efbe4c66c14092714233aeebff15cdbfcf11","https://github.com/craftcms/cms/commit/2c2579c7f1030872423f268d0c8b48377101961d"],"basis":"shared function","functions":["actionReplaceFile"]}]}],"packageHistory":[{"cve":"CVE-2026-44011","published":"2026-05-12","fixed":"5.9.18","kev":false,"link":{"from":"CVE-2026-44011","to":"CVE-2026-50283","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:craftcms/cms","fromFixed":"4.17.12","toFixed":"4.17.14","daysApart":50}]}},{"cve":"CVE-2026-50280","published":"2026-07-01","fixed":"5.9.21","kev":false},{"cve":"CVE-2026-50281","published":"2026-07-02","fixed":"5.9.21","kev":false},{"cve":"CVE-2026-50282","published":"2026-07-02","fixed":"5.9.21","kev":false},{"cve":"CVE-2026-50283","published":"2026-07-01","fixed":"5.9.21","kev":false},{"cve":"CVE-2026-50284","published":"2026-07-01","fixed":"5.9.22","kev":false},{"cve":"CVE-2026-55790","published":"2026-07-01","fixed":"5.9.23","kev":false},{"cve":"CVE-2026-55793","published":"2026-07-01","fixed":"5.9.53","kev":false}],"package":"Packagist:craftcms/cms"}}