Categories: Cyber Security News

Hackers Use SVG onload Trick to Hide Magecart Skimmer on Magento Checkout Pages

Security researchers have uncovered a stealthy Magecart campaign abusing SVG image elements to hide credit card skimmers on Magento checkout pages, impacting nearly 100 online stores.

According to Sansec, attackers deployed a sophisticated skimmer designed to evade traditional security tools while silently harvesting payment data.

The campaign primarily targets Magento-based e-commerce platforms, with evidence suggesting exploitation of the long-standing PolyShell vulnerability as the initial access vector.

This vulnerability continues to affect unpatched Magento environments, allowing attackers to inject malicious code directly into store pages.

SVG Onload Injection Technique

Instead of relying on external JavaScript files, which are often detected by security scanners, the attackers embed their entire payload within a tiny, invisible SVG image.

The malicious code is base64-encoded and executed via the SVG’s onload event. Because the payload resides inline within HTML, it bypasses many detection mechanisms that look for suspicious third-party scripts.

For example, a 1×1 pixel SVG element is injected into the checkout page, triggering execution as soon as the page loads without raising visible indicators.

Once active, the skimmer waits for user interaction. It attaches a useCapture event listener to intercept clicks on checkout buttons before legitimate scripts can respond.

When a shopper attempts to proceed to checkout:

  • The malware blocks the original action.
  • A fake “Secure Checkout” overlay is displayed.
  • The overlay mimics legitimate payment forms, increasing the likelihood of user trust.
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,
);

This approach ensures victims unknowingly submit their payment details directly to the attacker-controlled script.

After capturing the data, the malware encrypts it using a simple XOR cipher with the key “script,” followed by base64 encoding. This dual-layer obfuscation helps evade detection during transmission.

The stolen data is then sent via POST requests to attacker-controlled domains, disguised as Facebook analytics traffic using endpoints like /fb_metrics.php. To further evade analysis, destination URLs are double-encoded.

Notably, all identified domains resolve to the IP address 23.137.249.67, hosted by IncogNet in the Netherlands.

To reduce suspicion, the skimmer sets a browser flag (_mgx_cv) in local storage after successful data theft, preventing repeated targeting of the same user.

Finally, victims are redirected back to the legitimate checkout page, making the attack virtually invisible from a user perspective.

Indicators of Compromise

Key indicators linked to this campaign include:

  • Inline SVG elements with onload JavaScript execution.
  • Base64-encoded payloads executed via atob() and setTimeout.
  • Data exfiltration to domains resolving to 23.137.249.67.
  • Network requests to /fb_metrics.php endpoints.
  • Presence of _mgx_cv in-browser local storage.

This campaign highlights how attackers continue to evolve Magecart techniques, leveraging lesser-monitored HTML features like SVG to bypass defenses and compromise online shoppers at scale.

Follow us on Google News , LinkedIn and X to Get More Instant UpdatesSet Cyberpress as a Preferred Source in Google

The post Hackers Use SVG onload Trick to Hide Magecart Skimmer on Magento Checkout Pages appeared first on Cyber Security News.

rssfeeds-admin

Recent Posts

Forza Horizon 6 Suffers Disastrous Leak as Steam Preload Files Are Made Available Without Encryption

Forza Horizon 6 suffered a significant leak after the entire game was reportedly made available…

29 minutes ago

Jodi’s Journal: The rest of the story behind Forward Sioux Falls

May 10, 2026 Imagine if the biggest, most influential businesses in this country came together…

1 hour ago

Crimson Desert Adds Surprise Claw Machine Mini-Game and Lets Pet Dogs Attack Enemies as Part of Update 1.06.00

Crimson Desert developer Pearl Abyss has released this week’s update as promised, and it adds…

1 hour ago

Nearly 50 Years Later, WKRP in Cincinnati Becomes a Real Radio Station

It took nearly 50 years. WKRP in Cincinnati is no longer just a TV sitcom.…

1 hour ago

Record turnout, beautiful weather highlight Friday’s Chamber Golf Tournament at Big Creek

The Mountain Home Area Chamber of Commerce hosted its 2026 Four-Person Scramble Golf Tournament Friday…

2 hours ago

Lead Hill man competes on Netflix reality show “Million Dollar Secret”

Growing up and spending all of his 44-years in Lead Hill and living on the…

2 hours ago

This website uses cookies.