Hackers have recently exploited Google Tag Manager (GTM) to steal sensitive credit card information from eCommerce websites, with a particular focus on platforms like Magento. GTM is a free tool provided by Google that simplifies the process of managing and deploying marketing tags, allowing website owners to optimize campaigns and track site activity. While GTM itself is a legitimate tool, cybercriminals have found a way to embed malicious code in the tags to exploit its functionalities for malicious purposes. This sophisticated attack highlights the evolving tactics of cybercriminals, who are increasingly using legitimate tools to carry out cyberattacks.
The attack itself works by embedding malicious JavaScript code within GTM tags that appear legitimate at first glance. These scripts, often disguised as Google Analytics or Google Ads tracking codes, contain hidden Base64 encoded payloads designed to collect sensitive data entered during the checkout process. Once a user enters credit card details, the malware sends that information to a remote server controlled by the attackers. This attack, which operates under the guise of a harmless tracking script, is a stark example of how cybercriminals can manipulate well-established tools for nefarious purposes.
In addition to the GTM malware, a backdoor was discovered in the “./media/index.php” file of affected sites. This backdoor could potentially give attackers persistent access to the compromised site, enabling them to further infect it or steal additional data. The backdoor code is designed to allow attackers to execute arbitrary commands on the server, providing them with a means to maintain control over the infected site even after the initial malware has been removed. The discovery of this backdoor highlights the serious risks posed by multi-layered attacks where the initial compromise is just the beginning of the attacker’s persistence.
To protect against such attacks, website administrators are strongly advised to regularly audit GTM tags and scripts to ensure that only legitimate, authorized tags are in place. Administrators should also use website firewalls, malware detection systems, and other security tools to detect and block malicious activity. Additionally, it is crucial to keep all software up to date by ensuring that plugins, platforms, and security patches are regularly applied. By staying vigilant and implementing thorough security measures, administrators can minimize the risk of such attacks and better protect sensitive customer data from exploitation.