2026-03-20 09:30 UTC

Magento PolyShell Flaw Enables Unauthenticated Uploads, RCE and Account Takeover

Sansec is warning of a critical security flaw in Magento's REST API that could allow unauthenticated attackers to upload arbitrary executables and achieve code execution and account takeover.

The vulnerability has been codenamed PolyShell by Sansec owing to the fact that the attack hinges on disguising malicious code as an image.

There is no evidence that the shortcoming has been exploited in

There is no evidence that the shortcoming has been exploited in the wild.

The unrestricted file upload flaw affects all Magento Open Source and Adobe Commerce versions up to 2.4.9-alpha2.

The Dutch security firm said the problem stems from the fact that Magento's REST API accepts file uploads as part of the custom options for the cart item.

"When a product option has type 'file,' Magento processes an embedded file_info object containing base64-encoded file data, a MIME type, and a filename," it said .

"The file is written to pub/media/custom_options/quote/ on the server."

Depending on the web server configuration, the flaw can enable remote code execution via PHP upload or account takeover via stored XSS.

← Back to latest posts