The Media Library upload handler validates the destination filename against an extension allowlist (default_extensions), rejecting types such as php, phtml, html, and htm. The image crop handler (MediaManager::onCropImage / cropImage) did not perform this check. The destination filename was taken from user input, the extension was extracted from it, and the staged bytes were written to the public media folder under that attacker-chosen extension. Combined with the fact that upload accepts any file contents under an allowlisted extension (a PHP payload disguised as .jpg), and that the zero-dimension crop branch performs a byte-for-byte File::copy rather than re-encoding the pixels, an authenticated backend user with the media.library.create permission could write a file with arbitrary extension and arbitrary contents into the public media folder.
Scope of impact depends on web server configuration. On a default October CMS install (using the shipped Apache .htaccess or nginx.conf), PHP execution from the media folder is blocked, so the realistic outcome is stored XSS via .html or .svg files served from the application origin. On a server that is configured to execute PHP inside the media directory (a non-default but real-world misconfiguration), the same bug becomes remote code execution.
.html or .svg files served from the application origin, executing script in the browser of any backend user or visitor who opens the fileHtml::cleanVector step only runs on the upload path, so uploading malicious SVG content as a .jpg and then cropping it to .svg skips the sanitizer entirelymedia.library.create permission...4.3.2Exploitability
AV:NAC:LPR:HUI:NScope
S:CImpact
C:LI:LA:N5.5/CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:NInjection
Other