Unbundle-Rewrite-Rebundle: Runtime Detection and Rewriting of Privacy-Harming Code in JavaScript Bundles
Mir Masood Ali, Peter Snyder, Chris Kanich, Hamed Haddadi

TL;DR
This paper introduces URR, a runtime system that detects and rewrites privacy-harming JavaScript code within bundled scripts at runtime, enhancing privacy without breaking functionality.
Contribution
URR is a novel runtime approach that analyzes JavaScript ASTs to identify and replace privacy-harming code in bundled scripts, addressing a key privacy gap.
Findings
Precision of 1.00 in detecting harmful code
Recall of 0.95 for identifying privacy-harming libraries
Rewrites executed in 0.43 seconds per script
Abstract
This work presents Unbundle-Rewrite-Rebundle (URR), a system for detecting privacy-harming portions of bundled JavaScript code and rewriting that code at runtime to remove the privacy-harming behavior without breaking the surrounding code or overall application. URR is a novel solution to the problem of JavaScript bundles, where websites pre-compile multiple code units into a single file, making it impossible for content filters and ad-blockers to differentiate between desired and unwanted resources. Where traditional content filtering tools rely on URLs, URR analyzes the code at the AST level, and replaces harmful AST sub-trees with privacy-and-functionality maintaining alternatives. We present an open-sourced implementation of URR as a Firefox extension and evaluate it against JavaScript bundles generated by the most popular bundling system (Webpack) deployed on the Tranco 10k. We…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Malware Detection Techniques · Security and Verification in Computing · Web Application Security Vulnerabilities
