Unbundle-Rewrite-Rebundle: Runtime Detection and Rewriting of Privacy-Harming Code in JavaScript Bundles
Open Access
- 2 December 2024
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 2192-2206
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 evaluate URR by precision (1.00), recall (0.95), and speed (0.43s per script) when detecting and rewriting three representative privacy-harming libraries often included in JavaScript bundles, and find URR to be an effective approach to a large-and-growing blind spot unaddressed by current privacy tools.Keywords
All Related Versions
Funding Information
- National Science Foundation (2247515)
This publication has 29 references indexed in Scilit:
- Statically Detecting JavaScript Obfuscation and Minification Techniques in the Wild2021
- A system for detecting third-party tracking through the combination of dynamic analysis and static analysis2021
- Detecting Filter List Evasion with Event-Loop-Turn Granularity JavaScript Signatures2021
- Fingerprinting the Fingerprinters: Learning to Detect Browser Fingerprinting Behaviors2021
- AdGraph: A Graph-Based Approach to Ad and Tracker Blocking2020
- HideNoSeek2019
- Most Websites Don't Need to Vibrate2017
- Block Me If You Can: A Large-Scale Study of Tracker-Blocking Tools2017
- Leveraging Machine Learning to Improve Unwanted Resource Filtering2014
- Understanding web browsing behaviors through Weibull analysis of dwell time2010