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

在函数粒度上阻止跟踪型 JavaScript

Blocking Tracking JavaScript at the Function Granularity

Abdul Haddi Amjad, Shaoor Munir, Zubair Shafiq, Muhammad Ali Gulzar

AI总结:

提出 Not.js,在函数粒度上检测并移除跟踪型 JavaScript,通过分析动态执行上下文构建图表示并训练分类器,实现高精度和高召回率,同时生成替代脚本以保持功能。

摘要:

现代网站广泛依赖 JavaScript 来实现功能和跟踪。现有的隐私增强型内容拦截工具在应对混合脚本(同时实现功能和跟踪的脚本)时面临困难,因为拦截脚本会破坏功能,而不拦截则允许跟踪。我们提出了 Not.js,一种在函数级粒度上运行的细粒度 JavaScript 拦截工具。Not.js 的优势在于分析动态执行上下文,包括每个 JavaScript 函数的调用栈和调用上下文,然后编码该上下文以构建丰富的图表示。Not.js 在网页的图表示上训练一个监督式机器学习分类器,首先在 JavaScript 函数级别检测跟踪,然后自动生成保留功能同时移除跟踪的替代脚本。我们在前 10K 网站上的评估表明,Not.js 在检测跟踪型 JavaScript 函数方面实现了高精确率(94%)和召回率(98%),优于现有技术,并且对现成的 JavaScript 混淆具有鲁棒性。对跟踪函数的细粒度检测使 Not.js 能够自动生成替代脚本,移除跟踪型 JavaScript 函数而不会造成重大破坏。我们的部署显示,混合脚本存在于前 10K 网站的 62.3% 中,其中 70.6% 的混合脚本是第三方脚本,从事诸如 cookie 写入等跟踪活动。我们与过滤列表作者分享了 Not.js 在混合脚本中检测到的跟踪函数样本,这些脚本目前不在过滤列表中,作者确认这些脚本因可能的功能破坏而未被拦截,尽管已知它们实现跟踪。

英文摘要:

Modern websites extensively rely on JavaScript to implement both functionality and tracking. Existing privacy enhancing content blocking tools struggle against mixed scripts, which simultaneously implement both functionality and tracking, because blocking the script would break functionality and not blocking it would allow tracking. We propose Not.js, a fine grained JavaScript blocking tool that operates at the function level granularity. Not.js's strengths lie in analyzing the dynamic execution context, including the call stack and calling context of each JavaScript function, and then encoding this context to build a rich graph representation. Not.js trains a supervised machine learning classifier on a webpage's graph representation to first detect tracking at the JavaScript function level and then automatically generate surrogate scripts that preserve functionality while removing tracking. Our evaluation of Not.js on the top 10K websites demonstrates that it achieves high precision (94%) and recall (98%) in detecting tracking JavaScript functions, outperforming the state of the art while being robust against off the shelf JavaScript obfuscation. Fine grained detection of tracking functions allows Not.js to automatically generate surrogate scripts that remove tracking JavaScript functions without causing major breakage. Our deployment of Not.js shows that mixed scripts are present on 62.3% of the top 10K websites, with 70.6% of the mixed scripts being third party that engage in tracking activities such as cookie ghostwriting. We share a sample of the tracking functions detected by Not.js within mixed scripts not currently on filter lists with filter list authors, who confirm that these scripts are not blocked due to potential functionality breakage, despite being known to implement tracking.

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

↑