Since Chromium 148, Math.tanh is now fingerprintable to link underlying OS
430 points
• 4 days ago
• Article
Link
指纹识别技术经常通过分析浏览器行为中的细微不一致来识别用户的操作系统。其中一个既精确又常被忽视的信号是某些数学函数的输出。由于 IEEE 754 浮点数存储标准并不强制对像 sin 、 cos 或 hyperbolic tangent 等超越函数做出相同的舍入,不同操作系统会产生略微不同的结果。这些差异通常只有最后一位的一个单位(ULP)左右,原因在于各个系统将这些运算交由各自不同的数学库处理,例如 Linux 上的 glibc 、 macOS 上的 libsystem_m 或 Windows 上的 UCRT 。
自 Chrome 148 起,V8 在处理 Math.tanh 时改为使用宿主的本地数学库,而不再使用捆绑的跨平台数学库。这一变化意味着浏览器仅凭计算像 tanh(0.8) 这种常见值就会泄露出其操作系统身份。该漏洞尤为突出,因为它会造成浏览器所报告的 User-Agent 与数学运算返回的实际位级结果不一致。此外,CSS 的三角函数和 Web Audio 组件也依赖于宿主特定的数学库,从而形成了多层次的指纹面,若要掩饰浏览器真实身份,开发者必须考虑这些层面。
要成功模拟特定操作系统,远不止简单伪装那么简单,错误的实现常会引入可被检测的模式或不一致。例如 Apple 在 macOS 生态中使用两套数学库:用于标量运算的常规库和用于向量运算的 Accelerate 框架。如果两者未能对齐,产生的误差往往比不做伪装更糟。再者,诸如 fused-multiply-add 之类的架构特定硬件特性也会导致运算漂移,因此必须在编译和执行层面精细控制,才能保证数学输出在不同服务器环境下的确定性。
为有效封堵这些泄露,开发者需要采取严格的方法,需对目标库进行逆向工程并实现逐位相同的兼容。这可能包括将 minimax 系数和内部约减常数转写为可移植代码,或在某些情况下直接在运行时环境中映射并执行目标操作系统的本地库。通过保持这种级别的精确性并针对真实设备作为判定基准进行严格验证,就有可能构建出在单个浮点位层面上也无法与真实用户流量区分的爬虫。
Fingerprinting techniques frequently rely on analyzing subtle inconsistencies in browser behavior to identify a user's operating system. One of the most precise yet overlooked signals is the mathematical output of specific functions. Because the IEEE 754 standard for floating-point storage does not mandate identical rounding for transcendental functions like sine, cosine, or hyperbolic tangent, different operating systems generate slightly different results. These differences, often measured in a single unit in the last place, stem from the fact that each OS routes these calculations through its own unique math library, such as glibc on Linux, libsystem_m on macOS, or UCRT on Windows.
Since Chrome 148, the V8 engine has changed how it handles the Math.tanh function, shifting from a bundled, platform-independent math library to the host's native library. This transition means that a browser now leaks its OS identity simply by computing a value as common as tanh(0.8). This vulnerability is particularly notable because it creates a discrepancy between the browser's stated User-Agent and the actual bits returned by its math operations. Furthermore, CSS trig functions and Web Audio components also rely on host-specific math libraries, creating a multi-layered fingerprinting surface that developers must account for if they wish to mask their browser's true identity.
Successfully mimicking a specific OS requires more than just simple spoofing, as incorrect implementations often introduce detectable patterns or inconsistencies. For example, Apple's ecosystem on macOS utilizes two different math libraries: a scalar library for standard operations and the Accelerate framework for vector-based tasks. Misaligning these libraries can lead to errors that are worse than not spoofing at all. Additionally, architecture-specific hardware features like fused-multiply-add instructions can introduce drifts in calculations, necessitating careful control over compilation and execution to ensure that the mathematical output remains deterministic across different server environments.
To effectively address these leaks, developers must adopt a rigorous approach that involves reverse-engineering the target's library and ensuring bit-for-bit parity. This can involve transcribing minimax coefficients and internal reduction constants into portable code or, in some cases, mapping and executing native libraries from the target OS directly within the runtime environment. By maintaining this level of precision and implementing strict validation against genuine device oracles, it becomes possible to create a scraper that remains indistinguishable from real user traffic, even at the level of a single floating-point bit.
220 comments • Comments Link
操作系统在计算 Math.tanh 等数学函数时的微小差异,会形成独特的可指纹特征,从而暴露底层平台,这常常与 User-Agent 头部信息不一致。
自动化抓取工具经常伪造 User-Agent 字符串以冒充合法的桌面系统,但这些"数学签名"能让安全服务发现所宣称的操作系统与实际数学实现之间的差异。
尽管指纹识别是机器人检测和防欺诈的常用手段,该领域正越来越被大规模、滥用性的数据抓取主导,进而损害网络基础设施和用户体验。
依赖在浏览器中注入随机化数学结果等简单缓解措施大多无效,因为更复杂的反机器人厂商会把这些改动视为确认机器人的辅助信号。
关于使用浮点数学还是定点算术的争论,凸显了便利性与确定性之间的张力。现代硬件与库倾向于浮点,但在需要极高精度或模拟一致性的场景下,定点仍然是关键选择。
指纹识别已如此普遍,以至于像 Mullvad 这样注重隐私的浏览器也基本放弃了完美掩盖操作系统的尝试,他们的结论是:独特的侧信道太多,难以取胜。
许多用户对"LLM-generated"技术内容的激增感到沮丧,这类内容常以措辞重复和过度修饰为特征,反而让人更希望看到由人编写的简短摘要。
讨论的一个重要部分集中在,是否应将指纹识别在法律上视为类似非法窃听的行为——因为它常被用于在未经同意的情况下跨互联网追踪个人。
在"识别客户"与"秘密追踪"之间的紧张关系,揭示了人们对隐私价值评估的分歧。监管支持者认为,虽然个别商店可能在本地观察顾客,但现代数字指纹识别如同一个隐形的、跨站的 AirTag,在全球范围内追踪用户。
浏览器和核心引擎的贡献者常出于善意推出新 API 或为提升性能而做出改动,却无意中创造了新的指纹向量,随即被安全公司和数据抓取者利用。
这场讨论反映了人们对自动化抓取工具无节制采集互联网数据以及与之相关的指纹识别军备竞赛的深切不安。各方一致认为大规模、未经同意的数据提取有害,但在指纹识别本身的道德性上存在分歧:有人把它视为安全所必须的权宜之计,另一些人则认为它根本侵犯了用户自主权。辩论的核心是一种无奈感:随着浏览器越发复杂,可被识别的攻击面也在扩大,在没有立法干预的情况下,实现真正私密、匿名的网络显得愈发难以企及。 • Subtle differences in how operating systems calculate mathematical functions like `Math.tanh` create unique, fingerprintable signatures that reveal the underlying platform, often contradicting user-agent headers.
• Automated scraping tools frequently spoof user-agent strings to mimic legitimate desktop operating systems, but this "math signature" allows security services to detect the discrepancy between the claimed OS and the actual math implementation.
• While fingerprinting is a standard tool for bot detection and fraud prevention, the industry is increasingly dominated by large-scale, abusive data extraction that degrades network infrastructure and user experience.
• Relying on simple browser-based mitigations like injecting randomized math results is largely ineffective, as sophisticated anti-bot vendors treat these modifications as secondary signals to confirm the presence of a bot.
• The debate over whether to use floating-point math versus fixed-point arithmetic highlights a tension between convenience and determinism. While modern hardware and libraries favor floating-point, fixed-point remains a critical choice for scenarios requiring extreme precision or simulation consistency.
• Fingerprinting has become so pervasive that even privacy-focused browsers like Mullvad have largely abandoned the attempt to perfectly mask the operating system, concluding that the number of unique side-channels makes the fight impossible to win.
• Many users express frustration with the rise of "LLM-generated" technical content, which is often characterized by repetitive phrasing and excessive fluff, leading some to desire shorter, human-written summaries instead.
• A significant portion of the discourse centers on whether fingerprinting should be legally categorized similarly to illegal wiretapping, given its use in tracking individuals across the internet without consent.
• The tension between "recognizing a customer" and "surreptitious tracking" reveals a divide in how privacy is valued. Proponents of regulation argue that while individual stores might observe patrons, modern digital fingerprinting acts like an invisible, cross-site airtag that follows users globally.
• Browsers and core engine contributors often introduce new APIs or changes in good faith to improve performance, inadvertently creating new fingerprinting vectors that are then exploited by both security firms and data scrapers.
The discussion reflects a deep anxiety regarding the "strip-mining" of the internet by automated scrapers and the corresponding arms race in fingerprinting technology. While there is a consensus that large-scale, non-consensual data extraction is harmful, participants remain divided on the morality of fingerprinting itself, with some viewing it as a necessary evil for security and others seeing it as an fundamental violation of user autonomy. Underlying the debate is a sense of resignation; as browsers become more complex, the surface area for identification grows, making the goal of a truly private, anonymous web feel increasingly unattainable without legislative intervention.