Skip to main content
QUICK REVIEW

[Paper Review] Improving Web Content Blocking With Event-Loop-Turn Granularity JavaScript Signatures

Quan Chen, Peter Snyder|arXiv (Cornell University)|May 25, 2020
Advanced Malware Detection TechniquesComputer Science22 references5 citations
TL;DR

This paper proposes a novel system that generates fine-grained, event-loop-turn-level signatures of JavaScript behavior to detect privacy- and security-harming code, overcoming limitations of URL-based content blockers. By instrumenting Blink and V8 runtimes, the system identifies 3,589 previously undetected scripts hosting known harmful code—impacting 12.48% of websites—despite existing filter lists missing them due to evasion techniques like URL changes and code bundling.

ABSTRACT

Content blocking is an important part of a performant, user-serving, privacy respecting web. Most content blockers build trust labels over URLs. While useful, this approach has well understood shortcomings. Attackers may avoid detection by changing URLs or domains, bundling unwanted code with benign code, or inlining code in pages. The common flaw in existing approaches is that they evaluate code based on its delivery mechanism, not its behavior. In this work we address this problem with a system for generating signatures of the privacy-and-security relevant behavior of executed JavaScript. Our system considers script behavior during each turn on the JavaScript event loop. Focusing on event loop turns allows us to build signatures that are robust against code obfuscation, code bundling, URL modification, and other common evasions, as well as handle unique aspects of web applications. This work makes the following contributions to improving content blocking: First, implement a novel system to build per-event-loop-turn signatures of JavaScript code by instrumenting the Blink and V8 runtimes. Second, we apply these signatures to measure filter list evasion, by using EasyList and EasyPrivacy as ground truth and finding other code that behaves identically. We build ~2m signatures of privacy-and-security behaviors from 11,212 unique scripts blocked by filter lists, and find 3,589 more unique scripts including the same harmful code, affecting 12.48% of websites measured. Third, we taxonomize common filter list evasion techniques. Finally, we present defenses; filter list additions where possible, and a proposed, signature based system in other cases. We share the implementation of our signature-generation system, the dataset from applying our system to the Alexa 100K, and 586 AdBlock Plus compatible filter list rules to block instances of currently blocked code being moved to new URLs.

Motivation & Objective

  • Address the fundamental flaw in current content blockers that rely on URL or domain-based blocking, which fails to detect malicious code when delivered via obfuscated, bundled, or inlined scripts.
  • Measure the true scale of evasion in web content blocking, particularly how many harmful scripts are missed by popular filter lists like EasyList and EasyPrivacy.
  • Develop a behavior-based detection mechanism that is robust against common evasion techniques such as code obfuscation, URL mutation, and code bundling.
  • Provide practical defenses by generating new filter list rules and proposing a signature-based system for future content blockers.
  • Establish a foundation for web-compatible, privacy-respecting content blocking that focuses on runtime behavior rather than delivery mechanism.

Proposed method

  • Instrument the Blink rendering engine and V8 JavaScript engine in Chromium to perform deep, out-of-band runtime instrumentation of JavaScript execution.
  • Extract behavioral signatures at the granularity of individual JavaScript event loop turns, capturing interactions with DOM, APIs (e.g., Date, cookies, storage), and network requests.
  • Build graph-based signatures from sequences of observed behaviors during each event loop turn, using a minimum graph size to ensure uniqueness and reduce false positives.
  • Use known-bad scripts from EasyList and EasyPrivacy as ground truth to train and validate the signature generation process.
  • Apply the generated signatures across the Alexa 100K to detect previously undetected scripts with identical harmful behavior but different URLs.
  • Propose and implement new filter list rules and a signature-based detection system to defend against evasion techniques.

Experimental results

Research questions

  • RQ1To what extent are current URL-based content blockers evaded by malicious scripts that change URLs, bundle code, or inline scripts?
  • RQ2How effective is event-loop-turn-level behavioral analysis in identifying privacy- and security-harming JavaScript behavior across diverse web applications?
  • RQ3What are the most common evasion techniques used by trackers to bypass existing content blockers, and how frequently do they occur?
  • RQ4Can behavior-based signatures generated at the event loop turn level detect known harmful scripts that are missed by traditional filter lists?
  • RQ5What practical defenses can be built using these signatures to improve web privacy and security without breaking site functionality?

Key findings

  • The system generated 1,995,444 unique signatures from 11,212 scripts blocked by EasyList and EasyPrivacy, capturing privacy- and security-relevant behaviors.
  • A total of 3,589 unique scripts hosting known harmful code were detected that were missed by existing filter lists, affecting 12.48% of the websites in the Alexa 100K.
  • The most prevalent evasion techniques include URL mutation (e.g., one-off URLs), code bundling with benign functionality, and inlining scripts directly in HTML.
  • Despite the high granularity of event loop turn signatures, false positives remain possible due to behavioral overlap between benign and malicious scripts, though the system mitigates this with minimum graph size thresholds.
  • The study revealed that current content blockers miss a significant portion of harmful scripts due to delivery mechanism-based detection, highlighting the need for behavior-based alternatives.
  • The authors released 586 AdBlock Plus-compatible filter list rules to block known harmful scripts now hosted on new URLs, demonstrating practical applicability of the findings.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.