CVE-2026-48356: Adobe Commerce & Magento Open Source Unrestricted Polyglot File Upload Remote Code Execution (CISA KEV / PolyShell)
Critical remote code execution vulnerability officially inscribed into the CISA Known Exploited Vulnerabilities (KEV) Catalog on October 27, 2026, with a mandatory federal remediation deadline of November 17, 2026. Designated CVE-2026-48356 and tracked by cybersecurity researchers under the campaign name 'PolyShell', the vulnerability resides in the media attachment handling of custom options within Adobe Commerce and Magento Open Source. Unauthenticated remote attackers exploiting exposed GraphQL or REST cart endpoints can upload polyglot image files that satisfy superficial header checks (GIF89a / JPEG SOI markers) while encapsulating active PHP payloads. Because uploaded media files are deposited in web-accessible storage directories without executable script restrictions, adversaries invoke the file directly to execute arbitrary code, plant stealthy payment card skimmers, and exfiltrate customer databases.
HERMES THREAT SCORE & E-COMMERCE PAYMENT PIPELINE COMPROMISE EVALUATION
Target:Adobe Commerce Custom Options Media Upload Controller & REST/GraphQL API 1. Vulnerability Overview & Root Cause Analysis
Section titled โ1. Vulnerability Overview & Root Cause AnalysisโIn Adobe Commerce and Magento Open Source, products can define custom customizable options, including file attachments (such as logos for branded merchandise). When a guest or authenticated user adds a product with a custom file option to their cart, the request is processed by the quote item attachment pipeline via GraphQL (addSimpleProductsToCart) or REST (POST /rest/V1/guest-carts/:cartId/items).
flowchart TD A["Attacker (Unauthenticated Guest Shopper)"] -->|"1. Initiates guest cart on /rest/V1/guest-carts"| B["Adobe Commerce Storefront"] B -->|"2. Sends multipart POST with polyglot GIF/PHP file"| C["Custom Option Upload Handler: FileProcessor.php"] C -->|"3. Verifies magic bytes: passes getimagesize() check"| D["Bypasses MIME validation: Content-Type: image/gif"] D -->|"4. Writes file to pub/media/custom_options/quote/..."| E["Web-Accessible Media Storage Directory"] A -->|"5. Directly requests https://target.com/media/custom_options/.../poly.php"| F["Web Server (Nginx / Apache PHP-FPM)"] F -->|"6. PHP-FPM executes embedded <?php ... ?> tags"| G["Arbitrary Code Execution as www-data"] G -->|"7. Injects Magecart skimmer into checkout JavaScript"| H["Credit Card & Customer PII Theft"]The Polyglot Validation Bypass Primitive
Section titled โThe Polyglot Validation Bypass PrimitiveโThe vulnerability stems from improper validation inside Magento\Catalog\Model\Product\Option\Type\File\Processor. The component relied exclusively on PHPโs getimagesize() and extension matching against an allowlist that failed to properly sanitize double extensions or enforce execution blocking in the destination directory:
/* Vulnerable file validation logic in FileProcessor.php */public function validateUploadedFile(array $fileInfo){ // Insufficient check: only inspects first 12 bytes for image headers $imageDimensions = @getimagesize($fileInfo['tmp_name']); if (!$imageDimensions && !in_array($fileInfo['type'], $this->allowedMimeTypes)) { throw new LocalizedException(__('Invalid image file uploaded.')); }
// Flawed filename sanitization preserves secondary extensions $fileName = $fileInfo['name']; // e.g., "avatar.php.gif" or "receipt.gif" $targetPath = $this->mediaDirectory->getAbsolutePath('custom_options/quote/') . $fileName;
// File moved to publicly accessible web root without stripping executable permissions $this->uploader->save($targetPath); return $targetPath;}By forging a polyglot file starting with GIF89a header bytes followed by compressed image metadata and embedded PHP tags (GIF89a<?php system($_GET['cmd']); ?>), an attacker simultaneously satisfies getimagesize() and deposits an executable script directly inside the document root (pub/media/).
2. Attack Vectors & Real-World Weaponization
Section titled โ2. Attack Vectors & Real-World WeaponizationโThreat actors executing the โPolyShellโ campaign deploy an automated 4-stage kill chain:
- Guest Cart Initialization: The attacker sends a request to
/rest/V1/guest-cartsto obtain a publiccartIdwithout requiring user registration. - Polyglot Attachment Upload: A multipart HTTP request uploads the polyglot file via the quote custom option endpoint. The response returns the relative storage path inside
pub/media/custom_options/quote/. - Webshell Invocation: The attacker accesses the file over HTTP. If the web server configuration lacks explicit directives forbidding PHP execution inside
/pub/media/, the PHP-FPM daemon processes the payload, providing an interactive command execution interface. - Magecart Deployment & Database Exfiltration: Using shell access, attackers modify CMS layout blocks and core checkout JavaScript (
core.bundle.js), inserting obfuscated event listeners that stream entered credit card numbers, CVVs, and billing addresses to offshore drop servers.
3. Forensic Triage & Detection Engineering
Section titled โ3. Forensic Triage & Detection EngineeringโSecurity Operations Centers (SOC) must inspect web server access logs for anomalous requests into pub/media/custom_options/ and scan media storage for PHP tags embedded within image files.
title: Adobe Commerce PolyShell File Upload Exploitation Attemptid: c7e19048-4835-4c92-a128-cve202648356status: criticaldescription: Detects HTTP requests uploading or executing polyglot PHP scripts inside Adobe Commerce / Magento custom options media directories indicative of CVE-2026-48356 exploitation.references: - https://helpx.adobe.com/security/products/magento/apsb26-73.html - https://www.cisa.gov/known-exploited-vulnerabilities-catalogauthor: Hermes Codex Cyber Defense Teamdate: 2026-11-02logsource: category: webserver product: adobe_commercedetection: selection_upload: cs-method: 'POST' cs-uri-stem|contains: - '/rest/V1/guest-carts/' - '/graphql' cs-uri-query|contains: - 'custom_options' selection_execution: cs-method: 'GET' cs-uri-stem|contains: - '/pub/media/custom_options/' - '/media/custom_options/' cs-uri-stem|endswith: - '.php' - '.phtml' - '.php5' - '.phar' condition: selection_upload or selection_executionfalsepositives: - Legitimate admin image downloads (differentiated by HTTP GET requesting non-executable extensions)level: criticaltags: - attack.initial_access - attack.t1190 - attack.persistence - attack.t1505.003// Detect unauthorized script execution within Adobe Commerce media storageW3CIISLog| where csUriStem has "/media/custom_options/" or csUriStem has "/pub/media/"| where csUriStem endswith ".php" or csUriStem endswith ".phtml" or csUriStem endswith ".phar"| extend ClientIP = cIP, ResponseCode = scStatus| summarize RequestCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by ClientIP, csUriStem, ResponseCode| project FirstSeen, LastSeen, ClientIP, csUriStem, ResponseCode, RequestCount| order by LastSeen desc# Hunt for webshells and embedded PHP tags inside Magento pub/media directoryGet-ChildItem -Path "C:\inetpub\wwwroot\pub\media\custom_options" -Recurse -File | ForEach-Object { $bytes = Get-Content $_.FullName -Encoding Byte -TotalCount 1024 -ErrorAction SilentlyContinue $text = [System.Text.Encoding]::ASCII.GetString($bytes) if ($text -match "<\?php" -or $text -match "eval\(" -or $text -match "system\(") { [PSCustomObject]@{ FileName = $_.FullName Size = $_.Length Modified = $_.LastWriteTime Snippet = $text.Substring(0, [Math]::Min(120, $text.Length)) } }} | Format-Table -AutoSize4. Remediation & Strategic Hardening
Section titled โ4. Remediation & Strategic Hardeningโ- Apply Vendor Patch (APSB26-73): Upgrade Adobe Commerce or Magento Open Source immediately to the designated security release:
- 2.4.9-p1 (for 2.4.9)
- 2.4.8-p6 (for 2.4.8)
- 2.4.7-p11 (for 2.4.7)
- 2.4.6-p16 (for 2.4.6)
- 2.4.5-p18 (for 2.4.5)
- 2.4.4-p19 (for 2.4.4)
- Harden Web Server Configuration: In Nginx, explicitly disable PHP execution within all media and upload directories:
location /pub/media/ {location ~ \.(php|phtml|phar)$ {deny all;}try_files $uri $uri/ /get.php$is_args$args;}
- Audit CMS Blocks and Pages: Review database tables (
cms_block,cms_page) for injected<script>tags pointing to unknown external domains or obfuscated JavaScript. - Rotate Database and API Credentials: If unauthorized files were detected in
pub/media/, rotate all database passwords, admin user credentials, and payment gateway integration tokens (app/etc/env.php).