5.5medium
October: Media Library Crop Handler Bypasses Upload Extension Allowlist
- Severity
- 5.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.57% (higher than 48% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-mqwx-84vv-mp26
Description
October System provides the system module for October Content Management System. Prior to 3.7.18 and 4.3.2, the Media Library MediaManager::onCropImage and cropImage path accepts a user-controlled destination filename without applying the default_extensions allowlist enforced by the normal upload path. An authenticated backend user with media.library.create permission can upload arbitrary bytes under an allowed extension and use the zero-dimension crop branch, which performs a byte-for-byte File::copy, to write those bytes into the public media folder under an attacker-selected extension. Default server configurations block PHP execution in that folder, but HTML or SVG output can produce stored cross-site scripting in the application origin; non-default servers that execute PHP in the media directory can expose remote code execution. This vulnerability is fixed in 3.7.18 and 4.3.2.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| octobercms october | < 3.7.18, >= 4.0.0, < 3.7.18, 4.3.2 | CVE List |
| october/october (Packagist) | up to 3.7.13, from 4.0.0 before 4.3.2 | GitHub Advisory Database |
All scores
| GitHub_M | 5.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N |
| GitHub | 5.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N |
Classification
What each source says
CVE List
October System provides the system module for October Content Management System. Prior to 3.7.18 and 4.3.2, the Media Library MediaManager::onCropImage and cropImage path accepts a user-controlled destination filename without applying the default_extensions allowlist enforced by the normal upload path. An authenticated backend user with media.library.create permission can upload arbitrary bytes under an allowed extension and use the zero-dimension crop branch, which performs a byte-for-byte File::copy, to write those bytes into the public media folder under an attacker-selected extension. Default server configurations block PHP execution in that folder, but HTML or SVG output can produce stored cross-site scripting in the application origin; non-default servers that execute PHP in the media directory can expose remote code execution. This vulnerability is fixed in 3.7.18 and 4.3.2.
GitHub Advisory Database
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.
Impact
- Bypass of the Media Library extension allowlist that the upload path enforces
- Stored XSS on default installs: attacker can write
.htmlor.svgfiles served from the application origin, executing script in the browser of any backend user or visitor who opens the file - SVG sanitizer bypass: the
Html::cleanVectorstep only runs on the upload path, so uploading malicious SVG content as a.jpgand then cropping it to.svgskips the sanitizer entirely - Remote code execution on deployments that execute PHP inside the media folder (non-default)
- Requires authenticated backend access with the
media.library.createpermission
Patches
The vulnerability has been patched in v3.7.18 and v4.3.3. The crop handler now applies the same extension allowlist check as the upload handler before staging the output file. As defense in depth, the central MediaLibrary::put and MediaLibrary::putFile write methods now validate the destination extension as well, so any future write path that goes through the library inherits the check. All users are encouraged to upgrade to the latest patched version.
Workarounds
If upgrading immediately is not possible:
- Restrict the
media.library.createpermission to fully trusted backend users only - Ensure the web server cannot execute PHP from the media storage directory (the shipped
.htaccessandnginx.confalready enforce this)
References
- Reported by nova-aryan
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-63193 changed 2026-11-21 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-mqwx-84vv-mp26 changed 2026-11-19 | CC-BY-4.0 |
| NVD | CVE-2026-63193 changed 2026-11-21 | Public domain |