56.7%
Stores Attacked
50+
Scanning IPs
0
Production Patches
All
Versions Affected
The Story
Dutch e-commerce security firm Sansec disclosed PolyShell last week, naming it for the polyglot technique at its core: attackers upload a file that is simultaneously a valid image and executable code. The vulnerability sits in Magento's REST API, which accepts file uploads as part of cart item custom options. 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. The file gets written to pub/media/custom_options/quote/ on the server with insufficient validation.
The impact depends on the web server configuration. On stock nginx configurations for Magento 2.0 through 2.2, or any server passing all .php requests to FastCGI, the uploaded polyglot can execute as PHP, giving the attacker remote code execution. On Apache configurations without the proper php_flag engine 0 directive, the same applies. On stores where PHP execution is blocked in that directory, attackers can still achieve stored cross-site scripting for account takeover. Either path leads to full store compromise.
Adobe addressed the flaw in the 2.4.9 pre-release branch (APSB25-94) on March 10. But the fix has not reached any production version. Every stable Magento Open Source and Adobe Commerce installation through 2.4.8 remains vulnerable. Adobe has not responded to press inquiries about a production patch timeline. BleepingComputer and Sansec both reported they received no response from Adobe.
Mass exploitation kicked off on March 19, with automated scanning accelerating rapidly. Sansec tracked 50+ unique IP addresses participating in the scanning activity and confirmed PolyShell attacks against 56.7% of all vulnerable stores. The first probing was detected on March 16 at 12:00 UTC.
The most advanced attack observed so far targeted a car manufacturer with over $100 billion in revenue. The attacker deployed a novel payment card skimmer that uses WebRTC data channels instead of traditional HTTP requests to load its payload and exfiltrate stolen card data. The skimmer establishes a WebRTC peer connection to a hardcoded C2 IP address (202.181.177[.]177) over UDP port 3479, receives JavaScript code via the data channel, and injects it into the checkout page to harvest payment information.
Why WebRTC matters: Content Security Policy is the primary defense most e-commerce sites use to block unauthorized script execution and data exfiltration. CSP directives like connect-src control fetch, XMLHttpRequest, and WebSocket connections. But CSP does not control RTCPeerConnection. This is a known gap in the CSP specification. Chrome has shipped experimental support for a webrtc CSP directive, but it is not standardized and virtually no site deploys it. For the vast majority of real-world stores, this bypass works. A store with a strict CSP that blocks all unauthorized HTTP connections is still wide open to WebRTC-based exfiltration.
The Adversary Perspective
From a red team lens, this attack chain is elegant in its simplicity and its evasion design.
The initial access vector requires zero authentication. No stolen credentials. No admin panel access. No social engineering. An attacker sends a crafted REST API request with a polyglot file embedded in the cart item options, and the server writes it to a predictable directory. The entire initial compromise can be automated with a single HTTP request per target store.
The WebRTC exfiltration channel is a genuine innovation in the Magecart playbook. For years, payment skimmers have used HTTP requests, image beacons, or WebSocket connections to exfiltrate stolen card data. All of these are subject to CSP enforcement. WebRTC peer connections are not. The attacker found a protocol-level gap in the browser's security model and built a skimmer around it. This is not a CSP misconfiguration. This is a specification gap that affects every site relying on CSP as a defense against Magecart attacks.
The absence of a production patch creates an indefinite exposure window. The fix exists only in a beta branch. Organizations running Magento in production cannot deploy a beta as a security fix. Until Adobe releases a stable patch, every store is either mitigated at the web server level (blocking the upload directory) or vulnerable. Given that Sansec found 56.7% of vulnerable stores already attacked, the attacker population clearly has the exploit and is scaling it.
Figure 01
- STEP 01 // CRITICAL
Unauthenticated File Upload
Attacker sends crafted REST API request with polyglot file (valid image + executable code) in cart item custom options. File written to pub/media/custom_options/quote/ on server. No auth required. Single HTTP request. - STEP 02 // CRITICAL
Code Execution or XSS
Depending on server config: PHP execution = full RCE. Blocked PHP = stored XSS for admin account takeover. Either path gives attacker control of the store. Web shells, backdoors, and additional malware deployed. - STEP 03
Skimmer Injection
JavaScript skimmer injected into checkout pages. Self-executing script establishes WebRTC peer connection to C2 at 202.181.177[.]177 over UDP port 3479. Receives second-stage payload via WebRTC data channel. - STEP 04 // CRITICAL
WebRTC Data Exfiltration
Payment card data (numbers, CVV, expiry, billing info) captured from checkout forms and exfiltrated via DTLS-encrypted UDP through the WebRTC data channel. Bypasses all CSP directives including connect-src. No HTTP traffic to flag. - STEP 05
Persistence & Evasion
Backdoors planted for re-entry. Skimmer operates silently alongside normal store functionality. WebRTC exfiltration generates no HTTP-based alerts. Traditional security scanning and CSP monitoring see nothing anomalous. - STEP 06
Card Data Monetization
Harvested payment card data sold on dark web markets or used for fraudulent transactions. High-traffic stores yield thousands of cards per day. A single compromised $100B+ car maker's e-commerce site produces massive volumes.
Vulnerability & IOC Details
- Vulnerability: PolyShell (APSB25-94)
- Affected: All Magento Open Source and Adobe Commerce stable versions through 2.4.8
- Fixed In: 2.4.9-beta1 only (no production patch available)
- API Endpoint: REST API cart item custom options (type "file")
- Upload Path: pub/media/custom_options/quote/
- NOT Affected: GraphQL mutations (different code path)
- WebRTC C2 IP: 202.181.177[.]177
- WebRTC Port: UDP 3479
- Exfil Method: WebRTC RTCPeerConnection data channel (bypasses CSP)
- Mass Exploitation: Since March 19, 2026 (probing since March 16)
- Scanning IPs: 50+ unique addresses
- Store Hit Rate: 56.7% of all vulnerable stores (Sansec telemetry)
- Confirmed Victim: $100B+ car manufacturer e-commerce site
Defensive Takeaways
- 1
Block Access to pub/media/custom_options/ Immediately
This is the single most important mitigation. Verify that your web server blocks all access to
pub/media/custom_options/. For nginx, ensure alocationblock withdeny allexists and is not overridden by a\.php$regex match. For Apache, verify the.htaccessfile is present and effective. Note that blocking access does not prevent uploads. Attackers can still upload malicious files via the REST API. The access block prevents the uploaded file from being executed or served. A WAF with specific rules for PolyShell upload patterns provides additional protection. - 2
Scan Your Store for Web Shells and Backdoors Now
56.7% of vulnerable stores have already been attacked. If you run Magento or Adobe Commerce, scan for web shells, backdoors, and injected JavaScript in your store's file system. Check
pub/media/custom_options/quote/specifically for any files that should not be there. Look for recently modified files in checkout template directories. Use Sansec's eComscan or similar specialized e-commerce security scanners. General purpose malware scanners may miss Magecart-style JavaScript injection. - 3
Monitor for WebRTC Connections from Your Store's Checkout Pages
The WebRTC skimmer bypasses CSP entirely. Traditional network monitoring looking for HTTP exfiltration will not detect it. Monitor for outbound UDP traffic from web server infrastructure to unexpected external IPs, particularly on non-standard ports. The observed C2 uses UDP port 3479. WebRTC connections from a server-side rendered e-commerce checkout page are anomalous by definition. Any RTCPeerConnection originating from your store's payment pages should trigger an immediate investigation.
- 4
Do Not Wait for Adobe's Production Patch
Adobe has not provided a timeline for a production patch. The fix exists only in a beta branch that is not suitable for production deployment. Implement the web server mitigations described above, deploy a WAF with PolyShell-specific rules, and scan for existing compromise. Sansec has published a list of scanning IPs and is offering their Shield product with a free month using code POLYSHELL. If you cannot mitigate at the server level, consider taking the affected REST API endpoint offline until a patch is available.
- 5
Reassess Your CSP Strategy for WebRTC Gaps
If your e-commerce security strategy relies on Content Security Policy as a defense against Magecart skimmers, this attack demonstrates a fundamental gap. CSP does not control WebRTC peer connections. Chrome's experimental
webrtcCSP directive is not standardized and is not deployed by virtually any production site. Until this gap is closed in the CSP specification and adopted by browsers, WebRTC-based exfiltration will bypass CSP on every site. Supplement CSP with server-side integrity monitoring, real-time JavaScript behavior analysis, and network-level detection for unexpected WebRTC traffic.