arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.00596cs.CR
收藏

解锁-重写-重新捆绑:JavaScript捆绑包中隐私损害代码的检测和重写

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

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

摘要:

这项工作提出了一个系统,用于检测捆绑的JavaScript代码的隐私损害部分,并在运行时重写该代码,以删除隐私损害行为,而不破坏周围的代码或整个应用程序。URR是解决JavaScript捆绑包问题的一种新颖的解决方案,在这种捆绑包中,网站将多个代码单元预编译到单个文件中,使得内容过滤器和广告拦截器无法区分所需和不需要的资源。在传统内容过滤工具依赖于URL的地方,URR在AST级别分析代码,并使用隐私和功能维护替代方案替换有害的AST子树。我们提出了一个开源的实现URR的Firefox扩展和评估它对JavaScript捆绑生成的最流行的捆绑系统(Webpack)部署在Tranco 10 k。当检测和重写JavaScript包中经常包含的三个代表性的隐私损害库时,我们通过精度(1.00),召回率(0.95)和速度(每个脚本0.43秒)评估URR,并发现URR是一种有效的方法来解决当前隐私工具未解决的大而不断增长的盲点。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