Hiding malicious JavaScript inside a fake <!-- Google Tag Manager --> block is an old trick. For years, Magecart operators and data skimmers have used excessive whitespace and spoofed GTM tags to evade quick visual inspections by webmasters.
But a newly discovered breed of website malware is taking evasion to an entirely different level. The real story isn't the fake GTM wrapper - it’s the backend infrastructure. Attackers are weaponising decentralised technology to create "takedown-proof" Command and Control (C2) networks, an evolution security researchers are calling EtherHiding.
Traditional malware relies on a centralised server to deliver its final payload. When a website is infected, the injected script pings (https://bad-hacker-domain.com/malware.js) to execute the attack.
For defenders, this is a solvable problem. Once security researchers identify the malicious domain, they report it to the hosting provider or registrar. The domain is seized, the server goes offline, and the malware on every infected website is instantly neutralised.
To solve this vulnerability, attackers have turned to the blockchain.
Instead of pointing the infected website to a traditional server that can be shut down, this new malware communicates with a decentralised smart contract. Here is how the execution flow works:
Because the blockchain is decentralised and immutable, no government, hosting provider, or security vendor can take the smart contract offline.
Security researchers quickly adapted to early versions of EtherHiding by scanning the blockchain for plain-text malicious URLs. If a smart contract was broadcasting bad-domain.com, defenders could preemptively block it.
To counter this, the latest iterations of the malware no longer store plain-text URLs on the blockchain. Instead, the smart contract returns a heavily encrypted string.
The fake GTM script contains a hardcoded decryption password. Using the browser's native Web Crypto API, the script decrypts the payload URL directly inside the victim's browser after retrieving it from the blockchain. Only then does it inject the final <script> tag to launch the data skimmer.
This architecture provides attackers with terrifying operational agility and offers a great form of redundancy.
If the cybersecurity community manages to shut down the server hosting the final payload, the attacker doesn't need to re-hack the thousands of victim websites to update their malware. They simply send a single transaction to their smart contract, updating the encrypted string to point to a brand new domain.
Every infected website instantly reads the new blockchain data, decrypts the new URL, and resumes the attack.
For Magecart operators and e-commerce data skimmers, EtherHiding represents a dangerous paradigm shift.
Historically, wide-scale skimming campaigns were a race against the clock: attackers would infect as many checkout pages as possible and harvest credit cards until a cybersecurity vendor noticed and nuked the C2 domain. With Web3 loaders, that countdown is paused indefinitely.
Ultimately, Web3 loaders transform e-commerce skimming from a temporary "smash-and-grab" into a permanent, entrenched operation.
The Payment Card Industry (PCI) is not ignoring this evolution in client-side attacks. To combat the rise of Magecart, Web3 loaders, and e-skimming, the PCI Security Standards Council introduced stringent new rules in PCI DSS version 4.0.
Specifically, Requirement 6.4.3 forces organisations to exert strict control over every script running on their payment pages. To comply, businesses must now implement three core controls:
For attackers using Web3 loaders hidden in fake GTM containers, Requirement 6.4.3 acts as a direct roadblock. If an e-commerce website strictly enforces script authorisation and integrity checks, the consumer's browser will outright reject and block the rogue Web3 script before it can query the blockchain or inject its skimming payload - effectively neutralising the threat even if the attacker successfully breaches the web server.
The Web3 evolution of Magecart means defenders can no longer rely on visual inspections or simply blocking known bad IPs.
The transition to PCI DSS v4.0 and the enforcement of Requirement 6.4.3 has fundamentally changed how organisations must secure their online checkouts. Don't wait for a Web3 loader to test your defences. The experts at Foregenix specialise in securing e-commerce platforms against advanced Magecart attacks and guiding businesses through the complexities of PCI DSS compliance.
Contact our team today to schedule a security audit and ensure your payment pages are locked down.