Malware Included: Imported 3rd Party JavaScript as Attack Vectors
Michael Schrenk analyzes how top websites import third-party JavaScript, exposing web supply chains to remote script tampering, credential theft, and malware delivery.
Summary
Architecture and Background
Modern web applications heavily incorporate third-party JavaScript for analytics, tag management, advertising networks, and user tracking. These remote scripts execute within the origin context of the host application, inheriting unrestricted access to the Document Object Model (DOM), cookies, and sensitive user inputs.
Vulnerability Analysis
Schrenk conducted an empirical automated audit across the top 1,000 internet websites, examining how external dependencies are imported. The research revealed widespread lack of subresource integrity (SRI), uncontrolled script tag chaining, and excessive reliance on multi-tier content delivery networks (CDNs) that create brittle web supply chains.
Exploitation and Demonstrations
A single compromised CDN, hijacked domain, or rogue internal developer on a third-party service can weaponize benign scripts. Injected payloads execute invisible session hijacking, formjacking (Magecart attacks), keylogging, or distributed cryptomining directly inside visitors' authenticated sessions.
Remediation and Defensive Strategies
Organizations must enforce strict Content Security Policy (CSP) headers, implement Subresource Integrity (SRI) hashes on all external assets, and audit script dependencies continuously. Self-hosting critical client-side libraries and deploying sandboxed iframe architectures mitigates exposure to upstream vendor compromise.
Related talks
Main Stage·22 min
Kenneth Lee
Kenneth Lee details how to use CSP to stop XSS KENNETH LEE PRODUCT SECURITY ENGINEER, ETSY INC.
Main Stage·38 min
Maksim Shudrak
Provides an insider breakdown of detecting and neutralizing the historic XZ Utils backdoor (CVE-2024-3094) before widespread Linux distribution deployment.
Main Stage·42 min
Aviad Hahami
Reconstructs the multi-stage CI/CD supply chain compromise of the popular tj-actions GitHub Action, detailing secret exfiltration and attacker tradecraft.


