[论文解读] Improving Web Content Blocking With Event-Loop-Turn Granularity JavaScript Signatures
本文提出了一种新型系统,通过生成细粒度的、基于事件循环轮次的 JavaScript 行为签名,检测危害隐私与安全的代码,克服了基于 URL 的内容屏蔽工具的局限性。通过在 Blink 和 V8 运行时进行插桩,该系统识别出 3,589 个此前未被发现的脚本,这些脚本托管了已知的恶意代码——影响了 12.48% 的网站——尽管现有过滤列表因规避技术(如 URL 变更和代码打包)而未能检测到它们。
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.
研究动机与目标
- 解决当前基于 URL 或域名的内容屏蔽工具的根本缺陷,这些工具在恶意代码通过混淆、打包或内联脚本传递时无法检测。
- 衡量网页内容屏蔽中规避行为的真实规模,特别是像 EasyList 和 EasyPrivacy 这类流行过滤列表遗漏了多少有害脚本。
- 开发一种基于行为的检测机制,能够抵御代码混淆、URL 变更和代码打包等常见规避技术。
- 通过生成新的过滤列表规则并提出基于签名的系统,为未来的内容屏蔽工具提供实用防御方案。
- 建立一种基于运行时行为而非分发机制的、与 Web 兼容且尊重隐私的内容屏蔽基础。
提出的方法
- 在 Chromium 中对 Blink 渲染引擎和 V8 JavaScript 引擎进行插桩,实现对 JavaScript 执行的深度、非侵入式运行时监控。
- 在单个 JavaScript 事件循环轮次的粒度上提取行为签名,捕捉与 DOM、API(例如 Date、cookies、存储)以及网络请求的交互。
- 从每个事件循环轮次中观察到的行为序列构建基于图的签名,使用最小图大小以确保唯一性并减少误报。
- 使用来自 EasyList 和 EasyPrivacy 的已知恶意脚本作为真实标签,训练并验证签名生成过程。
- 将生成的签名应用于 Alexa 100K 网站,检测具有相同有害行为但不同 URL 的先前未被发现的脚本。
- 提出并实现新的过滤列表规则以及基于签名的检测系统,以防御规避技术。
实验结果
研究问题
- RQ1当前基于 URL 的内容屏蔽工具在多大程度上被通过更改 URL、打包代码或内联脚本传递的恶意脚本所绕过?
- RQ2事件循环轮次级别的行为分析在识别多样化网页应用中的隐私与安全危害性 JavaScript 行为方面有多有效?
- RQ3跟踪器最常使用的规避现有内容屏蔽工具的技术有哪些,以及这些技术发生的频率如何?
- RQ4在事件循环轮次级别生成的行为签名能否检测到传统过滤列表遗漏的已知有害脚本?
- RQ5能否利用这些签名构建实用的防御措施,以在不破坏网站功能的前提下提升网络隐私与安全?
主要发现
- 该系统从 EasyList 和 EasyPrivacy 阻止的 11,212 个脚本中生成了 1,995,444 个唯一签名,捕获了与隐私和安全相关的各种行为。
- 共检测到 3,589 个托管已知恶意代码的独立脚本,这些脚本未被现有过滤列表发现,影响了 Alexa 100K 中 12.48% 的网站。
- 最普遍的规避技术包括 URL 变更(如一次性 URL)、将恶意代码与良性功能打包,以及直接在 HTML 中内联脚本。
- 尽管事件循环轮次签名的粒度很高,但由于良性与恶意脚本之间存在行为重叠,仍可能存在误报,但该系统通过设置最小图大小阈值有效缓解了这一问题。
- 本研究揭示,由于当前内容屏蔽工具依赖于分发机制进行检测,导致大量有害脚本被遗漏,凸显了基于行为的替代方案的必要性。
- 作者发布了 586 条兼容 AdBlock Plus 的过滤列表规则,用于屏蔽现在托管在新 URL 上的已知有害脚本,证明了研究发现的实际适用性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。