Skip to content

Commit

Permalink
Further improvements for fingerprinting mitigations
Browse files Browse the repository at this point in the history
  • Loading branch information
csagan5 committed Mar 25, 2018
1 parent 85a9737 commit 4029e88
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 24 Mar 2018 05:18:03 +0100
Subject: Canvas: disable toDataURL and toBlob
Subject: Canvas: fingerprinting mitigations

Disable toDataURL, toBlob, getImageData and webGL renderering info
---
.../Source/core/html/canvas/HTMLCanvasElement.cpp | 71 ----------------------
.../canvas/canvas2d/BaseRenderingContext2D.cpp | 2 +-
.../canvas/canvas2d/CanvasRenderingContext2D.cpp | 19 +-----
2 files changed, 1 insertion(+), 89 deletions(-)
.../modules/webgl/WebGLDebugRendererInfo.cpp | 4 +-
4 files changed, 4 insertions(+), 92 deletions(-)

diff --git a/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp
--- a/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp
Expand Down Expand Up @@ -102,6 +105,18 @@ diff --git a/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp b/
}

void HTMLCanvasElement::AddListener(CanvasDrawListener* listener) {
diff --git a/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp
--- a/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp
@@ -1541,7 +1541,7 @@ ImageData* BaseRenderingContext2D::getImageData(
String::Format("The source %s is 0.", sw ? "height" : "width"));
}

- if (exception_state.HadException())
+ //if (exception_state.HadException())
return nullptr;

if (sw < 0) {
diff --git a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp
--- a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp
Expand Down Expand Up @@ -131,6 +146,23 @@ diff --git a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingCo
}

void CanvasRenderingContext2D::DrawTextInternal(
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp b/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp
--- a/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp
@@ -37,11 +37,11 @@ WebGLExtensionName WebGLDebugRendererInfo::GetName() const {

WebGLDebugRendererInfo* WebGLDebugRendererInfo::Create(
WebGLRenderingContextBase* context) {
- return new WebGLDebugRendererInfo(context);
+ return nullptr;
}

bool WebGLDebugRendererInfo::Supported(WebGLRenderingContextBase*) {
- return true;
+ return false;
}

const char* WebGLDebugRendererInfo::ExtensionName() {
--
2.7.4

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 25 Mar 2018 21:49:37 +0200
Subject: AudioBuffer, AnalyserNode: fingerprinting mitigations via IDL

---
third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl | 8 ++++----
third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl
--- a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl
+++ b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl
@@ -42,10 +42,10 @@ interface AnalyserNode : AudioNode {

// Copies the current frequency data into the passed array.
// If the array has fewer elements than the frequencyBinCount, the excess elements will be dropped.
- void getFloatFrequencyData(Float32Array array);
- void getByteFrequencyData(Uint8Array array);
+ //void getFloatFrequencyData(Float32Array array);
+ //void getByteFrequencyData(Uint8Array array);

// Real-time waveform data
- void getFloatTimeDomainData(Float32Array array);
- void getByteTimeDomainData(Uint8Array array);
+ //void getFloatTimeDomainData(Float32Array array);
+ //void getByteTimeDomainData(Uint8Array array);
};
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl b/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl
--- a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl
+++ b/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl
@@ -38,7 +38,7 @@

// Channel access
readonly attribute unsigned long numberOfChannels;
- [RaisesException] Float32Array getChannelData(unsigned long channelIndex);
- [RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
+ //[RaisesException] Float32Array getChannelData(unsigned long channelIndex);
+ //[RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
[RaisesException] void copyToChannel(Float32Array source, long channelNumber, optional unsigned long startInChannel = 0);
};
--
2.7.4

0 comments on commit 4029e88

Please sign in to comment.