You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[privacy] Exposing data to an origin: fingerprinting #1457
Does this specification expose any other data to an origin that it
doesn’t currently have access to?
Yes. When giving various information on available AudioNodes, the Web
Audio API potentially exposes information on characteristic features
of the client (such as audio hardware sample-rate) to any page that
makes use of the AudioNode interface. Additionally, timing information
can be collected through the AnalyserNode or ScriptProcessorNode
interface. The information could subsequently be used to create a
fingerprint of the client.
If a UA wanted to report generic information for a user, effectively
lying about audio hardware sample-rate and the rest) so that every
user presented the same data to prevent fingerprinting - are you able
to recommend sensible defaults in the draft? Or what a UA should
consider when choosing sensible defaults?
Apart from some high-end outliers (192k/24bit for example) the majority of uses are as @rtoy says going to be the CD rate of 44100 or the DAT rate of 48000, even if the actual hardware can go higher (96000 commonly) it is typically set to one of those two in practice.
The additional fingerprinting surface area is thus non-zero, but small.
Speaking not as chair, there are so few sample rates in use out there that it is hard to see how sampleRate can be useful.
As far as timing information goes, isn't it the case that any CPU intensive task in JS yields fingerprintable results? To what extent do these add fingerprinting exposure to what exists already?
As far as timing information goes, isn't it the case that any CPU intensive task in JS yields fingerprintable results? To what extent do these add fingerprinting exposure to what exists already?
They can, certainly, but efforts in reducing the resolution of timers and jittering them have made those efforts less effective.
UAs could certainly have a mode where the sample-rate is forced to either 44.1kHz or 48kHz. Additionally, AudioDestinationNode.maxChannelCount could be also constrained to always return 2 (stereo, which is certainly the immense majority of setups).
This would not really reduce the usefulness of the API by much and reduce the exposed entropy by a bit. Additionally, it is trivial to implement.
Does any implementer has statistics on which sample-rate is the more common? It probably does not matter in practice as long as it's one of those two.
Chrome has statistics on the sample rates. I'm not sure I can share exact numbers, but suffice to say that over 95% of all systems use either 44.1 kHz or 48 kHz. However, there is a huge variety of rates. And we know some people use 192 kHz because people filed issues about Chrome not working at that rate.
I agree that stereo is by far the most common (sadly, looks like we have no statistics on that), I think there are people who do want to support 5.1 audio systems. I'm reluctant to set maxChannelCount to 2; we should allow at least up to 6.
Just a clarification, this is not intended to be the normal settings for a normal UA.
A specific UA, or a setting in an existing UA would result in having, say, always stereo output and 44.1kHz sample-rate, allowing users willing to sacrifice some feature for some increased privacy to do so.
For example, going to about:config in Firefox and toggling privacy.resistFingerprinting will change a bunch of APIs, but it's not the default configuration.
Reacted by Chris Lilley, Brad Isbell and Chris Wilson
Does this specification allow an origin access to aspects of a user’s local computing environment?
Not directly; all requested sample rates are supported, with upsampling if needed. It is possible to use Media Capture and Streams to probe for supported audio sample rates with MediaTrackSupportedConstraints. This requires explicit user consent. This does provide a small measure of fingerprinting. However, in practice most consumer and prosumer devices use one of two standardized sample rates: 44.1kHz (originally used by CD) and 48kHz (originally used by DAT). Highly resource constrained devices may support the speech-quality 11kHz sample rate, and higher-end devices often support 88.2, 96, or even the audiophile 192kHz rate.
Requiring all implementations to upsample to a single, commonly-supported rate such as 48kHz would increase CPU cost for no particular benefit, and requiring higher-end devices to use a lower rate would merely result in Web Audio being labelled as unsuitable for professional use. https://webaudio.github.io/web-audio-api/#priv-sec
Generating an error for unsupported rates enables further fingerprinting. You'd know the user doesn't have this sample rate. By silently resampling, you can't tell if the user has that rate or not. It just works.
"what precisely happens" - see previous post: any time a sample rate that is not natively supported is selected, the AudioContext is still created at the requested rate, and resampling will occur between that AudioContext and the actual audio device. This isn't observable from the API.
The stipulation I was making is that if a sample rate that is not 44.1k or 48k is requested (e.g. 96kHz), and that rate IS natively supported by the hardware, the system will send the AudioContext output to the output (rather than creating it at 96kHz, downsampling to 48kHz and then upsampling back to 96kHz). This will enable higher bit rates without quality or performance loss, while not leaking fingerprintable bits (this isn't observable since you can't get access to those bits (the actual bits sent out from the device), and you'd have to use user-prompt-protected browsing of the media devices to know that it's available).
Activity
rtoy commentedon Nov 30, 2017
For the sample rate, typical values would be 44100 or 48000. These are all common values in use.
svgeesus commentedon Dec 14, 2017
Apart from some high-end outliers (192k/24bit for example) the majority of uses are as @rtoy says going to be the CD rate of 44100 or the DAT rate of 48000, even if the actual hardware can go higher (96000 commonly) it is typically set to one of those two in practice.
The additional fingerprinting surface area is thus non-zero, but small.
joeberkovitz commentedon Dec 14, 2017
Speaking not as chair, there are so few sample rates in use out there that it is hard to see how
sampleRatecan be useful.As far as timing information goes, isn't it the case that any CPU intensive task in JS yields fingerprintable results? To what extent do these add fingerprinting exposure to what exists already?
mdjp commentedon Jan 11, 2018
Waiting for response from security and privacy review.
tomrittervg commentedon Feb 6, 2018
They can, certainly, but efforts in reducing the resolution of timers and jittering them have made those efforts less effective.
padenot commentedon Feb 6, 2018
UAs could certainly have a mode where the sample-rate is forced to either 44.1kHz or 48kHz. Additionally,
AudioDestinationNode.maxChannelCountcould be also constrained to always return2(stereo, which is certainly the immense majority of setups).This would not really reduce the usefulness of the API by much and reduce the exposed entropy by a bit. Additionally, it is trivial to implement.
Does any implementer has statistics on which sample-rate is the more common? It probably does not matter in practice as long as it's one of those two.
rtoy commentedon Feb 6, 2018
Chrome has statistics on the sample rates. I'm not sure I can share exact numbers, but suffice to say that over 95% of all systems use either 44.1 kHz or 48 kHz. However, there is a huge variety of rates. And we know some people use 192 kHz because people filed issues about Chrome not working at that rate.
I agree that stereo is by far the most common (sadly, looks like we have no statistics on that), I think there are people who do want to support 5.1 audio systems. I'm reluctant to set maxChannelCount to 2; we should allow at least up to 6.
padenot commentedon Feb 6, 2018
Just a clarification, this is not intended to be the normal settings for a normal UA.
A specific UA, or a setting in an existing UA would result in having, say, always stereo output and 44.1kHz sample-rate, allowing users willing to sacrifice some feature for some increased privacy to do so.
For example, going to
about:configin Firefox and togglingprivacy.resistFingerprintingwill change a bunch of APIs, but it's not the default configuration.svgeesus commentedon Mar 26, 2018
The spec now says:
svgeesus commentedon Mar 27, 2018
Pinged commentor here
https://lists.w3.org/Archives/Public/public-privacy/2018JanMar/0027.html
svgeesus commentedon Apr 26, 2018
Response at
https://lists.w3.org/Archives/Public/public-privacy/2018JanMar/0028.html
36 remaining items
samuelweiler commentedon Jun 26, 2020
Explain more? What, precisely, happens?
rtoy commentedon Jun 26, 2020
Generating an error for unsupported rates enables further fingerprinting. You'd know the user doesn't have this sample rate. By silently resampling, you can't tell if the user has that rate or not. It just works.
cwilso commentedon Jun 26, 2020
"what precisely happens" - see previous post: any time a sample rate that is not natively supported is selected, the AudioContext is still created at the requested rate, and resampling will occur between that AudioContext and the actual audio device. This isn't observable from the API.
The stipulation I was making is that if a sample rate that is not 44.1k or 48k is requested (e.g. 96kHz), and that rate IS natively supported by the hardware, the system will send the AudioContext output to the output (rather than creating it at 96kHz, downsampling to 48kHz and then upsampling back to 96kHz). This will enable higher bit rates without quality or performance loss, while not leaking fingerprintable bits (this isn't observable since you can't get access to those bits (the actual bits sent out from the device), and you'd have to use user-prompt-protected browsing of the media devices to know that it's available).
samuelweiler commentedon Jul 2, 2020
Sounds good to me.
rtoy commentedon Jul 14, 2020
So, the conclusion is that the comments in #1457 (comment) are what we want to say and do in the spec. More or less.
rtoy commentedon Jul 16, 2020
Sounds like a plan.
Fix WebAudio#1457: Privacy for sample rates
samuelweiler commentedon Mar 18, 2021
@svgeesus Manipulating the flags on this issue won't work. I'll close the tracking issue.
svgeesus commentedon Sep 16, 2024
@tjwhalen Sam said he would close the tracking issue but did not. To tidy up, would you mind doing so?
Fix WebAudio#1457: Privacy for sample rates (WebAudio#2223)