完美像素:HTML中的canvas指纹外文翻译资料

 2022-08-25 09:08

Pixel Perfect: Fingerprinting Canvas in HTML5

Browsers are becoming increasingly sophisticated application platforms, taking on more of the functionality tradition- ally provided by an operating system. Much of this increasing sophistication is driven by the HTML5 suite of specifications, which make provisions for a programmatic drawing surface (lt;canvasgt;), three-dimensional graphics (WebGL), a structured client-side datastore, geolocation services, the ability to manipulate browser history and the browser cache, audio and video playback, and more.

1. OVERVIEW

The natural way for browsers to implement such features is to draw on the host operating system and hardware. Using the GPU for 3D graphics (and even for 2D graphics com- positing1) provides substantial performance improvements, as well as battery savings on mobile devices. And using the operating systemrsquo;s font-rendering code for text means that browsers automatically display text in a way that is optimized for the display and consistent with the userrsquo;s ex- pectations.

This paper proceeds from the following simple observation: Tying the browser more closely to operating system functionality and system hardware means that websites have more access to these resources, and that browser behavior varies depending on the behavior of these resources. The first part of this observation has security implications: code- bases not designed to handle adversarial input can now be exposed to it. The second part of the observation, which we focus on, has privacy implications: different behavior can be used to distinguish systems, and thereby fingerprint the people using them.

We exhibit a new system fingerprint based on browser font and WebGL rendering. To obtain this fingerprint, a website renders text and WebGL scenes to a lt;canvasgt; element, then examines the pixels produced. Different systems produce different output, and therefore different fingerprints. Even very simple tests — such as rendering a single sentence in a widely distributed system font—produce surprising variation. The new fingerprint has several desirable properties:

It is consistent. In our experiments, we obtain pixel- identical results in independent trials from the same user. 


It is high-entropy. In 294 experiments on Amazonrsquo;s Mechanical Turk, we observed 116 unique fingerprint values, for a sample entropy of 5.73 bits. This is so even though the user population in our experiments exhibits little variation in browser and OS. 


It is orthogonal to other fingerprints. Our fingerprint measures graphics driver and GPU model, which is in- dependent of other possible fingerprints discussed be- low. 


It is transparent to the user. Our tests can be per- formed, offscreen, in a fraction of a second. There is no indication, visual or otherwise, that the userrsquo;s sys- tem is being fingerprinted. 


It is readily obtainable. Any website that runs Java- Script on the userrsquo;s browser can fingerprint its rendering behavior; no access is needed besides what is provided by the usual web attacker model. 
Our fingerprint can be used as a black box or as a white box. A website could render tests to a lt;canvasgt;, extract the resulting pixmap, then use a cryptographic hash to obtain a short, convenient fingerprint. Because the fingerprint is consistent, the pixmap (and therefore its hash) will be identical in multiple runs on one machine, but take on different values depending on hardware and software configuration. This is a black-box use of the fingerprint, since it extracts distinguishing entropy without being concerned with the implementation details.

Alternatively, a website could use a particular test pixmap as evidence that a user is running some particular configuration of browser, operating system, graphics driver, GPU, and, perhaps, display. To identify a user system, the site can compare the pixmap it produces against a labeled corpus, such as the corpus we obtained using Mechanical Turk. An intriguing possibility is that GPU quirks could be used to identify a pixmap without comparing against a corpus. However it is performed, such a white-box use of our fingerprint in this way reveals private information about usersrsquo; systems.4 It could also be used to target an attack more precisely, by identifying specific vulnerable system configurations. Trying to exploit only those systems that appear likely to be vulnerable could reduce the number of crashes caused by the attack, and therefore the likelihood that it is detected by the operating system vendor.

Fingerprints on the web have constructive and destructive uses [14]. A use is constructive if users benefit from being fingerprinted. For example, a bank could fingerprint a userrsquo;s machine, then require additional authentication for login at- tempts from systems whose fingerprint does not match. A use is destructive if users do not benefit from being tracked, or do not wish to be tracked. Users can attempt to avoid tracking by using their browsersrsquo;“private browsing”modes or the Tor anonymity service .

Users of Tor may be willing to endure a slower, less at- tractive browsing experience to avoid being tracked. (Note that, although Torbutton disables WebGL, it allows text rendering to a lt;canvasgt;, and is thus at present partly vulnerable to our fingerprint.) For mainstream browser users, however, the possibility of fingerprinting might be an un- avoidable consequence of browsersrsquo; closer ties to operating system functionality and system hardware.

