Magecart Hides Skimmer Inside Stripe's Own API—Bypasses CSP
New Magecart campaign stores payment card skimmer payloads in Stripe customer metadata, then exfiltrates stolen cards as fake customer records. CSP rules won't help.
Magecart operators have found a way to make security controls work against defenders: storing their credit card skimmer inside Stripe's API infrastructure and exfiltrating stolen payment data as fake Stripe customer records. Content Security Policy rules that allowlist api.stripe.com—which is basically every Stripe merchant—let the attack sail through.
Sansec researchers published their findings on June 4, 2026, after tracking the campaign since at least late December 2025.
How the Attack Works
The attack chain leverages two implicitly trusted domains: Google Tag Manager (GTM) and Stripe's API.
Stage 1 — Payload Delivery: A malicious GTM container is planted on victim sites as a custom tag. On checkout pages (URLs containing "checkout"), the container fetches a specific Stripe customer record from the attacker's Stripe account.
Stage 2 — Skimmer Execution:
The "customer" record contains JavaScript code stored in metadata fields. The loader extracts this code and executes it dynamically using new Function()—a classic eval() equivalent that bypasses static analysis.
Stage 3 — Data Capture: The skimmer targets Magento and Adobe Commerce checkout pages, harvesting:
- Credit card numbers, expiration dates, CVV codes
- Customer names and billing addresses
- Email addresses and phone numbers
Stage 4 — Exfiltration: Stolen payment data is XOR-obfuscated and stored locally. A separate routine runs after page load and every minute thereafter, creating fake Stripe customer objects that store the stolen data in metadata fields. The local files are then wiped.
Why CSP Won't Save You
Content Security Policy is supposed to prevent exactly this kind of attack—blocking script execution from untrusted sources. But the attackers chose their infrastructure deliberately:
api.stripe.comis allowlisted by every Stripe merchantgoogletagmanager.comis allowlisted by every site using GTM
Both payload delivery and data exfiltration happen through domains that CSP rules explicitly trust. Network filters flagging unknown skimmer domains miss this entirely.
Variant Using Google Firestore
Sansec identified a secondary variant using Google Firestore instead of Stripe. Payloads are retrieved from a Firestore document named _tracking/captcha_ within a project called braintree-payment-app—chosen to blend with legitimate payment traffic.
Same principle: trusted infrastructure, same CSP bypass.
Timeline and Scale
The Stripe customer record containing the skimmer was created December 24, 2025, suggesting the campaign has been operational for over five months. Sansec hasn't disclosed the number of affected merchants, but the sophistication suggests a well-resourced operation.
This represents an evolution in Magecart tactics. Earlier campaigns used obviously malicious domains that security tools could easily flag. By hiding inside legitimate infrastructure, attackers have raised the bar significantly.
Detection Guidance
Organizations should monitor for:
- Unusual GTM container tags — Audit all GTM containers for unexpected scripts or external fetches
- Anomalous Stripe API calls — Customer record queries from checkout pages that reference unfamiliar customer IDs
- Dynamic code execution — Detect
new Function()oreval()calls in checkout contexts - Unexpected customer creation — Stripe webhooks showing customer records created without corresponding orders
Broader Context
This attack exploits the fundamental trust model of modern web applications. CDNs, payment processors, analytics platforms—they're all trusted by design. When attackers compromise that trust, traditional defenses fail.
For readers managing ecommerce security, our guide on recognizing phishing and social engineering covers related attack vectors, while the malware fundamentals guide explains how these threats operate at a technical level.
Stripe has not publicly commented on whether they've taken action to detect or prevent misuse of their API for malware hosting.
Related Articles
WooCommerce Stores Under Attack via Funnel Builder Flaw
Attackers exploit unauthenticated vulnerability in Funnel Builder plugin to inject payment skimmers on 40,000+ WordPress stores. Patch to 3.15.0.3 immediately.
May 17, 2026Malicious NuGet Package Impersonated Stripe to Steal API Tokens
ReversingLabs caught StripeApi.Net typosquatting the official Stripe library. The package processed payments normally while exfiltrating API keys in the background.
Feb 28, 2026Hola Browser Supply Chain Breach Delivered Monero Miner to Users
Sophos discovered a cryptocurrency miner bundled with Hola Browser for Windows. The malware creates a Windows service, adds Defender exclusions, and mines when idle.
Jun 7, 2026Storm Infostealer Decrypts Stolen Credentials Server-Side to Evade Detection
New MaaS stealer ships encrypted browser data to attacker infrastructure for decryption, bypassing endpoint detection. Session hijacking with geo-matched proxies defeats MFA.
Jun 4, 2026