Intel

AIKIDO-2026-245360

moonshine/moonshine is vulnerable to Unrestricted Upload of File with Dangerous Type

Unrestricted Upload of File with Dangerous TypeGHSA-54q6-6rhc-7gc4 Published 2 days ago

88

High Risk

This Affects:

PHPmoonshine/moonshine
1.21.0 - 3.18.0
Fixed in 3.18.1
4.0.0 - 4.18.1
Fixed in 4.18.2
Are you affected? Scan for Free

TL;DR

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.

Who does this affect?

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.

Background info

moonshine/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.

How to fix this

Upgrade the moonshine/moonshine library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform