moonshine/moonshine is vulnerable to Unrestricted Upload of File with Dangerous Type
88
CVE Score
High
Unrestricted Upload of File with Dangerous Type
MoonShine's FileModelApply::store() re-checks the MIME-derived extension of an uploaded file but never validates the extension of the final stored filename when a File/Image field uses keepOriginalFileName() or a customName() callback. A file detected as an allowed type, such as an image, can be persisted under a disallowed executable extension such as .php by controlling the original or custom filename, bypassing an explicitly configured allowedExtensions() list. On a deployment where the storage disk is web-accessible and the server executes the stored file type, this leads to remote code execution. The fix validates the extension of the actual stored name via storeAs() before saving.
Upgrade the moonshine/moonshine library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and you use a File or Image field with keepOriginalFileName() or a customName() callback that can produce an extension from untrusted input.
1.21.0 - 3.18.0
Fixed in 3.18.14.0.0 - 4.18.1
Fixed in 4.18.2moonshine/moonshine is vulnerable to Unrestricted Upload of File with Dangerous Type in versions 1.21.0 - 3.18.0 and 4.0.0 - 4.18.1.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.