Intel

AIKIDO-2026-245360

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

GHSA-54q6-6rhc-7gc4Published Sep 22, 2026
September 22, 2026

88

CVE Score

High

Unrestricted Upload of File with Dangerous Type

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.

How do I fix this?

Upgrade the moonshine/moonshine library to the patch version.

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.

Versions

1.21.0 - 3.18.0

Fixed in 3.18.1

4.0.0 - 4.18.1

Fixed in 4.18.2

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.

Get secure today,
quickly and for free.

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.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea