Back to Blog Homepage
    Deploy Blog
    Nathan Chick

    PolyShell (CVE-2026-48356): Unrestricted File Upload in the Magento REST API

    A critical flaw in Magento's guest cart API let unauthenticated attackers smuggle executable PHP onto any store. Fixed upstream in May 2026, but not backported to older versions until July - here's what to check.

    PolyShell (CVE-2026-48356): Unrestricted File Upload in the Magento REST API

    Today's Adobe Commerce and Magento Open Source patches close out PolyShell, tracked as CVE-2026-48356: a critical unrestricted file upload vulnerability that's been quietly exploitable in production for months. Sansec's research lays out exactly how it works, and it's a good reminder that "unauthenticated" doesn't always mean "zero-day headline". This one sat in plain sight in the REST API's cart handling.

    Risk Overview

    • The flaw lives in how Magento processes file uploads for cart item custom options. Attackers submit a polyglot file (something with a valid image header wrapped around executable PHP) through the guest cart API.
    • Three gaps let it through: Magento doesn't verify the submitted option ID actually belongs to the product, the upload logic runs even when a product has no file-type option at all, and the only validation applied is a trivial getimagesizefromstring() image-header check rather than any real file-type restriction.
    • The most dangerous routes need no authentication whatsoever: POST /V1/guest-carts/:cartId/items and PUT /V1/guest-carts/:cartId/items/:itemId are open to anyone who can reach your storefront's API.
    • Uploaded files land in pub/media/custom_options/quote/. Whether that translates into remote code execution depends on your web server configuration: stock nginx 2.0.0–2.2.x, any nginx config that passes .php requests to FastCGI regardless of directory, and Apache before 2.3.5 without php_flag engine 0 set on the media directory are all directly exploitable. Even where RCE isn't possible, the same gap allows a stored XSS payload to be uploaded on older or custom web server setups.

    Affected Versions

    • Every production release of Magento Open Source and Adobe Commerce up to and including 2.4.8 has the unrestricted upload bug.
    • Magento 2.4.9, released 12 May 2026, shipped with the fix built in from the start.
    • Crucially, Adobe did not backport the fix to the still widely-used 2.4.7 and 2.4.8 lines when 2.4.9 went live. That only happened with today's isolated patch, APSB26-73, on 14 July 2026. That's a two-month window where the fix existed, but almost nobody running it.

    Recommended Actions

    1. Apply APSB26-73 today if you're on 2.4.8 or earlier and haven't already upgraded to 2.4.9.
    2. Check for existing compromise regardless of your patch status: this bug has had a long runway. Search your media directory for anything that doesn't belong:
      find pub/media/custom_options/ -type f ! -name '.htaccess'
      
      and check for a known secondary backdoor pattern:
      find /var/www -name 'accesson.php' -type f
      
      Sansec's write-up lists common filenames seen in the wild (index.php, json-shell.php, bypass.phtml, c.php, r.php, rce.php, static.php, test.php, and numeric-prefixed variants like 780index.php), along with outbound connections to lanhd6549tdhse[.]top, jslibrary[.]net and canevaslab[.]com. Any of those is a strong sign you've already been hit.
    3. Review your web server configuration regardless of patch status. Disabling PHP execution inside pub/media is good practice independent of this specific bug, and would have blocked the RCE path here even on an unpatched store.
    4. Disable guest checkout custom-option uploads temporarily if you can't patch today and need an immediate stopgap.

    Deploy's role in closing this gap

    This is exactly the kind of vulnerability that falls through the cracks of a "just upgrade to the latest version" mindset. The fix technically existed from May, but most merchants had no practical way to get it without a full 2.4.9 migration until today's backport. It's the reason we don't rely on release notes alone: our team cross-references every Sansec advisory against our own clients' exact patch levels the day it's published, not just the day Adobe headlines it.

    It's been a genuinely demanding year for anyone keeping Magento stores patched, and Deploy has stayed in the thick of it, working alongside other leading Magento agencies through 2026's unusually heavy run of critical advisories. That effort has been recognised more than once this year, both within the agency community and by Sansec directly, and it's the standard we hold ourselves to on every advisory, not just the ones that make headlines. If you want a second opinion on whether your store was exposed during the gap between May and today, get in touch; we can check for the indicators above as part of our standard patch review.

    Need Help with Your eCommerce Project?

    Get expert advice from our Magento specialists and marketing professionals.