The earliest mentions known to us of using differences in GPU rendering to fingerprint users are in 2010 discussions on the WebGL mailing list about whether the WebGL renderer information available to JavaScript should provide information about the GPU and driver. Steve Baker argued [4] that it is possible to identify a GPU without this information: “I bet

剩余内容已隐藏,支付完成后下载完整资料


附录X 译文

完美像素:HTML中的canvas指纹

浏览器正在成为越来越复杂的应用平台,具有传统上由操作系统提供的功能。许多这种越来越多的复杂性是由HTML5套件规范驱动的,它们为程序化绘图表面(lt;canvasgt;),三维图形(WebGL),结构化客户端数据存储区,地理位置服务,操纵浏览器历史和浏览器缓存,音频和视频播放的能力等等。

浏览器实现这些功能的自然方法是利用主机操作系统和硬件。 将GPU用于3D图形(甚至2D图形复合1)可提供显着的性能改进,以及移动设备上的电池节省。并且使用操作系统的文本字体显示代码意味着浏览器会自动以对显示进行优化的方式显示文本,并与用户的期望保持一致。

1.概况

本文从以下简单的观察结果出发:将浏览器更紧密地与操作系统功能和系统硬件结合在一起意味着网站可以更多地访问这些资源,并且浏览器行为根据这些资源的行为而有所不同。这个观察的第一部分具有安全隐患:现在不能处理对抗输入的代码库现在可以暴露给它.3我们关注的第二部分观察有隐私含义:可以使用不同的行为来区分系统,从而指纹使用它们的人。

我们展示了基于浏览器字体和WebGL渲染的新系统指纹。要获取此指纹,网站会将文本和WebGL场景呈现到lt;canvasgt;元素,然后检查生成的像素。不同的系统产生不同的输出,因此产生不同的指纹。即使非常简单的测试 - 例如在广泛分布的系统字体中渲染单个句子,会产生令人惊讶的变化。新指纹具有几个理想的特性:

bull;一致。在我们的实验中,我们在同一用户的独立试验中获得像素相同的结果。

bull;高熵。在亚马逊的Mechanical Turk的294个实验中,我们观察到116个独特的指纹值,样本熵为5.73位。 即使浏览器和操作系统中的用户数量差异不大,这一点也是如此。

bull;与其他指纹正交。我们的指纹测量图形驱动程序和GPU模型,这与下面讨论的其他可能的指纹无关。

bull;对用户来说是透明的。我们的测试可以在几秒钟内完成。没有指示,视觉或其他方式,用户的系统正在进行指纹识别。

很容易获得。任何在用户浏览器上运行Java Script的网站都可以对其进行指纹识别;除了通常的网络攻击者模型提供的内容之外,不需要访问。我们的指纹可以用作黑盒子或白盒子。网站可以对lt;canvasgt;进行测试,提取生成的pixmap,然后使用加密哈希来获取一个简短的便捷指纹。因为指纹是一致的,所以在一台机器上的多个运行中,pixmap(因此它的散列)将是标识的,但是取决于硬件和软件配置的不同值。这是指纹的黑箱使用,因为它提取了区分熵,而不涉及实现细节。

或者,网站可以使用特定的测试像素图作为用户运行某些特定配置的浏览器,操作系统,图形驱动程序,GPU以及可能显示的证据。为了识别用户系统,该站点可以将其生成的像素图与标记的文件进行比较,例如使用Mechanical Turk获得的语料库。一个有趣的可能性是,GPU怪癖可以用于识别像素图,而不与语料库进行比较。然而,这样做的白盒子使用这种方式可以显示关于用户系统的私人信息。它还可以通过识别特定的易受攻击的系统配置来更准确地针对攻击。试图仅利用似乎可能易受攻击的系统可能会减少由于攻击造成的崩溃次数,因此可能会降低操作系统供应商发现的可能性。

网络上的指纹具有建设性和破坏性的用途。如果用户受益于指纹,则使用是有建设性的。例如,银行可以指纹用户的机器,然后需要对指纹不匹配的系统的登录尝试进行额外的身份验证。如果用户不受益于追踪或不希望被跟踪,则使用是破坏性的。用户可以尝试通过使用浏览器的“私人浏览”模式或Tor匿名服务来避免跟踪。

Tor的用户可能愿意忍受更慢,更少的浏览体验,以避免被跟踪。(请注意,虽然Torbutton禁用WebGL,但是它允许文本呈现到lt;canvasgt;,因此目前对我们的指纹来说部分是容易的。)然而,对于主流浏览器用户,指纹识别的可能性可能是不可避免的,浏览器与操作系统功能和系统硬件的联系更紧密。

相关工作:网络上的指纹。

在我们对于GPU渲染使用差异的指纹用户最早提到的是2010年关于WebGL邮件列表的讨论,讨论WebGL渲染器对JavaScript可用的信息是否应该提供关于GPU和驱动程序的信息。史蒂夫·贝克(Steve Baker)认为可以识别出没有这个信息的GPU:“我敢打赌,如果我写了代码读回每一个glGet结果,并建立了一个结果的数据库,并写了代码,表现 - 然后我敢打赌,我可以准确地识别大多数硬件。“Benoit Jacob后来观察到

我们还没有开始计算GPU渲染分析(不仅仅是WebGL:在升级的浏览器中,大多数渲染都会通过GPU,并且受到基于GPU /驱动/配置的渲染差异的影响。

雅各布还提出了我们采用的指纹识别方法:“渲染分析可以通过将画面渲染到画布2D中并获取其ImageData来进行。”查看我们的研究的一种方法是通过实验证明,Baker和Jacob正确地预测GPU的实质性额外泄漏基于渲染。另外,我们显示从字体转换到lt;canvasgt;有大量的信息泄露。

许多其他研究人员提出了一些技术来优化网络用户。这些技术依赖于许多浏览器功能,包括历史和文件缓存,HTTP标头和可用插件中的信息,JavaScript和DOM API支持,JavaScript性能,可用字体,以及与JavaScript标准一致性的偏差。

2.HTML5和CSS3

在本节中,我们将介绍在我们的实验中使用的新兴Web技术。首先,我们提供关于lt;canvasgt;元素的信息,这是HTML55的主要部分,以及对文本渲染的支持。接下来,我们检查WebFonts,CSS3规范的一部分6。最后,我们简要讨论了目前由Khronos集团(也保持OpenGL规范)管理的WebGL实验规范7。

这三个规范尚未定稿,因此可能会改变有利于或阻碍指纹识别成功的方式。然而,我们的指纹机制使用这些平台的极其重要的特征,例如渲染文本和检查像素,确实会清除这些功能。

HTML5中最有趣的新元素之一,lt;canvasgt;提供了可以以编程方式绘制的屏幕区域。它得到了最新版本的Chrome,Firefox,Internet Explorer,Opera和Safari以及Mobile Safari和Android Browser的广泛支持。

绘制画布的基本方法很简单:获取图形上下文,并使用上下文的API来实现您的更改。在当前的HTML5规范中,唯一定义的上下文是“2d”。2d上下文提供了基本的绘制原语,如fillRect,lineTo和arc,以及更复杂的特征,例如,渐变曲线,色彩渐变,以及现有图像中的复制。

我们选择专注于2d文本中的文本支持。给定一个字体大小,系列和基线,2d上下文可以将任意文本字符串绘制到画布上。不执行包装; 2d的上下文将很快地直接从画布的边缘绘制文本。 最后,lt;canvasgt;支持CSS样的文本样式,允许任何字体和大小的组合。 有关如何呈现文本的示例,请参见图1。

为了使lt;canvasgt;成为有用的指纹,必须有一些方法来检查其行为。幸运的是,lt;canvasgt;使得它非常容易,提供了几种以像素精度检查数据的方法。

lt;script type =“text / javascript”gt;

var canvas = document.getElementById(“drawing”);

var context = canvas.getContext(“2d”);

context.font =“18pt Arial”;

context.textBaseline =“top”;

context.fillText(“Hello,user。”,2,2);

lt;/scriptgt;

首先,2d上下文提供了getImageData()方法。给定一个画布的矩形区域,该方法重新生成一个ImageData对象。包含在该对象中的是所请求区域中每个像素的RGBA值(作为整数)。

其次,canvas对象本身提供了一个toDataURL(type)方法。当通过“image/png”时,此方法返回由包含画布整个内容的PNG图像的Base64编码组成的数据网址。由于这是一个非常方便的画布级方法,我们使用这种方法在我们的实验中提取数据。在黑盒使用这些指纹的过程中,测试套件可以简单地对这些数据URL进行散列,从而消除了从每个客户端上传整个图像的需要。

值得注意的是,这些方法确实保留了相同的起始策略,如果在此画布上绘制了来自不同来源的图像,则它们将抛出SecurityError异常而不是返回像素数据。因此,我们的lt;canvasgt;指纹只能包含我们控制的图像资源。

CSS3中指定的WebFonts允许Web设计人员按需加载字体,而不是仅依赖每台客户机上安装的字体。 要包含一个字体,Web设计器将一个带有src属性的@font-face CSS规则插入到一个适当格式的字体中。然后,浏览器下载该字体并使其可在页面上使用。幸运的是,我们也可以在写入lt;canvasgt;时使用网络字体。

要包括WebFonts,我们依赖于由Google和Typekit共同开发的WebFont Loader8。使用此库,WebFonts只能通过使用Java脚本进行加载,并且可以为某些事件(例如字体变为可用或相反地,无法加载)建立回调。通过将渲染附加到成功的加载,我们保证在写入画布时使用正确的字体。

WebGL提供了一个JavaScript API,用于在lt;canvasgt;元素中渲染3D图形。在OpenGL ES 2.0之后,WebGL目前是草案规范,并在Chrome,Firefox和Opera中实现并启用,并且在Safari中实现但禁用。这些浏览器中的每一个都提供硬件加速实现,使用安装的图形硬件来渲染每个帧。为了减轻严重的不当行为和崩溃,所有这些浏览器使WebGL只能用于许可列表的一组显卡和驱动程序。

当前的WebGL实现通过单独的画布上下文来暴露它们的功能(这将直接命名为“webgl”)。WebGL API太复杂,无法在此详细描述,但在风格上类似于桌面OpenGL API。它提供了用OpenGL着色语言(GLSL)编写的Vertex和片段着色器,编译后直接在显卡上运行。WebGL还提供了OpenGL风格的图案,以及不同的照明原图。通过定制GLSL着色器可以实现更先进的技术,如镜面高光,凹凸贴图和透明度。

直接从网页编译并在图形卡上运行,允许任意数据在JavaScript执行引擎和内核级图形驱动程序之间传递。其他攻击表面是可能的:恶意或误导的GLSL着色器可能会在OSX和Windows XP上崩溃或挂起整个操作系统,或导致Windows 7上的GPU复位。

WebFonts虽然看起来更无辜,但也可能是一个安全问题。 解析TrueType字体时的远程代码执行漏洞已经在Windows,OSX,Debian,Red Hat和iOS中发现。

虽然我们在本文中不使用这些漏洞,但我们利用这些新技术,为了效率,将不受信任的Web内容推送到操作系统堆栈中。然而,在我们的例子中,我们只是检查这些操作的结果,揭示实现中的差异(不过很小)。

3. 测试

在本节中,我们将讨论基于我们的打印方案的测试,以及我们为提供测试和检查结果而建立的支持基础设施。我们还将详细介绍网络上大量不同用户的指纹采集过程。

对于我们的指纹,我们使用六个测试:text_arial,text- _arial_px,text_webfont,text_webfont_px,text_nonsense和webgl。每个测试遵循相同的基本概要:将测试数据渲染到画布,并将其内容解压缩为编码的PNG。

在我们的前两个测试中,我们在Arial中提供了一个简短的句子,这是一个以网络普遍存在的字体。为了锻炼每一个字母形状,我们使用了“多快跳跃的斑马斑马虎虎”的全文,还有一些标点符号。

对于text_arial,文本将在18pt Arial中呈现给画布。在text_arial_px中,我们将字体规格改为20px Arial。这两个测试的实际代码与图1中的代码片段几乎相同,复杂的测试不需要指纹识别!

这两个测试与Arial测试非常相似,增加了从Web服务器加载新字体的复杂性。在更复杂或有针对性的指纹中,可以通过手指打印机仔细调整发送的字体,以便在字体加载中运行角落。

在我们的例子中,我们使用WebFont Loader从Google Web Fonts server9加载“Sirin Stencil”。一旦加载,我们将提供与我们的Arial测试中相同的全集。对于text_webfont,文本设置在12pt Sirin Stencil中

在代码方面,这个测试与两个Arial测试几乎相同。然而,我们将2d字体规范设置为“甚至没有字体规格”,而不是有效的字体规范。这样会在浏览器中执行回退处理机制:对无效的字体请求有什么作用?浏览器的回退字体的选择,以及它的定位和间距可能是很有说服力的。

此外,请注意,这种行为也是当浏览器呈现不可用字体的有效字体规范时的后备字体处理机制。 使用这种技术,可以将测试写入探测目标机器上特定字体的存在。 如果运

剩余内容已隐藏,支付完成后下载完整资料


资料编号:[484067],资料为PDF文档或Word文档,PDF文档可免费转换为Word

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。