Hackers Exploit Trusted Google Domains to Inject Malicious Scripts

In a sophisticated cyberattack, hackers are exploiting trusted Google domains to inject malicious scripts into legitimate e-commerce websites, turning them into phishing platforms without the knowledge of site owners or advertisers. This method leverages integrations with Google APIs, specifically through JSONP (JSON with Padding) calls, to execute harmful JavaScript code.

Understanding the Attack Mechanism

The attack begins when cybercriminals exploit JSONP endpoints within trusted Google domains. JSONP is a technique designed to bypass the same-origin policy in web browsers, allowing data to be requested from a different domain. By appending a callback parameter to an API request, attackers can manipulate the server’s response to include malicious JavaScript code. For example, a server might respond with:

“`javascript
malicious_function({result: data});
“`

This code is then executed in the context of the victim’s browser, enabling the attacker to perform unauthorized actions.

Impact on E-Commerce Platforms

Once the malicious script is injected, it silently redirects users to fraudulent payment pages that closely mimic legitimate ones. Unsuspecting shoppers, believing they are completing a transaction with a trusted merchant, inadvertently disclose their credit card details to the attackers. This method is particularly insidious because it operates beneath the surface of legitimate advertisements and storefronts, making detection challenging.

A notable instance of this attack targeted Ray-Ban’s Indian store (india.ray-ban.com). Attackers compromised the site’s backend, transforming it into an unwitting phishing platform. This exploitation not only jeopardizes customer data but also damages the brand’s reputation and undermines consumer trust.

Technical Exploitation Details

The attackers’ strategy involves abusing JSONP endpoints in trusted Google domains to deliver malicious JavaScript payloads. By leveraging the trust associated with Google’s domains, these scripts can bypass Content Security Policy (CSP) protections, as many websites explicitly allow content from Google. This exploitation chain has been observed in numerous compromised e-commerce sites, particularly those using Adobe Commerce and Magento platforms.

Network traffic analysis reveals multiple abused requests to Google domains, all containing similar obfuscated JavaScript payloads. These scripts ultimately redirect users to fake payment pages hosted on domains like montina[.]it and premium[.]vn. The sophistication of this attack lies in its ability to bypass security measures while maintaining a facade of legitimacy, rendering traditional detection methods ineffective.

Broader Implications and Related Exploits

This method of exploiting trusted domains is not isolated to Google. Cybercriminals have also targeted other platforms to execute similar attacks. For instance, in 2025, attackers exploited vulnerabilities in Google’s OAuth system to send phishing emails that appeared legitimate by passing DKIM (DomainKeys Identified Mail) verification. These emails directed victims to convincing fake support portals hosted on Google-owned domains to steal credentials. ([vpnmentor.com](https://www.vpnmentor.com/news/hackers-exploit-google-oauth-for-dkim-verified-phishing-emails/?utm_source=openai))

Additionally, a vulnerability in Google’s OAuth implementation allowed attackers to take over accounts of former employees of failed startups by purchasing their domains. By recreating old employee email accounts, attackers could access various SaaS products the startup used, exposing sensitive data. ([securityweek.com](https://www.securityweek.com/google-oauth-flaw-leads-to-account-takeover-when-domain-ownership-changes/?utm_source=openai))

Recommendations for Mitigation

To protect against such sophisticated attacks, organizations should consider the following measures:

1. Implement Strict Content Security Policies (CSP): Define and enforce CSPs that restrict the sources from which scripts can be loaded, minimizing the risk of malicious script execution.

2. Regular Security Audits: Conduct thorough and regular audits of website code and third-party integrations to identify and remediate vulnerabilities promptly.

3. Monitor Network Traffic: Utilize network monitoring tools to detect unusual patterns or unauthorized data exfiltration, which may indicate a compromise.

4. Educate Users: Train employees and users to recognize phishing attempts and the importance of verifying the authenticity of payment pages and security alerts.

5. Update and Patch Systems: Ensure that all software, including third-party plugins and APIs, are up-to-date with the latest security patches to mitigate known vulnerabilities.

Conclusion

The exploitation of trusted domains by cybercriminals underscores the evolving nature of cyber threats. By leveraging the credibility of established platforms like Google, attackers can execute sophisticated attacks that are challenging to detect and mitigate. Organizations must adopt a proactive and comprehensive approach to cybersecurity, combining technical defenses with user education to safeguard against these emerging threats.