Lune

CCS2024Top-tier venue

Unbundle-Rewrite-Rebundle: Runtime Detection and Rewriting of Privacy-Harming Code in JavaScript Bundles

Mir Masood Ali, Peter Snyder, Chris Kanich, Hamed Haddadi

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-andfunctionality 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-andgrowing blind spot unaddressed by current privacy tools.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Fingerprinting the Fingerprinters: Learning to Detect Browser Fingerprinting Behaviors cites AdGraph: A Graph-Based Approach to Ad and Tracker Blocking
  • User Tracking in the Post-cookie Era: How Websites Bypass GDPR Consent to Track Users cites Tranco: A Research-Oriented Top Sites Ranking Hardened Against Manipulation
  • Insecure Ingredients? Exploring Dependency Update Patterns of Bundled JavaScript Packages on the Web cites Tranco: A Research-Oriented Top Sites Ranking Hardened Against Manipulation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. Debun: Detecting Bundled JavaScript Libraries on Web using Property-Order GraphsSeojin Kim, Sungmin Park, Jihyeok ParkASE 2025
  2. Insecure Ingredients? Exploring Dependency Update Patterns of Bundled JavaScript Packages on the WebBen Swierzy, Marc Ohm, Michael MeierICSE 2026

Builds on12

  1. Tranco: A Research-Oriented Top Sites Ranking Hardened Against ManipulationVictor Le Pochat, Tom van Goethem, Samaneh Tajalizadehkhoob, Maciej Korczynski et al.NDSS 2019 · 826 citations
  2. Fingerprinting the Fingerprinters: Learning to Detect Browser Fingerprinting BehaviorsUmar Iqbal, Steven Englehardt, Zubair ShafiqS&P 2021 · 143 citations
  3. AdGraph: A Graph-Based Approach to Ad and Tracker BlockingUmar Iqbal, Peter Snyder, Shitong Zhu, Benjamin Livshits et al.S&P 2020 · 112 citations
  4. User Tracking in the Post-cookie Era: How Websites Bypass GDPR Consent to Track UsersEmmanouil Papadogiannakis, Panagiotis Papadopoulos, Nicolas Kourtellis, Evangelos P. MarkatosWWW 2021 · 99 citations
  5. HideNoSeek: Camouflaging Malicious JavaScript in Benign ASTsAurore Fass, Michael Backes, Ben StockCCS 2019 · 78 citations

Related papers

  1. Detecting Filter List Evasion with Event-Loop-Turn Granularity JavaScript SignaturesQuan Chen, Peter Snyder, Ben Livshits, Alexandros KapravelosS&P 2021 · 33 citations
  2. SugarCoat: Programmatically Generating Privacy-Preserving, Web-Compatible Resource Replacements for Content BlockingMichael Smith, Peter Snyder, Benjamin Livshits, Deian StefanCCS 2021 · 16 citations
  3. ASTrack: Automatic Detection and Removal of Web Tracking Code with Minimal Functionality LossIsmael Castell-Uroz, Kensuke Fukuda, Pere Barlet-RosINFOCOM 2023 · 8 citations
  4. PTDETECTOR: An Automated JavaScript Front-end Library DetectorXinyue Liu, Lukasz ZiarekASE 2023 · 2 citations
  5. Blocking Tracking JavaScript at the Function GranularityAbdul Haddi Amjad, Shaoor Munir, Zubair Shafiq, Muhammad Ali GulzarCCS 2024 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines