Trusted Brands, Hijacked Browsers: How Google APIs Are Powering a New Wave of Malvertising Attacks

Listen to this Post

Featured Image
Cybercriminals have discovered a new way to weaponize trusted online ecosystems, infiltrating legitimate e-commerce sites and turning them into phishing traps — all by exploiting Google’s own APIs. This alarming trend doesn’t rely on suspicious ad networks or shady redirects. Instead, it leans on the trust users place in Google domains, allowing attackers to remain invisible to traditional security systems.

These sophisticated campaigns use a decades-old web trick called JSONP (JSON with Padding), which has suddenly become a dangerous backdoor. By abusing this technique, hackers inject malicious JavaScript scripts into trusted websites, bypassing even strict Content Security Policies (CSPs). Affected e-commerce platforms, including the official Ray-Ban India store, have unknowingly hosted these invisible traps — luring customers to phishing pages disguised as payment portals.

Inside the Attack: Summary of the Original Investigation

A new breed of malvertising is shaking the cybersecurity landscape. This time, attackers are sidestepping conventional ad-based strategies and diving deeper into web infrastructure. Instead of relying on sketchy third-party ad servers, they’re leveraging legitimate Google APIs to deliver malware-laced JavaScript via a method known as JSONP. Originally developed to bypass cross-origin browser restrictions, JSONP allows websites to receive data from other domains by calling back a JavaScript function. While the technique itself is outdated, it’s still supported by many websites — and that’s precisely the problem.

Cybersecurity firm Source Defense has reported a string of cases where Google domains like translate.googleapis.com, accounts.google.com, and www.youtube.com were used as delivery mechanisms for malicious scripts. These scripts piggybacked on sites with misconfigured or overly permissive CSPs, which usually allow scripts from Google’s trusted domains. Since most e-commerce sites naturally whitelist Google APIs, attackers gained a silent but deadly entry point into the browser environment.

In one notable incident, the official Ray-Ban India website was compromised. Attackers injected hidden scripts that led customers to realistic-looking fake payment pages. Victims unknowingly entered their credit card information, handing it directly to the attackers. This exploit was active for several months, targeting other platforms as well, particularly Adobe Commerce and Magento sites.

Traffic analysis revealed that payloads were hosted through compromised Google API calls and redirected users to scam domains like montina[.]it and premium[.]vn. Security teams have found it challenging to detect these threats, given the high level of trust placed in Google’s infrastructure. The use of JSONP enables the attacker’s code to slip past even advanced browser protections. Despite being reported to Google in late 2024, these attacks lingered long after.

The scale and persistence of the campaign demonstrate the need to retire outdated web practices like JSONP and implement modern, secure alternatives. Until then, major platforms risk having their reputations and customers compromised — silently and systematically.

What Undercode Say:

This new malvertising trend is an evolution in both sophistication and stealth. Traditionally, malicious ads were easy to spot: they appeared in banner spaces, used unusual URLs, or were hosted on disreputable ad networks. But what we’re seeing now is an entirely different beast — a hybrid attack that weaponizes the user’s trust in brand-name domains and APIs.

Google’s infrastructure, which supports millions of applications and sites, has become an unintentional accomplice. The exploitation of JSONP endpoints shows how legacy technology, when left unchecked, can be a double-edged sword. Many developers continue to use JSONP without realizing its security implications. Even worse, Content Security Policies — the gold standard of browser defense — are powerless when the attack comes from whitelisted, “safe” sources like Google.

This new method of compromise is particularly troubling for e-commerce, where user trust and secure payment environments are critical. A brand like Ray-Ban can suffer significant damage when customers are scammed on what appears to be the official site. Worse still, consumers are unlikely to blame attackers they can’t see — instead, they lose confidence in the brand itself.

From a cybersecurity perspective, this attack raises serious questions about current best practices. Allowing scripts from trusted third-party domains has always been a gamble, but now it looks downright reckless. Web developers must begin phasing out JSONP in favor of secure, modern API patterns like CORS with proper authentication and server-side checks.

Moreover, this campaign underscores the need for constant code auditing and runtime script analysis, not just at the network level but within the page execution itself. It’s no longer enough to scan for anomalies at the ad-server level; the script pipeline from trusted domains must also be scrutinized.

Security teams must deploy real-time monitoring and detection tools that can identify unusual behavior, such as unexpected API calls or redirect chains, even when those originate from Google. Equally important is educating developers about the security trade-offs of using outdated techniques and empowering them to make informed, safer design choices.

The attackers behind this campaign have demonstrated a deep understanding of web security blind spots. They’ve shown that even the most respected web services can be turned into attack vectors. And unless the industry reacts quickly, we can expect to see similar tactics adopted on an even broader scale, not just in e-commerce, but across banking, healthcare, and government platforms.

Fact Checker Results ✅

✔ JSONP abuse via Google APIs has been confirmed by Source Defense
✔ The Ray-Ban India site compromise was real and involved fraudulent redirects
✔ CSP whitelisting of trusted domains played a critical role in bypassing protections

🛡️

Prediction 📡

Given the rising effectiveness and stealth of these attacks, similar JSONP-based exploits will likely surge across more industries, especially where Google APIs are deeply embedded. Expect financial institutions, online retail, and SaaS platforms to be next. Security vendors may soon prioritize deprecating JSONP entirely and release new tools focused on behavior-based detection, not just domain-based filtering.

References:

Reported By: cyberpress.org
Extra Source Hub:
https://www.instagram.com
Wikipedia
Undercode AI

Image Source:

Unsplash
Undercode AI DI v2

Join Our Cyber World:

💬 Whatsapp | 💬 Telegram