[tbb-commits] [tor-browser/tor-browser-91.6.0esr-11.5-1] Bug 30541: Disable WebGL readPixel() for web content

richard at torproject.org richard at torproject.org
Wed Feb 9 13:48:14 UTC 2022


commit f71d872319556a155ff420b00af1dbd9c01f9cfe
Author: Georg Koppen <gk at torproject.org>
Date:   Wed May 29 12:29:19 2019 +0000

    Bug 30541: Disable WebGL readPixel() for web content
---
 dom/canvas/ClientWebGLContext.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dom/canvas/ClientWebGLContext.cpp b/dom/canvas/ClientWebGLContext.cpp
index dfe2550d047d..c585c048fbb1 100644
--- a/dom/canvas/ClientWebGLContext.cpp
+++ b/dom/canvas/ClientWebGLContext.cpp
@@ -4641,6 +4641,14 @@ bool ClientWebGLContext::ReadPixels_SharedPrecheck(
     return false;
   }
 
+  // Security check passed, but don't let content readPixel calls through for
+  // now, if Resist Fingerprinting Mode is enabled.
+  if (nsContentUtils::ResistFingerprinting(aCallerType)) {
+    JsWarning("readPixels: Not allowed in Resist Fingerprinting Mode");
+    out_error.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
+    return false;
+  }
+
   return true;
 }
 





More information about the tbb-commits mailing list