《Web 规范中缓解浏览器指纹》(W3C 工作组说明) 原文标题:
内容概要总结
W3C Privacy Working Group 于 2025-03-20 发布的 Group Note(与 TAG 协作),为 Web 规范作者提供缓解浏览器指纹的指导。文档定义指纹并区分类型(被动、主动、类 cookie),阐述隐私影响与威胁模型,提出评估严重程度的五个因素(熵、可检测性、持久性、可用性、范围),并给出 10 条最佳实践(避免扩大被动指纹面、收窄特性范围、标记指纹特性、规定排序、数据最小化、要求服务器选择加入、优雅降级、避免新本地状态、可同步清除、限制永久状态)。引用 RFC6973、RFC6454 及 Eckersley、Acar 等论文。
翻译内容
原文内容(English)
本版本已过时! 最新版本请参见 https://www.w3.org/TR/fingerprinting-guidance/。
摘要
浏览器设置与特征的暴露会带来浏览器指纹(browser fingerprinting)风险,从而危害用户隐私。本文档定义了不同类型的指纹,考虑了针对相关隐私风险的不同缓解层级,并为 Web 规范作者在设计新 Web 特性时如何平衡这些关切提供指导。
本文档状态
本节描述本文档在发布时的状态。当前 W3C 出版物列表以及本技术报告的最新修订版可在 https://www.w3.org/TR/ 的 W3C 技术报告索引中找到。
本文档为 Web 规范作者提供关于缓解浏览器指纹隐私影响的指导。
Privacy Working Group(隐私工作组)正就本指导与 Technical Architecture Group(TAG,技术架构组)合作。
本文档由 Privacy Working Group 以 Group Note(工作组说明)的形式、按 Note track(说明轨道)发布。
本 Group Note 得到 Privacy Working Group 的背书,但未得到 W3C 本身或其成员的背书。
本文档为草案,可能随时被其他文档更新、替换或废弃。将其作为已完成工作引用是不恰当的。
W3C Patent Policy(专利政策)不对本文档施加任何许可要求或承诺。
本文档受 2023 年 11 月 3 日版 W3C Process Document 约束。
目录
- 摘要
- 本文档状态
- 1. 浏览器指纹
- 1.1 什么是指纹?
- 1.2 隐私影响与威胁模型
- 1.2.1 识别用户
- 1.2.2 关联浏览活动
- 1.2.3 在缺乏透明度或用户控制的情况下追踪
- 1.3 我们能做些什么?
- 2. 最佳实践摘要
- 3. 指纹的类型
- 3.1 被动
- 3.2 主动
- 3.3 类 cookie
- 4. 可行性
- 4.1 指纹缓解的成功层级
- 4.2 规范作者的可行目标
- 5. 识别指纹面并评估严重程度
- 6. 缓解措施
- 6.1 权衡增加的指纹面
- 6.2 标准化
- 6.3 可检测性
- 6.4 清除所有本地状态
- 6.5 Do Not Track
- A. 研究
- A.1 浏览器厂商文档
- A.2 学术研究
- A.3 测试
- B. 致谢
- C. 参考文献
- C.1 资料性参考文献
1. 浏览器指纹
简而言之,浏览器指纹是指站点通过配置设置或其他可观测特征来识别或重新识别访问用户、用户代理或设备的能力。
[[RFC6973]] 给出了类似的定义。下文列出了更详细的指纹类型清单。本文档并不试图穷举当前用于或可用于浏览器指纹的所有特性;不过,A. Research 一节提供了浏览器厂商页面和学术研究成果的链接。
浏览器指纹可作为一种安全措施使用(例如作为认证用户的手段)。然而,指纹也是对 Web 用户隐私的潜在威胁。本文档并不试图给出关于“隐私”或“个人数据”的统一定义,而是强调浏览器指纹可能如何影响用户隐私。例如,浏览器指纹可用于:
- 识别用户
- 在会话内及跨会话关联用户的浏览活动
- 在缺乏透明度或用户控制的情况下追踪用户
下文讨论了每种用途相关的隐私影响。遵循安全威胁模型分析的实践,我们指出指纹存在不同的隐私威胁模型。针对这些威胁的防御措施各不相同,取决于具体的隐私影响和用户的威胁模型。
用户可能希望在网上保持匿名或不被识别,原因有很多,包括:对监控的担忧、人身安全,以及对因自己在使用 Web 时所读所写内容而遭受歧视的担忧。当浏览器指纹与可识别信息(如电子邮件地址、已识别的姓与名,或政府签发的标识符)关联时,应用程序或服务提供方就可能识别出原本匿名的用户。这种威胁的对手和后果因具体用户和用例而异,但可能包括国家级情报机构,以及暴力或监禁的威胁。
即便不涉及线下身份,浏览器指纹也会引发隐私担忧。一些用户可能会对某一在线方能关联多次访问(在同一站点或不同站点)从而构建出用户的画像或历史感到惊讶或担忧。这种担忧可能加剧,因为(见下文)它可能在用户不知情或未同意的情况下发生,而清除 cookie 等工具并不能阻止进一步的关联。
浏览器指纹还允许跨源(origin) [[RFC6454]] 追踪:即便 cookie 政策会阻止跨源访问 cookie,不同站点仍可能合并关于同一用户的信息,因为指纹相对唯一,且对所有源都相同。
与 Web 标准为维护状态所定义的其他机制(如 cookie)相比,浏览器指纹允许在缺乏明确迹象的情况下收集关于用户活动的数据。透明度对终端用户很重要,能帮助他们理解正在进行的收集如何发生;它也使研究者、政策制定者等能够记录或监管隐私敏感活动。浏览器指纹还允许在缺乏明确或有效用户控制的情况下追踪活动:浏览器指纹通常无法被清除或重置。(参见关于未经许可追踪的 finding [[TAG-UNSANCTIONED]]。)
浏览器指纹技术的进步(见下文 A. Research),特别是在主动指纹方面,表明:仅通过广泛部署的纯技术手段来彻底消除坚定对手实施浏览器指纹的能力,是不现实的。不过,如下所述,在我们的技术规范中实施缓解是可能的(见 6. Mitigations),并可能取得不同程度的成功(见 4. Feasibility)。
这里推荐的缓解措施仅仅是缓解,而非解决方案。Web 用户不能确信站点完全无法关联流量,尤其是在执行客户端代码时。指纹面(fingerprinting surface)横跨某一用户代理所实现的全部 Web 特性,甚至延伸到协议栈的其他层;例如 TCP 连接的差异。举例来说,用户可能使用 Tor 之类的洋葱路由系统来限制网络层的可关联性,但仍面临通过浏览器指纹关联基于 Web 活动的风险,反之亦然。为了整体缓解这些隐私风险,必须在所有规范的设计与开发过程中考虑指纹问题。
TAG 关于未经许可 Web 追踪(包括浏览器指纹)的 finding 描述了技术措施的局限性,并鼓励最小化并记录新的指纹面 [[TAG-UNSANCTIONED]]。下文的最佳实践详细说明了 Web 特性规范作者可采取的常见行动,以缓解浏览器指纹的隐私影响。Self-Review Questionnaire(自审问卷)更一般地记录了 Web 特性中隐私影响的缓解措施,可作为这些实践的补充 [[security-privacy-questionnaire]]。
- 最佳实践 1:避免不必要或严重地扩大指纹面,尤其是被动指纹。
- 最佳实践 2:将具有指纹面的特性的范围和可用性收窄到功能上必要的程度。
- 最佳实践 3:标记有助于可指纹化的特性。
- 最佳实践 4:规定排序和非功能性差异。
- 最佳实践 5:设计 API 时仅访问必要的熵。
- 最佳实践 6:要求服务器声明或选择加入以访问数据。
- 最佳实践 7:为注重隐私的用户或实现者启用优雅降级。
- 最佳实践 8:避免不必要的新本地状态机制。
- 最佳实践 9:突出显示任何本地状态机制,以便能够同时清除。
- 最佳实践 10:限制永久性或持久性状态。
被动指纹是基于 Web 请求内容中可观测的特征进行的浏览器指纹,不使用任何在客户端执行的代码。
被动指纹会自然而然地包括 cookie(HTTP 请求中经常发送的唯一标识符)、HTTP 请求头集合、IP 地址及其他网络层信息。例如,User-Agent 字符串 [[RFC9110]] 是一种 HTTP 请求头,通常标识浏览器、渲染器、版本和操作系统。对某些人群而言,User-Agent 和 IP 地址往往能唯一标识特定用户的浏览器 [[NDSS-FINGERPRINTING]]。
对于主动指纹,我们还考虑站点在本地客户端运行 JavaScript 或其他代码以观测浏览器、用户、设备或其他上下文的额外特征的技术。
主动指纹的技术可能包括:访问窗口尺寸、枚举字体或插件、评估性能特征、读取设备传感器、渲染图形图案。这一区分的要点在于,主动指纹的发生方式在客户端是潜在可被检测的。
用户、用户代理和设备也可能被站点重新识别:该站点先设置、之后再取回由用户代理或设备存储的状态。这种类 cookie 指纹允许以与 HTTP cookie 为无状态 HTTP 协议实现状态管理相同的方式,重新识别用户或对用户做出推断 [[RFC6265]]。
类 cookie 指纹还能绕过用户限制或清除用户代理所存 cookie 的尝试,正如“evercookie”实现所演示的那样 [[EVERCOOKIE]]。当状态跨用户代理(如具有本地存储的常见插件的情形)、跨设备(如某些浏览器同步机制的情形)或跨软件升级得以保持时,类 cookie 指纹可以在主动和被动指纹可能无法做到的情况下重新识别用户、用户代理或设备。Security and Privacy Self-Review Questionnaire 也在跨浏览会话持续存在的源状态中考虑了这种威胁 [[security-privacy-questionnaire]]。
缓解浏览器指纹有不同层级的成功:
- 减小指纹面:移除可用于指纹的熵来源或可用属性。
- 增大匿名集:通过标准化、约定或共同实现,提高特定配置的共性,以降低唯一可指纹化的可能性。
- 可检测的指纹:使指纹对他人可观测,从而用户代理可以阻止它,或研究者可以判定它正在发生。
- 可清除的本地状态:通过使状态机制可清除,帮助用户应对指纹。
研究表明,在以上所有方面都可实现对隐私保护的有效改进。虽然插件列表仍是很大的指纹面,但随着从插件迁移到 Web API,熵已随时间下降 [[HIDING-CROWD]]。关于 Web 用户所收集的数据显示,移动设备的匿名集显著大于桌面浏览器 [[HIDING-CROWD]]。对各类主动指纹的研究记录了其使用情况,并表明这些技术的使用变化,似乎是意识提高的结果 [[WPM-MILLION]]。cookie 的复活(respawning)持续存在,技术种类日益增多,但对此问题的意识和技术应对使这一做法不那么普遍 [[FLASHCOOKIES-2]]。
本文档的预期是:在不同情形、针对不同威胁模型和不同指纹类型,不同程度的成功缓解是可行的。总体而言,主动指纹可使其可被检测;我们可以最小化被动指纹面的增加;类 cookie 机制可使其可被清除。
一些实现者和一些用户可能愿意接受功能减少或性能下降,以最小化浏览器指纹。记录哪些特性有指纹风险,可以减轻为这些高风险用户构建模式的实现者的工作;即便在常见实现容易主动指纹化的情况下也最小化指纹,能让这类用户减少必要的功能取舍。使浏览器指纹更可检测也有助于标准化过程之外的缓解;例如通过监管或政策手段 [[TAG-UNSANCTIONED]]。
在你的规范中缓解浏览器指纹:
- 识别可用于浏览器指纹的特性;
- 基于这五个因素评估指纹面的严重程度;以及,
- 应用下文最佳实践中描述的缓解措施(见 6. Mitigations),重点是限制该指纹面的严重程度。
用户代理的指纹面,是指可协同用于识别用户、用户代理或设备,或关联其活动的可观测特征集合。
可能用于浏览器指纹的数据源包括:
- 用户配置
- 设备特征
- 环境特征(例如传感器读数)
- 操作系统特征
- 用户行为
- 浏览器特征
对某些特性,这些数据源可能被直接访问,但在许多其他情况下,它们是通过某种其他观测推断出来的。特别是时序通道(timing channel),常被用于推断硬件细节(不同操作完成得究竟有多快,可能提供关于 GPU 能力的信息)、网络信息(通过加载某一资源的延迟或速度),甚至用户配置(哪些项此前已被缓存,或哪些资源未被加载)。要考虑特性的副作用,以及这些副作用如何允许推断上述任何特征。
Tor Browser 设计文档 [[TOR-DESIGN]] 对这些来源及其相对优先级有更多细节;本文档增加了环境特征,因为传感器读数或数据访问可能通过关于环境的信息(例如位置)区分用户、用户代理或设备。
对每个已识别的特性,基于以下因素考虑上述隐私影响的严重程度(见 1.2 Privacy impacts and threat models):
- 熵(entropy):这个新表面有多大的区分度?要同时考虑可能的变化和值的可能分布。增加 1 比特的熵通常不太令人担忧;30 多比特的熵就足以唯一识别每一个人。不同的数据源可能提供不同的变化分布;例如,某些特征可能揭示共同的硬件类别,而其他特征可能揭示因人而异的用户配置。
- 可检测性(detectability):将此特性用于浏览器指纹,对用户代理是否可观测,或是否可能被研究者发现?由于可检测性是一项重要——也许是最可行——的缓解措施,被动指纹面的增加尤其令人担忧,应当避免。
- 持久性(persistence):这个指纹面的特征会保持多久不变?用户能否控制或重置这些值,以防止长期识别?虽然短寿命特征仍可能促成意料之外的活动关联(例如同一设备上两个浏览器配置文件之间的关联),但持久或永久的标识符尤其令人担忧,因为用户缺乏控制。
- 可用性(availability):这个表面是“随手访问型 Web(drive-by Web)”可用的,还是仅在用户已授予某一传感器权限或已直接认证的某些上下文中可用?虽然在已授权的上下文中浏览器指纹仍需缓解,但某特性最终主要用于指纹的担忧会减少。
- 范围(scope):这个表面是跨源一致的,还是仅在单个源内一致?总体而言,与特定源绑定的特征或标识符担忧较少,可用与 HTTP cookie 相同的工具处理。
虽然我们不推荐具体的取舍,但这些因素可用于权衡对该表面的增加(见 6.1 Weighing increased fingerprinting surface),并建议合适的缓解措施。尽管每个因素可能提示特定的缓解措施,但在权衡是否增加指纹面时,应综合考虑它们。例如,访问一组关于用户的新特征可能是高熵的,但因可用性有限且易于检测而担忧较少。而一个跨源、随手可用、永久、被动的唯一标识符,则与我们对 Web 隐私的期望不相容。
在进行这一分析时,可能会有人因为与其他 Web 平台部分或协议栈其他层所暴露的指纹面相比较,而倾向于在规范中忽视某些指纹面。对此类主张要谨慎。第一,虽然类似信息可能通过其他途径获得,但类似并不等同:信息披露可能并不完全相同,而将这些不同来源组合起来会促进可指纹化。第二,在存在相同熵的情况下,严重程度或可用性的其他因素可能不同,而这些因素对可行的缓解很重要。第三,平台既非铁板一块也非静止不变;并非所有其他特性在所有情况下都被实现,且未来可能变化(或被移除)。第四,在众多新特性同时开发时,循环依赖是一种危险;两个规范有时会相互引用,以论证指纹面已经存在。对评审者和实现者更有用的做法,是考虑该特定 Web 特性本身所提供的指纹面,并在表面也可能通过其他特性获得时给出具体引用。
Web 规范作者经常试图在新功能与指纹面之间取得平衡。例如,特性检测功能允许在指纹面小幅增加的情况下实现渐进增强;而插件、字体、已连接设备的详细枚举,可能提供很大的指纹面却只有极小的功能支撑。
作者和工作组会根据他们对功能、其实现以及指纹面增加严重程度的理解,逐案确定这些属性之间的恰当平衡。不过,鉴于上述不同的隐私影响,并为了提高各规范之间的一致性,以下实践提供了一些指导:
最佳实践 1:避免不必要或严重地扩大指纹面,尤其是被动指纹。
考虑上述严重程度因素中的每一项,以及该功能是否必要、是否能在指纹面增加较轻的情况下实现可比功能。
尤其要指出,除非某一特性无法以任何其他方式合理设计,否则应避免增加被动可指纹性。被动指纹使得识别更容易、更广泛可用,且没有外部检测或由用户、第三方控制的机会。
最佳实践 2:将具有指纹面的特性的范围和可用性收窄到功能上必要的程度。
哪些浏览上下文、资源和请求需要访问某一特性?标识符通常可以被限定为在不同源具有不同的值。某些配置可能仅在顶级浏览上下文中才必要。
对该功能的访问是否应限制在用户已授予特定权限的地方?虽然过度的权限会造成困惑和疲劳,但将高度细粒度的数据限制在用户已授予访问敏感数据权限的情形,可广泛缓解该特性在“随手访问型”上下文中主要用于浏览器指纹的风险。例如,Media Capture and Streams [[mediacapture-streams]] 将对接入的麦克风和摄像头设备标签的访问,限制在用户已授予访问摄像头或麦克风权限的情形(同时仍允许在所有上下文中访问接入的摄像头和麦克风的数量与配置,这是一个已知的随手访问型指纹面增加)。
一些实现还可能通过不为不同设备或用户代理的不同安装暴露不同能力,来限制指纹面的熵。例如,字体列表可限制为在运行特定浏览器或操作系统的所有设备上常见的列表(如 Tor Browser、Firefox 和 Safari 所实现的那样)。
最佳实践 3:标记有助于可指纹化的特性。
(图:图像 1:此特性可能有助于浏览器可指纹化。) 当某一特性确实有助于指纹面时,应指出该影响:解释其效果(以及任何已知的实现者缓解措施),并用指纹图标标记相关章节,如同本段一样。
以下代码可用于用指纹图标标记段落。
<img src="https://www.w3.org/Icons/fingerprint.png"
class="fingerprint"
alt="This feature may contribute to browser fingerprintability.">
规范可通过标准化来缓解可指纹化;通过定义一致的行为,符合规范的实现就不会有可用于浏览器指纹的差异。
随机化某些浏览器特征曾被提议作为对抗浏览器指纹的一种方式。虽然某些实现可能采用这一策略,但我们总体上预期,对我们而言,标准化或将值置空(null)比设定一个可变化范围更为有效。Tor Browser 设计 [[TOR-DESIGN]] 提供了更多细节,但简言之:很难衡量随机化作为缓解措施的效果如何,并且它可能在可用性(以不希望的方式改变功能或设计)、处理(生成随机数)和开发(包括引入新安全漏洞的成本)方面代价高昂。标准化带来一个好处:配置相同的符合规范浏览器拥有更大的匿名集;也就是说,个人可以看起来像更大的群体,而不是试图看起来像许多不同的个人。
最佳实践 4:规定排序和非功能性差异。
为减少不必要的熵,规定 API 返回值和行为中不构成功能差异的方面。例如,如果列表中返回值的排序没有语义价值,就规定一个特定的排序(例如按定义算法进行字母排序),以免偶然的差异暴露指纹面。
通过 Flash 或 Java 插件访问系统字体列表,其返回的列表明显不是按标准字母顺序排序,而是按系统特定的未指定顺序。这种排序增加了该插件可提供的熵,却没有带来任何功能上的好处。(参见《通过 Flash 插件收集系统字体》。)
标准化并不需要试图隐藏不同浏览器(例如 Edge 和 Chrome)之间的所有差异;不同实现之间总会存在功能和行为差异。因此,完全移除 User-Agent 头并不是目标。然而,User-Agent 字符串中揭示关于用户或设备额外信息的变化,已被证明会提供相当大的指纹面 [[BEAUTY-BEAST]]。
在客户端 API 提供某种指纹面的地方,作者仍可通过可检测性缓解隐私担忧。如果客户端指纹活动在一定程度上能与 API 的功能性使用区分开来,用户代理实现就有机会阻止正在进行的指纹,或使其对用户和外部研究者(包括学者或相关监管者)可观测,后者可能能够检测并调查指纹的使用。
最佳实践 5:设计 API 时仅访问必要的熵。
遵循数据最小化 [[RFC6973]] 的基本原则,设计你的 API,使站点只能访问(且默认只访问)特定功能所必要的熵。
作者可以设计 API 以允许查询某一特定值,而不是返回所有值的枚举。这样,用户代理和研究者就能更容易区分只查询一两个特定值(获得最小熵)的站点和查询所有值(更可能在尝试对浏览器进行指纹)的站点;或者实现可以对不同值的数量设上限。例如,Tor Browser 用 browser.display.max_font_attempts 偏好项限制可查询的字体数量。
返回信息的粒度或精度可以被最小化,以减少熵。例如,Battery Status API [[BATTERY-STATUS]] 的实现曾允许对当前电池电量进行高精度(双精度,即 15-17 位有效数字)读取,这提供了一个短期标识符,可用于跨源或跨本地状态清除来关联流量。将值舍入到较低精度可在保持功能用例的同时缓解浏览器指纹。或者,提供布尔值或小的枚举值,可能在不揭示底层细节的情况下提供功能;例如 Proximity Sensor API [[PROXIMITY]] 中的布尔 near 属性。
更多信息请参见:
- 《Device API Privacy Requirements》 [[dap-privacy-reqs]],DAP 工作组说明,2010 年 6 月。
- 《Data Minimization in Web APIs》 [[TAG-MINIMIZATION]],W3C TAG,2011 年 9 月。
- 《Generic Sensor API: Security and privacy considerations》 [[generic-sensor]],2018 年 3 月。
- 《The leaking battery: A privacy analysis of the HTML5 Battery Status API》 [[LEAKING-BATTERY]],2015 年。
相关地,如果要求站点在信息被发送之前先请求访问(或“选择加入”),那么即便对于在 HTTP 头中发送的数据(我们通常视之为被动指纹),可检测性也会提高。
最佳实践 6:要求服务器声明或选择加入以访问数据。
即便对于在 HTTP 请求头中发送的数据,要求服务器声明对特定数据的使用、公开记录一项政策,或在客户端发送配置数据之前“选择加入”,都提供了被用户代理或研究者检测的可能性。
例如,Client Hints [[client-hints-infrastructure]] 提议一个 Accept-CH 响应头,供服务指明特定提示可用于内容协商,而不是让所有支持客户端在所有请求中发送所有提示。
注意
这是一种相对较新的方法;我们仍在评估它是否能提供有意义且有用的可检测性。
实现者可以通过提供或启用检测工具(instrumentation)来促进可检测性,使用户或第三方能够计算指纹面何时被访问。对检测工具尤为重要的是:访问所有不同的指纹面来源;识别发起脚本;避免暴露检测正在进行。除上述最小化实践外,这些在很大程度上是实现特定(而非 Web 规范)的特性。
如果你的规范暴露了某种指纹面(无论是主动还是被动),一些实现者(例如 Tor Browser)将不得不为某些注重隐私的用户禁用这些特性。
最佳实践 7:为注重隐私的用户或实现者启用优雅降级。
遵循渐进增强原则,并避免进一步的分歧(分歧本身可能暴露用户间的差异),要考虑如果你的规范中某些指纹面特性被禁用,是否仍能实现某些功能。
可以使用显式的钩子或 API 标志,使浏览器扩展或某些用户代理能够轻易禁用特定特性。例如,origin-clean 标志 [[html]] 允许控制图像 canvas 是否可读,这是一个重要的指纹面。
允许在客户端存储数据,以及对该数据进行客户端或服务端查询的功能,会增加类 cookie 指纹的便利性。存储可以是大量数据(例如 Web Storage API),也可以只是一个二进制标志(是否提供了某一权限;是否缓存了单个资源)。
最佳实践 8:避免不必要的新本地状态机制。
如果功能不要求以随后可查询(或以其他方式可观测)的方式维护客户端状态,就避免创建新的类 cookie 特性。该功能能否用现有 HTTP cookie 或现有 JavaScript 本地存储 API 完成?
例如,Flash 插件的 Local Shared Objects(LSO)常被用来复制并复活用户已清除的 HTTP cookie [[FLASHCOOKIES]]。
当特性确实需要设置和取回本地状态时,有办法缓解与意外类 cookie 行为相关的隐私影响;特别是,你可以帮助实现者防止“永久”、“僵尸”、“超级”或“evercookies”。
最佳实践 9:突出显示任何本地状态机制,以便能够同时清除。
清楚注明在何处维护状态且可被查询,并为实现者提供指导,以便为用户启用本地状态的同步删除。此类功能可以缓解“evercookies”的威胁,因为无法利用某一此类存储机制中状态的存在来持久化并重建一个标识符。
永久或持久的数据(包括任何标识符)风险尤高,因为它们削弱了用户清除或重置其设备状态、或维持不同身份的能力。
最佳实践 10:限制永久性或持久性状态。
永久标识符或其他状态(例如在硬件中设置的标识符或密钥)通常不应被暴露。在必要时,对此类标识符的访问将需要用户许可(然而,向用户解释此类许可的含义可能很困难),并限制于特定源(然而,源之间的服务端串通将很难被检测)。因此,你的设计不应依赖于在客户端保存并稍后查询数据、超越用户清除 cookie 或其他本地状态的程度。也就是说,你不应期望任何本地状态信息是永久的,或比其他本地状态存续更久。
虽然严格来说不算浏览器指纹,但对于提供本地数据存储的特性,还有其他关于用户追踪的隐私担忧。Web Storage API 规范中建议的缓解措施包括:安全列表(safe-listing)、阻止列表(block-listing)、过期和安全删除 [[HTML#user-tracking]]。
对 Do Not Track 信号的表达和遵从,并不能抑制浏览器指纹的能力,但可能缓解一些用户对指纹的担忧,特别是围绕这些规范中所定义的追踪 [[TRACKING-DNT]] [[TRACKING-COMPLIANCE]],以及遵从这些用户偏好的服务的实现。也就是说,DNT 可以缓解与合作站点相关的担忧。
以这种方式使用 DNT,通常不需要改动其他功能规范。如果你的规范在收到特定 DNT 信号时预期某种行为,请通过引用 [[TRACKING-DNT]] 来指明。如果你的规范引入了可用于追踪的新通信渠道,你可能希望定义 DNT 信号应如何传达。
一些浏览器开发者维护着关于浏览器指纹的页面,内容包括:为减少该浏览器引擎表面所需的潜在缓解措施或修改;可用于指纹的不同向量;潜在的未来工作。这些并非令人乐观、充满希望的文件。
- The Chromium Projects:《Technical analysis of client identification mechanisms》
- WebKit Wiki:Fingerprinting
- Mozilla Wiki:Fingerprinting
- 《The Design and Implementation of the Tor Browser: Cross-Origin Fingerprinting Unlinkability》
这里有哪些关键论文值得阅读,无论是历史性的还是给出指纹技术最新进展的?有哪些可能相关的开放研究领域?
- Eckersley, Peter.《How unique is your web browser?》Privacy Enhancing Technologies。Springer Berlin Heidelberg,2010。
- Mowery, Keaton, Dillon Bogenreif, Scott Yilek, and Hovav Shacham.《Fingerprinting Information in JavaScript Implementations》。Web 2.0 Security and Privacy,2011。
- Yen, Ting-Fang, et al.《Host fingerprinting and tracking on the web: Privacy and security implications》。Proceedings of NDSS。2012。[[NDSS-FINGERPRINTING]]
- Mowery, Keaton, and Hovav Shacham.《Pixel perfect: Fingerprinting canvas in HTML5》。Web 2.0 Security and Privacy,2012。
- Mattioli, Dana.《On Orbitz, Mac Users Steered to Pricier Hotels》。Wall Street Journal,2012 年 8 月 23 日。
- Gunes Acar et al.《FPDetective: dusting the web for fingerprinters》。CCS '13。
- Nikiforakis, Nick, et al.《Cookieless monster: Exploring the ecosystem of web-based device fingerprinting》。IEEE Symposium on Security and Privacy (S&P 2013),2013。
- G. Acar, C. Eubank, S. Englehardt, M. Juarez, A. Narayanan, C. Diaz.《The Web never forgets: Persistent tracking mechanisms in the wild》。Proceedings of CCS 2014,2014 年 11 月。
- Steven Englehardt, Arvind Narayanan.《Online tracking: A 1-million-site measurement and analysis》。2016 年 5 月。[[WPM-MILLION]]
- Pierre Laperdrix, Walter Rudametkin, Benoit Baudry.《Beauty and the Beast: Diverting modern web browsers to build unique browser fingerprints》。IEEE Symposium on Security and Privacy (S&P 2016),2016 年 5 月。
- 《Hiding in the Crowd: an Analysis of the Effectiveness of Browser Fingerprinting at Large Scale》。WWW2018 - TheWebConf 2018: 27th International World Wide Web Conference,2018 年 4 月。[[HIDING-CROWD]]
一份非穷尽的、允许访客测试其配置可指纹化程度的站点清单。
- amiunique.org(INRIA)
- panopticlick.eff.org(EFF)
- BrowserSPY.dk
- pet-portal cross-browser fingerprinting test
- p0f v3(纯被动指纹)
感谢 Robin Berjon 提供 ReSpec、Tobie Langel 提供 GitHub 建议;感谢 Privacy Interest Group 和 Technical Architecture Group 的审阅;感谢 Tor Browser 设计者提供的参考与建议;感谢 Christine Runnegar 的贡献。
C. 参考文献
C.1 资料性参考文献
[BATTERY-STATUS]《Battery Status API》。Anssi Kostiainen。W3C。2024 年 10 月 24 日。W3C Working Draft。URL:https://www.w3.org/TR/battery-status/
[BEAUTY-BEAST]《Beauty and the Beast: Diverting modern web browsers to build unique browser fingerprints》。Pierre Laperdrix; Walter Rudametkin; Benoit Baudry。IEEE Symposium on Security and Privacy (S&P 2016)。2016 年 5 月。URL:https://inria.hal.science/hal-01285470v2/
[client-hints-infrastructure]《Client Hints Infrastructure》。W3C。Draft Community Group Report。URL:https://wicg.github.io/client-hints-infrastructure/
[dap-privacy-reqs]《Device API Privacy Requirements》。Alissa Cooper; Frederick Hirsch; John Morris。W3C。2010 年 6 月 29 日。W3C Working Group Note。URL:https://www.w3.org/TR/dap-privacy-reqs/
[EVERCOOKIE]《evercookie - virtually irrevocable persistent cookies》。Samy Kamkar。2010 年 9 月。URL:https://samy.pl/evercookie/
[FLASHCOOKIES]《Flash Cookies and Privacy》。Ashkan Soltani; Shannon Canty; Quentin Mayo; Lauren Thomas; Chris Jay Hoofnagle。2009 年 8 月 10 日。URL:https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1446862
[FLASHCOOKIES-2]《Flash cookies and privacy II: Now with HTML5 and ETag respawning》。Mika Ayenson; Dietrich Wambach; Ashkan Soltani; Nathan Good; Chris Hoofnagle。URL:https://ptolemy.berkeley.edu/projects/truststc/education/reu/11/Posters/AyensonMWambachDpaper.pdf
[generic-sensor]《Generic Sensor API》。Rick Waldron。W3C。2024 年 2 月 22 日。CRD。URL:https://www.w3.org/TR/generic-sensor/
[HIDING-CROWD]《Hiding in the Crowd: an Analysis of the Effectiveness of Browser Fingerprinting at Large Scale》。Alejandro Gómez-Boix; Pierre Laperdrix; Benoit Baudry。WWW2018 - TheWebConf2018: 27th International World Wide Web Conference。2018 年 4 月。URL:https://inria.hal.science/hal-01718234v2
[html]《HTML Standard》。Anne van Kesteren; Domenic Denicola; Dominic Farolino; Ian Hickson; Philip Jägenstedt; Simon Pieters。WHATWG。Living Standard。URL:https://html.spec.whatwg.org/multipage/
[LEAKING-BATTERY]《The leaking battery: A privacy analysis of the HTML5 Battery Status API》。Łukasz Olejnik; Gunes Acar; Claude Castelluccia; Claudia Diaz。2015。URL:https://eprint.iacr.org/2015/616.pdf
[mediacapture-streams]《Media Capture and Streams》。Cullen Jennings; Bernard Aboba; Jan-Ivar Bruaroey; Henrik Boström; youenn fablet。W3C。2024 年 12 月 19 日。CRD。URL:https://www.w3.org/TR/mediacapture-streams/
[NDSS-FINGERPRINTING]《Host Fingerprinting and Tracking on the Web: Privacy and Security Implications》。Ting-Fang Yen; Yinglian Xie; Fang Yu; Roger Peng Yu; Martin Abadi。In Proceedings of the Network and Distributed System Security Symposium (NDSS)。2012 年 2 月。URL:https://www.microsoft.com/en-us/research/publication/host-fingerprinting-and-tracking-on-the-webprivacy-and-security-implications/
[PROXIMITY]《Proximity Sensor》。Anssi Kostiainen; Rijubrata Bhaumik。W3C。2025 年 2 月 12 日。W3C Working Draft。URL:https://www.w3.org/TR/proximity/
[RFC6265]《HTTP State Management Mechanism》。A. Barth。IETF。2011 年 4 月。Proposed Standard。URL:https://httpwg.org/specs/rfc6265.html
[RFC6454]《The Web Origin Concept》。A. Barth。IETF。2011 年 12 月。Proposed Standard。URL:https://www.rfc-editor.org/rfc/rfc6454
[RFC6973]《Privacy Considerations for Internet Protocols》。A. Cooper; H. Tschofenig; B. Aboba; J. Peterson; J. Morris; M. Hansen; R. Smith。IETF。2013 年 7 月。Informational。URL:https://www.rfc-editor.org/rfc/rfc6973
[RFC9110]《HTTP Semantics》。R. Fielding, Ed.; M. Nottingham, Ed.; J. Reschke, Ed。IETF。2022 年 6 月。Internet Standard。URL:https://httpwg.org/specs/rfc9110.html
[security-privacy-questionnaire]《Self-Review Questionnaire: Security and Privacy》。Theresa O'Connor; Peter Snyder; Simone Onofri。W3C。2025 年 2 月 12 日。W3C Working Group Note。URL:https://www.w3.org/TR/security-privacy-questionnaire/
[TAG-MINIMIZATION]《Data Minimization in Web APIs》。Daniel Appelquist。W3C Technical Architecture Group。2011 年 9 月 12 日。URL:https://www.w3.org/2001/tag/doc/APIMinimization
[TAG-UNSANCTIONED]《Unsanctioned Web Tracking》。Mark Nottingham。W3C Technical Architecture Group。2015 年 7 月 17 日。URL:https://w3ctag.github.io/unsanctioned-tracking/
[TOR-DESIGN]《The Design and Implementation of the Tor Browser》。Mike Perry; Erinn Clark; Steven Murdoch; Georg Koppen。2018 年 6 月 15 日。URL:https://spec.torproject.org/torbrowser-design
[TRACKING-COMPLIANCE]《Tracking Compliance and Scope》。Nick Doty; Heather West; Justin Brookman; Sean Harvey; Erica Newland。W3C。2019 年 1 月 22 日。W3C Working Group Note。URL:https://www.w3.org/TR/tracking-compliance/
[TRACKING-DNT]《Tracking Preference Expression (DNT)》。Roy Fielding; David Singer。W3C。2019 年 1 月 17 日。W3C Working Group Note。URL:https://www.w3.org/TR/tracking-dnt/
[WPM-MILLION]《Online tracking: A 1-million-site measurement and analysis》。Steven Englehardt; Arvind Narayanan。2016 年 5 月。URL:https://webtransparency.cs.princeton.edu/webcensus/
This version is outdated!For the latest version, please look at https://www.w3.org/TR/fingerprinting-guidance/.
Jump to Table of ContentsCollapse Sidebar
Abstract
Exposure of settings and characteristics of browsers can harm user privacy by allowing for browser fingerprinting. This document defines different types of fingerprinting, considers distinct levels of mitigation for the related privacy risks and provides guidance for Web specification authors on how to balance these concerns when designing new Web features.
Status of This Document
This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/._
This document provide guidance to Web specification authors on mitigating the privacy impacts of browser fingerprinting.
The Privacy Working Group is collaborating with the Technical Architecture Group (TAG) on this guidance.
This document was published by the Privacy Working Group as a Group Note using the Note track.
This Group Note is endorsed by the Privacy Working Group, but is not endorsed by W3C itself nor its Members.
This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
The W3C Patent Policy does not carry any licensing requirements or commitments on this document.
This document is governed by the 03 November 2023 W3C Process Document.
Table of Contents
In short, browser fingerprinting is the capability of a site to identify or re-identify a visiting user, user agent or device via configuration settings or other observable characteristics.
A similar definition is provided by [[RFC6973](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-rfc6973 "Privacy Considerations for Internet Protocols")]. A more detailed list of types of fingerprinting is included below. This document does not attempt to catalog all features currently used or usable for browser fingerprinting; however, A. Research provides links to browser vendor pages and academic findings.
Browser fingerprinting can be used as a security measure (e.g. as means of authenticating the user). However, fingerprinting is also a potential threat to users' privacy on the Web. This document does not attempt to provide a single unifying definition of "privacy" or "personal data", but we highlight how browser fingerprinting might impact users' privacy. For example, browser fingerprinting can be used to:
- identify a user
- correlate a user’s browsing activity within and across sessions
- track users without transparency or control
The privacy implications associated with each use case are discussed below. Following from the practice of security threat model analysis, we note that there are distinct models of privacy threats for fingerprinting. Defenses against these threats differ, depending on the particular privacy implication and the threat model of the user.
There are many reasons why users might wish to remain anonymous or unidentified online, including: concerns about surveillance, personal physical safety, and concerns about discrimination against them based on what they read or write when using the Web. When a browser fingerprint is correlated with identifying information (like an email address, a recognized given and sur-name, or a government-issued identifier), an application or service provider may be able to identify an otherwise pseudonymous user. The adversary and consequences of this threat will vary by the particular user and use case, but can include nation-state intelligence agencies and threats of violence or imprisonment.
Browser fingerprinting raises privacy concerns even when offline identities are not implicated. Some users may be surprised or concerned that an online party can correlate multiple visits (on the same or different sites) to develop a profile or history of the user. This concern may be heightened because (see below) it may occur without the user's knowledge or consent and tools such as clearing cookies do not prevent further correlation.
Browser fingerprinting also allows for tracking across origins [[RFC6454](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-rfc6454 "The Web Origin Concept")]: different sites may be able to combine information about a single user even where a cookie policy would block accessing of cookies between origins, because the fingerprint is relatively unique and the same for all origins.
In contrast to other mechanisms defined by Web standards for maintaining state (e.g. cookies), browser fingerprinting allows for collection of data about user activity without clear indications that such collection is happening. Transparency can be important for end users, to understand how ongoing collection is happening, but it also enables researchers, policymakers and others to document or regulate privacy-sensitive activity. Browser fingerprinting also allows for tracking of activity without clear or effective user controls: a browser fingerprint typically cannot be cleared or re-set. (See the finding on unsanctioned tracking [[TAG-UNSANCTIONED](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-tag-unsanctioned "Unsanctioned Web Tracking")].)
Advances in techniques for browser fingerprinting (see A. Research, below), particularly in active fingerprinting, suggest that complete elimination of the capability of browser fingerprinting by a determined adversary through solely technical means that are widely deployed is implausible. However, mitigations in our technical specifications are possible, as described below (6. Mitigations), and may achieve different levels of success (4. Feasibility).
Mitigations recommended here are simply mitigations, not solutions. Users of the Web cannot confidently rely on sites being completely unable to correlate traffic, especially when executing client-side code. A fingerprinting surface extends across all implemented Web features for a particular user agent, and even to other layers of the stack; for example, differences in TCP connections. For example, a user might employ an onion routing system such as Tor to limit network-level linkability, but still face the risk of correlating Web-based activity through browser fingerprinting, or vice versa. In order to mitigate these privacy risks as a whole, fingerprinting must be considered during the design and development of all specifications.
The TAG finding on Unsanctioned Web Tracking, including browser fingerprinting, includes description of the limitations of technical measures and encourages minimizing and documenting new fingerprinting surface [[TAG-UNSANCTIONED](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-tag-unsanctioned "Unsanctioned Web Tracking")]. The best practices below detail common actions that authors of specifications for Web features can take to mitigate the privacy impacts of browser fingerprinting. The Self-Review Questionnaire documents mitigations of privacy impacts in Web features more generally that may complement these practices [[security-privacy-questionnaire](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-security-privacy-questionnaire "Self-Review Questionnaire: Security and Privacy")].
- Best Practice 1: Avoid unnecessary or severe increases to fingerprinting surface, especially for passive fingerprinting.
- Best Practice 2: Narrow the scope and availability of a feature with fingerprinting surface to what is functionally necessary.
- Best Practice 3: Mark features that contribute to fingerprintability.
- Best Practice 4: Specify orderings and non-functional differences.
- Best Practice 5: Design APIs to access only the entropy necessary.
- Best Practice 6: Require servers to advertise or opt in to access data.
- Best Practice 7: Enable graceful degradation for privacy-conscious users or implementers.
- Best Practice 8: Avoid unnecessary new local state mechanisms.
- Best Practice 9: Highlight any local state mechanisms to enable simultaneous clearing.
- Best Practice 10: Limit permanent or persistent state.
Passive fingerprinting is browser fingerprinting based on characteristics observable in the contents of Web requests, without the use of any code executed on the client.
Passive fingerprinting would trivially include cookies (often unique identifiers sent in HTTP requests), the set of HTTP request headers and the IP address and other network-level information. The User-Agent string [[RFC9110](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-rfc9110 "HTTP Semantics")], for example, is an HTTP request header that typically identifies the browser, renderer, version and operating system. For some populations, the User-Agent and IP address will often uniquely identify a particular user's browser [[NDSS-FINGERPRINTING](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-ndss-fingerprinting "Host Fingerprinting and Tracking on the Web: Privacy and Security Implications")].
For active fingerprinting, we also consider techniques where a site runs JavaScript or other code on the local client to observe additional characteristics about the browser, user, device or other context.
Techniques for active fingerprinting might include accessing the window size, enumerating fonts or plug-ins, evaluating performance characteristics, reading from device sensors, and rendering graphical patterns. Key to this distinction is that active fingerprinting takes place in a way that is potentially detectable on the client.
Users, user agents and devices may also be re-identified by a site that first sets and later retrieves state stored by a user agent or device. This cookie-like fingerprinting allows re-identification of a user or inferences about a user in the same way that HTTP cookies allow state management for the stateless HTTP protocol [[RFC6265](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-rfc6265 "HTTP State Management Mechanism")].
Cookie-like fingerprinting can also circumvent user attempts to limit or clear cookies stored by the user agent, as demonstrated by the "evercookie" implementation [[EVERCOOKIE](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-evercookie "evercookie - virtually irrevocable persistent cookies")]. Where state is maintained across user agents (as in the case of common plugins with local storage), across devices (as in the case of certain browser syncing mechanisms) or across software upgrades, cookie-like fingerprinting can allow re-identification of users, user agents or devices where active and passive fingerprinting might not. The Security and Privacy Self-Review Questionnaire also considers this threat in origin state that persists across browsing sessions [[security-privacy-questionnaire](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-security-privacy-questionnaire "Self-Review Questionnaire: Security and Privacy")].
There are different levels of success in mitigating browser fingerprinting:
Decreased fingerprinting surface Removing the source of entropy or available attributes that can be used for fingerprinting.Increased anonymity set By standardization, convention or common implementation, increasing the commonality of particular configurations to decrease the likelihood of unique fingerprintability.Detectable fingerprinting Making fingerprinting observable to others, so that the user agent might block it or researchers can determine that it's happening.Clearable local state Helping users respond to fingerprinting by making state mechanisms clearable.
Research has shown feasible improvement in privacy protection in all of these areas. While lists of plugins remain a large fingerprinting surface, entropy has decreased over time with migration to Web APIs over plugins [[HIDING-CROWD](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-hiding-crowd "Hiding in the Crowd: an Analysis of the Effectiveness of Browser Fingerprinting at Large Scale")]. Collected data on Web users has shown mobile devices to have substantially larger anonymity sets than desktop browsers [[HIDING-CROWD](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-hiding-crowd "Hiding in the Crowd: an Analysis of the Effectiveness of Browser Fingerprinting at Large Scale")]. Research on forms of active fingerprinting has documented its use and demonstrated changes in use of those techniques as an apparent result of increased awareness [[WPM-MILLION](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-wpm-million "Online tracking: A 1-million-site measurement and analysis")]. Respawning of cookies has continued, with an increasing variety of techniques, but awareness and technical responses to the issue has made the practice less widespread [[FLASHCOOKIES-2](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-flashcookies-2 "Flash cookies and privacy II: Now with HTML5 and ETag respawning")].
This document works under the expectation that mitigations with different levels of success are feasible under different circumstances, for different threat models and against different types of fingerprinting. In general, active fingerprinting may be made detectable; we can minimize increases to the surface of passive fingerprinting; and cookie-like mechanisms can be made clearable.
Some implementers and some users may be willing to accept reduced functionality or decreased performance in order to minimize browser fingerprinting. Documenting which features have fingerprinting risk eases the work of implementers building modes for these at-risk users; minimizing fingerprinting even in cases where common implementations will have easy active fingerprintability allows such users to reduce the functionality trade-offs necessary. Making browser fingerprinting more detectable also contributes to mitigations outside the standardization process; for example, though regulatory or policy means [[TAG-UNSANCTIONED](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-tag-unsanctioned "Unsanctioned Web Tracking")].
To mitigate browser fingerprinting in your specification:
- identify features that can be used for browser fingerprinting;
- evaluate the severity of the fingerprinting surface based on these five factors; and,
- apply mitigations described in the best practices below (6. Mitigations), focused on limiting the severity of that fingerprinting surface.
The fingerprinting surface of a user agent is the set of observable characteristics that can be used in concert to identify a user, user agent or device or correlate its activity.
Data sources that may be used for browser fingerprinting include:
- user configuration
- device characteristics
- environmental characteristics (e.g. sensor readings)
- operating system characteristics
- user behavior
- browser characteristics
These data sources may be accessed directly for some features, but in many other cases they are inferred through some other observation. Timing channels, in particular, are commonly used to infer details of hardware (exactly how quickly different operations are completed may provide information on GPU capability, say), network information (via the latency or speed in loading a particular resource) or even user configuration (what items have been previously cached or what resources are not loaded). Consider the side effects of feature and how those side effects would allow inferences of any of these characteristics.
The Tor Browser design document [[TOR-DESIGN](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-tor-design "The Design and Implementation of the Tor Browser")] has more details on these sources and their relative priorities; this document adds environmental characteristics in that sensor readings or data access may distinguish a user, user agent or device by information about the environment (location, for example).
For each identified feature, consider the severity for the privacy impacts described above (1.2 Privacy impacts and threat models) based on the following factors:
entropy How distinguishing is this new surface? Consider both the possible variations and the likely distribution of values. Adding 1-bit of entropy is typically of less concern; 30-some bits of entropy would be enough to uniquely identify every individual person. Different data sources may provide different distributions of variation; for example, some characteristics may reveal a common hardware class while other characteristics may reveal user configurations that vary between individual people.detectability Will use of this feature for browser fingerprinting be observable to the user agent or likely to be discoverable by researchers? Because detectability is an important — and perhaps the most feasible — mitigation, increases to the surface for passive fingerprinting are of particular concern and should be avoided.persistence How long will the characteristics of this fingerprinting surface stay unchanged? Can users control or re-set these values to prevent long-lived identification? While short-lived characteristics may still enable unexpected correlation of activity (for example, between two browser profiles on the same device), persistent or permanent identifiers are particularly concerning for the lack of user control.availability Will this surface be available to the "drive-by Web" or only in certain contexts where a user has granted a particular sensor permission or directly authenticated? While browser fingerprinting is still something to mitigate in the permissioned context, the concern that a feature will end up used primarily for fingerprinting is reduced.scope Is this surface consistent across origins or only within a single origin? In general, characteristics or identifiers that are tied to a particular origin are of less concern and can be handled with the same tools as HTTP cookies.
While we do not recommend specific trade-offs, these factors can be used to weigh increases to that surface (6.1 Weighing increased fingerprinting surface) and suggest appropriate mitigations. Although each factor may suggest specific mitigations, in weighing whether to add fingerprinting surface they should be considered in concert. For example, access to a new set of characteristics about the user may be high entropy, but be of less concern because it has limited availability and is easily detectable. A cross-origin, drive-by-available, permanent, passive unique identifier is incompatible with our expectations for privacy on the Web.
In conducting this analysis, it may be tempting to dismiss certain fingerprinting surface in a specification because of a comparison to fingerprinting surface exposed by other parts of the Web platform or other layers of the stack. Be cautious about making such claims. First, while similar information may be available through other means, similar is not identical: information disclosures may not be exactly the same and fingerprintability is promoted by combining these distinct sources. Second, where identical entropy is present, other factors of severity or availability may differ and those factors are important for feasible mitigation. Third, the platform is neither monolithic nor static; not all other features are implemented in all cases and may change (or be removed) in the future. Fourth, circular dependencies are a danger when so many new features are under development; two specifications sometimes refer to one another in arguing that fingerprinting surface already exists. It is more useful to reviewers and implementers to consider the fingerprinting surface provided by the particular Web feature itself, with specific references where surface may be available through other features as well.
Web specification authors regularly attempt to strike a balance between new functionality and fingerprinting surface. For example, feature detection functionality allows for progressive enhancement with a small addition to fingerprinting surface; detailed enumerations of plugins, fonts, connected devices may provide a large fingerprinting surface with minimal functional support.
Authors and Working Groups determine the appropriate balance between these properties on a case-by-case basis, given their understanding of the functionality, its implementations and the severity of increased fingerprinting surface. However, given the distinct privacy impacts described above and in order to improve consistency across specifications, these practices provide some guidance:
Best Practice 1
: Avoid unnecessary or severe increases to fingerprinting surface, especially for passive fingerprinting.
Consider each of the severity factors described above and whether that functionality is necessary and whether comparable functionality is feasible with less severe increases to the fingerprinting surface.
In particular, unless a feature cannot reasonably be designed in any other way, increased passive fingerprintability should be avoided. Passive fingerprinting allows for easier and widely-available identification, without opportunities for external detection or control by users or third parties.
Best Practice 2
: Narrow the scope and availability of a feature with fingerprinting surface to what is functionally necessary.
What browsing contexts, resources and requests need access to a particular feature? Identifiers can often be scoped to have a different value in different origins. Some configuration may only be necessary in top-level browsing contexts.
Should access to this functionality be limited to where users have granted a particular permission? While excessive permissions can create confusion and fatigue, limiting highly granular data to situations where a user has already granted permission to access sensitive data widely mitigates the risk of that feature being used primarily for browser fingerprinting in "drive-by" contexts. For example, Media Capture and Streams [[mediacapture-streams](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-mediacapture-streams "Media Capture and Streams")] limits access to attached microphone and camera device labels to when the user has granted permission to access a camera or microphone (while still allowing access to the number and configuration of attached cameras and microphones in all contexts, a noted increase in drive-by fingerprinting surface).
Some implementations may also limit the entropy of fingerprinting surface by not exposing different capabilities for different devices or installations of a user agent. Font lists, for example, can be limited to a list commonly available on all devices that run a particular browser or operating system (as implemented in Tor Browser, Firefox and Safari).
Best Practice 3
: Mark features that contribute to fingerprintability.
(图:Image 1: This feature may contribute to browser fingerprintability.) Where a feature does contribute to the fingerprinting surface, indicate that impact, by explaining the effect (and any known implementer mitigations) and marking the relevant section with a fingerprinting icon, as this paragraph is.
The following code can be used to mark a paragraph with the fingerprint icon.
<img src="https://www.w3.org/Icons/fingerprint.png"
class="fingerprint"
alt="This feature may contribute to browser fingerprintability.">
Specifications can mitigate against fingerprintability through standardization; by defining a consistent behavior, conformant implementations won't have variations that can be used for browser fingerprinting.
Randomization of certain browser characteristics has been proposed as a way to combat browser fingerprinting. While this strategy may be pursued by some implementations, we expect in general it will be more effective for us to standardize or null values rather than setting a range over which they can vary. The Tor Browser design [[TOR-DESIGN](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-tor-design "The Design and Implementation of the Tor Browser")] provides more detailed information, but in short: it's difficult to measure how well randomization will work as a mitigation and it can be costly to implement in terms of usability (varying functionality or design in unwanted ways), processing (generating random numbers) and development (including the cost of introducing new security vulnerabilities). Standardization provides the benefit of an increased anonymity set for conformant browsers with the same configuration: that is, an individual can look the same as a larger group of people rather than trying to look like a number of different individuals.
Best Practice 4
: Specify orderings and non-functional differences.
To reduce unnecessary entropy, specify aspects of API return values and behavior that don't contribute to functional differences. For example, if the ordering of return values in a list has no semantic value, specify a particular ordering (alphabetical order by a defined algorithm, for example) so that incidental differences don't expose fingerprinting surface.
Access to a list of system fonts via Flash or Java plugins notably returns the list sorted not in a standard alphabetical order, but in an unspecified order specific to the system. This ordering adds to the entropy available from that plugin in a way that provides no functional advantage. (See Collecting System Fonts via Flash Plugins.)
Standardization does not need to attempt to hide all differences between different browsers (e.g. Edge and Chrome); implemented functionality and behavior differences will always exist between different implementations. For that reason, removing User-Agent headers altogether is not a goal. However, variation in the User-Agent string that reveals additional information about the user or device has been shown to provide substantial fingerprinting surface [[BEAUTY-BEAST](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-beauty-beast "Beauty and the Beast: Diverting modern web browsers to build unique browser fingerprints")].
Where a client-side API provides some fingerprinting surface, authors can still mitigate the privacy concerns via detectability. If client-side fingerprinting activity is to some extent distinguishable from functional use of APIs, user agent implementations may have an opportunity to prevent ongoing fingerprinting or make it observable to users and external researchers (including academics or relevant regulators) who may be able to detect and investigate the use of fingerprinting.
Best Practice 5
: Design APIs to access only the entropy necessary.
Following the basic principle of data minimization [[RFC6973](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-rfc6973 "Privacy Considerations for Internet Protocols")], design your APIs such that a site can access (and does access by default) only the entropy necessary for particular functionality.
Authors might design an API to allow for querying of a particular value, rather than returning an enumeration of all values. User agents and researchers can then more easily distinguish between sites that query for one or two particular values (gaining minimal entropy) and those that query for all values (more likely attempting to fingerprint the browser); or implementations can cap the number of different values. For example, Tor Browser limits the number of fonts that can be queried with a browser.display.max_font_attempts preference.
The granularity or precision of information returned can be minimized in order to reduce entropy. For example, implementations of the Battery Status API [[BATTERY-STATUS](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-battery-status "Battery Status API")] allowed for high precision (double-precision, or 15-17 significant digits) readings of the current battery level, which provided a short-term identifier that could be used to correlate traffic across origins or clearance of local state. Rounding off values to lower precision mitigates browser fingerprinting while maintaining functional use cases. Alternatively, providing Boolean or a small enumeration of values might provide functionality without revealing underlying details; for example, the Boolean near property in the Proximity Sensor API [[PROXIMITY](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-proximity "Proximity Sensor")].
For more information, see:
- Device API Privacy Requirements [[dap-privacy-reqs](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-dap-privacy-reqs "Device API Privacy Requirements")], DAP Working Group Note, June 2010.
- Data Minimization in Web APIs [[TAG-MINIMIZATION](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-tag-minimization "Data Minimization in Web APIs")], W3C TAG, September 2011.
- Generic Sensor API: Security and privacy considerations [[generic-sensor](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-generic-sensor "Generic Sensor API")], March 2018.
- The leaking battery: A privacy analysis of the HTML5 Battery Status API [[LEAKING-BATTERY](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-leaking-battery "The leaking battery: A privacy analysis of the HTML5 Battery Status API")], 2015.
Related, detectability is improved even with data sent in HTTP headers (what we would typically consider passive fingerprinting) if sites are required to request access (or "opt in") to information before it's sent.
Best Practice 6
: Require servers to advertise or opt in to access data.
Even for data sent in HTTP request headers, requiring servers to advertise use of particular data, publicly document a policy, or "opt in" before clients send configuration data provides the possibility of detection by user agents or researchers.
For example, Client Hints [[client-hints-infrastructure](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-client-hints-infrastructure "Client Hints Infrastructure")] proposes an Accept-CH response header for services to indicate that specific hints can be used for content negotiation, rather than all supporting clients sending all hints in all requests.
Note
This is a relatively new approach; we're still evaluating whether this provides meaningful and useful detectability.
Implementers can facilitate detectability by providing or enabling instrumentation so that users or third parties are able to calculate when fingerprinting surface is being accessed. Of particular importance for instrumentation are: access to all the different sources of fingerprinting surface; identification of the originating script; avoiding exposure that instrumentation is taking place. Beyond the minimization practice described above, these are largely implementation-specific (rather than Web specification) features.
If your specification exposes some fingerprinting surface (whether it's active or passive), some implementers (e.g. Tor Browser) are going to be compelled to disable those features for certain privacy-conscious users.
Best Practice 7
: Enable graceful degradation for privacy-conscious users or implementers.
Following the principle of progressive enhancement, and to avoid further divergence (which might itself expose variation in users), consider whether some functionality in your specification is still possible if fingerprinting surface features are disabled.
Explicit hooks or API flags may be used so that browser extensions or certain user agents can easily disable specific features. For example, the origin-clean flag [[html](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-html "HTML Standard")] allows control over whether an image canvas can be read, a significant fingerprinting surface.
Features which enable storage of data on the client and functionality for client- or server-side querying of that data can increase the ease of cookie-like fingerprinting. Storage can vary between large amounts of data (for example, the Web Storage API) or just a binary flag (has or has not provided a certain permission; has or has not cached a single resource).
Best Practice 8
: Avoid unnecessary new local state mechanisms.
If functionality does not require maintaining client-side state in a way that is subsequently queryable (or otherwise observable), avoid creating a new cookie-like feature. Can the functionality be accomplished with existing HTTP cookies or an existing JavaScript local storage API?
For example, the Flash plugin's Local Shared Objects (LSOs) have often been used to duplicate and re-spawn HTTP cookies cleared by the user [[FLASHCOOKIES](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-flashcookies "Flash Cookies and Privacy")].
Where features do require setting and retrieving local state, there are ways to mitigate the privacy impacts related to unexpected cookie-like behavior; in particular, you can help implementers prevent "permanent", "zombie", "super" or "evercookies".
Best Practice 9
: Highlight any local state mechanisms to enable simultaneous clearing.
Clearly note where state is being maintained and could be queried and provide guidance to implementers on enabling simultaneous deletion of local state for users. Such functionality can mitigate the threat of "evercookies" because the presence of state in one such storage mechanism can't be used to persist and re-create an identifier.
Permanent or persistent data (including any identifiers) are of particular risk because they undermine the ability for a user to clear or re-set the state of their device or to maintain different identities.
Best Practice 10
: Limit permanent or persistent state.
Permanent identifiers or other state (for example, identifiers or keys set in hardware) should typically not be exposed. Where necessary, access to such identifiers would require user permission (however, explaining the implications of such permission to users may be difficult) and limitation to a particular origin (however, server-side collusion between origins will be difficult to detect). As a result, your design should not rely on saving and later querying data on the client beyond a user's clearing cookies or other local state. That is, you should not expect any local state information to be permanent or to persist longer than other local state.
Though not strictly browser fingerprinting, there are other privacy concerns regarding user tracking for features that provide local storage of data. Mitigations suggested in the Web Storage API specification include: safe-listing, block-listing, expiration and secure deletion [[HTML#user-tracking]](https://html.spec.whatwg.org/multipage/webstorage.html#user-tracking).
Expressions of, and compliance with, a Do Not Track signal does not inhibit the capability of browser fingerprinting, but may mitigate some user concerns about fingerprinting, specifically around tracking as defined in those specifications [[TRACKING-DNT](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-tracking-dnt "Tracking Preference Expression (DNT)")] [[TRACKING-COMPLIANCE](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-tracking-compliance "Tracking Compliance and Scope")] and as implemented by services that comply with those user preferences. That is, DNT can mitigate concerns with cooperative sites.
The use of DNT in this way typically does not require changes to other functional specifications. If your specification expects a particular behavior upon receiving a particular DNT signal, indicate that with a reference to [[TRACKING-DNT](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-tracking-dnt "Tracking Preference Expression (DNT)")]. If your specification introduces a new communication channel that could be used for tracking, you might wish to define how a DNT signal should be communicated.
Some browser developers maintain pages on browser fingerprinting, including: potential mitigations or modifications necessary to decrease the surface of that browser engine; different vectors that can be used for fingerprinting; potential future work. These are not cheery, optimistic documents.
- The Chromium Projects: Technical analysis of client identification mechanisms
- WebKit Wiki: Fingerprinting
- Mozilla Wiki: Fingerprinting
- The Design and Implementation of the Tor Browser: Cross-Origin Fingerprinting Unlinkability
What are the key papers to read here, historically or to give the latest on fingerprinting techniques? What are some areas of open research that might be relevant?
- Eckersley, Peter. "How unique is your web browser?" Privacy Enhancing Technologies. Springer Berlin Heidelberg, 2010.
- Mowery, Keaton, Dillon Bogenreif, Scott Yilek, and Hovav Shacham. “Fingerprinting Information in JavaScript Implementations.” In Web 2.0 Security and Privacy, 2011.
- Yen, Ting-Fang, et al. "Host fingerprinting and tracking on the web: Privacy and security implications." Proceedings of NDSS. 2012. [[NDSS-FINGERPRINTING](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-ndss-fingerprinting "Host Fingerprinting and Tracking on the Web: Privacy and Security Implications")]
- Mowery, Keaton, and Hovav Shacham. "Pixel perfect: Fingerprinting canvas in HTML5." Web 2.0 Security and Privacy, 2012.
- Mattioli, Dana. "On Orbitz, Mac Users Steered to Pricier Hotels". Wall Street Journal, August 23, 2012.
- Gunes Acar et al. "FPDetective: dusting the web for fingerprinters." In CCS '13.
- Nikiforakis, Nick, et al. "Cookieless monster: Exploring the ecosystem of web-based device fingerprinting." IEEE Symposium on Security and Privacy (S&P 2013), 2013.
- G. Acar, C. Eubank, S. Englehardt, M. Juarez, A. Narayanan, C. Diaz. "The Web never forgets: Persistent tracking mechanisms in the wild." In Proceedings of CCS 2014, Nov. 2014.
- Steven Englehardt, Arvind Narayanan. "Online tracking: A 1-million-site measurement and analysis." May 2016. [[WPM-MILLION](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-wpm-million "Online tracking: A 1-million-site measurement and analysis")]
- Pierre Laperdrix, Walter Rudametkin, Benoit Baudry. "Beauty and the Beast: Diverting modern web browsers to build unique browser fingerprints." IEEE Symposium on Security and Privacy (S&P 2016), May 2016.
- "Hiding in the Crowd: an Analysis of the Effectiveness of Browser Fingerprinting at Large Scale." WWW2018 - TheWebConf 2018: 27th International World Wide Web Conference, April 2018. [[HIDING-CROWD](https://www.w3.org/TR/2025/NOTE-fingerprinting-guidance-20250320/#bib-hiding-crowd "Hiding in the Crowd: an Analysis of the Effectiveness of Browser Fingerprinting at Large Scale")]
A non-exhaustive list of sites that allow the visitor to test their configuration for fingerprintability.
- amiunique.org (INRIA)
- panopticlick.eff.org (EFF)
- BrowserSPY.dk
- pet-portal cross-browser fingerprinting test
- p0f v3 (purely passive fingerprinting)
Many thanks to Robin Berjon for ReSpec and to Tobie Langel for Github advice; to the Privacy Interest Group and the Technical Architecture Group for review; to the Tor Browser designers for references and recommendations; and to Christine Runnegar for contributions.
[BATTERY-STATUS]Battery Status API. Anssi Kostiainen. W3C. 24 October 2024. W3C Working Draft. URL: https://www.w3.org/TR/battery-status/[BEAUTY-BEAST]Beauty and the Beast: Diverting modern web browsers to build unique browser fingerprints. Pierre Laperdrix; Walter Rudametkin; Benoit Baudry. IEEE Symposium on Security and Privacy (S&P 2016). May 2016. URL: https://inria.hal.science/hal-01285470v2/[client-hints-infrastructure]Client Hints Infrastructure. W3C. Draft Community Group Report. URL: https://wicg.github.io/client-hints-infrastructure/[dap-privacy-reqs]Device API Privacy Requirements. Alissa Cooper; Frederick Hirsch; John Morris. W3C. 29 June 2010. W3C Working Group Note. URL: https://www.w3.org/TR/dap-privacy-reqs/[EVERCOOKIE]evercookie - virtually irrevocable persistent cookies. Samy Kamkar. September 2010. URL: https://samy.pl/evercookie/[FLASHCOOKIES]Flash Cookies and Privacy. Ashkan Soltani; Shannon Canty; Quentin Mayo; Lauren Thomas; Chris Jay Hoofnagle. 10 August 2009. URL: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1446862[FLASHCOOKIES-2]Flash cookies and privacy II: Now with HTML5 and ETag respawning. Mika Ayenson; Dietrich Wambach; Ashkan Soltani; Nathan Good; Chris Hoofnagle. URL: https://ptolemy.berkeley.edu/projects/truststc/education/reu/11/Posters/AyensonMWambachDpaper.pdf[generic-sensor]Generic Sensor API. Rick Waldron. W3C. 22 February 2024. CRD. URL: https://www.w3.org/TR/generic-sensor/[HIDING-CROWD]Hiding in the Crowd: an Analysis of the Effectiveness of Browser Fingerprinting at Large Scale. Alejandro Gómez-Boix; Pierre Laperdrix; Benoit Baudry. WWW2018 - TheWebConf2018: 27th International World Wide Web Conference. April 2018. URL: https://inria.hal.science/hal-01718234v2[html]HTML Standard. Anne van Kesteren; Domenic Denicola; Dominic Farolino; Ian Hickson; Philip Jägenstedt; Simon Pieters. WHATWG. Living Standard. URL: https://html.spec.whatwg.org/multipage/[LEAKING-BATTERY]The leaking battery: A privacy analysis of the HTML5 Battery Status API. Łukasz Olejnik; Gunes Acar; Claude Castelluccia; Claudia Diaz. 2015. URL: https://eprint.iacr.org/2015/616.pdf[mediacapture-streams]Media Capture and Streams. Cullen Jennings; Bernard Aboba; Jan-Ivar Bruaroey; Henrik Boström; youenn fablet. W3C. 19 December 2024. CRD. URL: https://www.w3.org/TR/mediacapture-streams/[NDSS-FINGERPRINTING]Host Fingerprinting and Tracking on the Web: Privacy and Security Implications. Ting-Fang Yen; Yinglian Xie; Fang Yu; Roger Peng Yu; Martin Abadi. In Proceedings of the Network and Distributed System Security Symposium (NDSS). February 2012. URL: https://www.microsoft.com/en-us/research/publication/host-fingerprinting-and-tracking-on-the-webprivacy-and-security-implications/[PROXIMITY]Proximity Sensor. Anssi Kostiainen; Rijubrata Bhaumik. W3C. 12 February 2025. W3C Working Draft. URL: https://www.w3.org/TR/proximity/[RFC6265]HTTP State Management Mechanism. A. Barth. IETF. April 2011. Proposed Standard. URL: https://httpwg.org/specs/rfc6265.html[RFC6454]The Web Origin Concept. A. Barth. IETF. December 2011. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc6454[RFC6973]Privacy Considerations for Internet Protocols. A. Cooper; H. Tschofenig; B. Aboba; J. Peterson; J. Morris; M. Hansen; R. Smith. IETF. July 2013. Informational. URL: https://www.rfc-editor.org/rfc/rfc6973[RFC9110]HTTP Semantics. R. Fielding, Ed.; M. Nottingham, Ed.; J. Reschke, Ed. IETF. June 2022. Internet Standard. URL: https://httpwg.org/specs/rfc9110.html[security-privacy-questionnaire]Self-Review Questionnaire: Security and Privacy. Theresa O'Connor; Peter Snyder; Simone Onofri. W3C. 12 February 2025. W3C Working Group Note. URL: https://www.w3.org/TR/security-privacy-questionnaire/[TAG-MINIMIZATION]Data Minimization in Web APIs. Daniel Appelquist. W3C Technical Architecture Group. 12 September 2011. URL: https://www.w3.org/2001/tag/doc/APIMinimization[TAG-UNSANCTIONED]Unsanctioned Web Tracking. Mark Nottingham. W3C Technical Architecture Group. 17 July 2015. URL: https://w3ctag.github.io/unsanctioned-tracking/[TOR-DESIGN]The Design and Implementation of the Tor Browser. Mike Perry; Erinn Clark; Steven Murdoch; Georg Koppen. 15 June 2018. URL: https://spec.torproject.org/torbrowser-design[TRACKING-COMPLIANCE]Tracking Compliance and Scope. Nick Doty; Heather West; Justin Brookman; Sean Harvey; Erica Newland. W3C. 22 January 2019. W3C Working Group Note. URL: https://www.w3.org/TR/tracking-compliance/[TRACKING-DNT]Tracking Preference Expression (DNT). Roy Fielding; David Singer. W3C. 17 January 2019. W3C Working Group Note. URL: https://www.w3.org/TR/tracking-dnt/[WPM-MILLION]Online tracking: A 1-million-site measurement and analysis. Steven Englehardt; Arvind Narayanan. May 2016. URL: https://webtransparency.cs.princeton.edu/webcensus/