Description

Security researchers identified two critical cross-site scripting vulnerabilities in Meta’s Conversions API Gateway, a server-side analytics solution used across Meta-owned properties and millions of third-party websites delivering a shared JavaScript file, ‘capig-events.js’, executing automatically on domains like meta.com, facebook.com, and customer sites operating as trusted infrastructure and bypassing browser restrictions, any weakness within it is large-scale supply-chain risk. These flaws allowed arbitrary JavaScript execution without user interaction, creating conditions for mass account takeover and data compromise. The first vulnerability in ‘capig-events.js’ is due to improper validation of ‘postMessage’ origins. When a page has an opener window, the script listens for configuration messages and blindly trusts the ‘event.origin’ value, later reused to dynamically load an additional ‘script, iwl.js’, turning attacker-controlled data into a script loader. Content Security Policy and Cross-Origin-Opener-Policy expected to mitigate abuse, researchers identified bypasses. Relaxed CSP rules on logged-out Meta help pages allowed third-party analytics domains, while iframe hijacking and Android WebView behaviors enabled attackers to deliver malicious messages, and execute JavaScript within Meta’s trusted context. The second severe vulnerability exists in the gateway’s backend. When businesses configure ‘Intelligent Web Logging’ rules, backend Java code dynamically generates portions of ‘capig-events’.js by concatenating user-supplied values without sanitization. Attackers could inject crafted characters to escape string contexts, insert arbitrary JavaScript directly into the generated script. This stored XSS payload executes automatically for every user loading the script across Meta and third-party domains. As gateway is open source and widely deployed, exploitation silently impacts millions of users globally within hours, without phishing or interaction. Mitigation requires strict origin validation for messaging APIs, hardened CSP configurations, secure code-generation practices that avoid unsafe string concatenation. Organizations using the gateway should update immediately, audit custom deployments, validate all dynamic inputs, and treat shared analytics scripts with the same security rigor as core application code.