Website security company Sucuri said the code, while appearing to be a typical GTM and Google Analytics script used for website analytics and advertising purposes, contains an obfuscated backdoor capable of providing attackers with persistent access.
As of writing, as many as three sites have been found to be infected with the GTM identifier (GTM-MLHK2N68) in question, down from six reported by Sucuri. GTM identifier refers to a container that includes the various tracking codes (e.g., Google Analytics, Facebook Pixel) and rules to be triggered when certain conditions are met.
Further analysis has revealed that the malware is being loaded from the Magento database table "cms_block.content," with the GTM tag containing an encoded JavaScript payload that acts as a credit card skimmer.
"This script was designed to collect sensitive data entered by users during the checkout process and send it to a remote server controlled by the attackers," security researcher Puja Srivastava said.
Upon execution, the malware is designed to pilfer credit card information from the checkout pages and send it to an external server.
This is not the first time GTM has been abused for malicious purposes. In April 2018, Sucuri revealed that the tool was being leveraged for a malvertising campaign with an aim to generate revenue for the operators through pop-ups and redirects.
The development comes weeks after the company detailed another WordPress campaign that likely employed vulnerabilities in plugins or compromised admin accounts to install malware that redirected site visitors to malicious URLs.
Last week, the U.S. Department of Justice (DoJ) also announced charges against two Romanian nationals, Andrei Fagaras and Tamas Kolozsvari, over their alleged role in a payment card skimming operation.
They have been indicted on three counts of access device fraud for possessing skimmers at three different locations in the Eastern District of Louisiana.
If convicted, they face up to 15 years imprisonment, up to three years of supervised release, a fine of up to $250,000, and a mandatory special assessment fee of $100, as to each count.