News for hackers. Stuff that matters.
Re:Audio Fingerprinting using the AudioContext API by sriku on Sunday November 03, 2019 @05:26PM (#21437156)
I think this is mistaken. The device API supposedly provides this, but the info you get is always generic due to fingerprinting protection. Also, AudioContext is expected to be active only when created within a user action like a button click. Otherwise it doesn't run (implemented in Safari).

This is a pain - on the one hand, the browser vendors and w3c are locking down API capabilities to prevent fingerprinting and timing based security hacks, but these are interfering with genuine needs to provide audio functionality. For example, you can't determine whether the user has 3 audio devices connected and prompt them to select one for output. So you really can't build desktop quality audio systems with webaudio and siblings.

Re:Audio Fingerprinting using the AudioContext API by danShumway on Sunday November 03, 2019 @05:48PM (#21437287)
> Also, AudioContext is expected to be active only when created within a user action like a button click.

I really hate the user-action restriction as a security measure, because it's ridiculously easy to bypass[0], particularly on Chrome. It's privacy theater -- annoying for legitimate developers, but easy for malicious actors to get around.

Putting this stuff behind a permission or sandboxing it somehow would be better for both end-users and developers. As it stands, we just get fewer webaudio applications online from legitimate developers, and they all move to native platforms where it's even easier to fingerprint users. And the malicious sites that don't move to native just fingerprint anyway because we're using bad, opaque metrics for consent.

[0]: https://danshumway.com/blog/chrome-autoplay/demo/

Re:Audio Fingerprinting using the AudioContext API by Mirioron on Sunday November 03, 2019 @07:54PM (#21438010)
>For example, you can't determine whether the user has 3 audio devices connected and prompt them to select one for output.

Frankly, this really should be handled by the browser. JavaScript really shouldn't have any business messing with that.

Re:Audio Fingerprinting using the AudioContext API by zaroth on Sunday November 03, 2019 @08:56PM (#21438331)
I have no problem with sites being able to do this, after I’ve given them permission to access the audio stack in the first place, and limited to first-party scripts on the page.
Re:Audio Fingerprinting using the AudioContext API by sriku on Sunday November 03, 2019 @08:49PM (#21438301)
That's reasonable for just output selection. So shouldnt be able to send audio to all the devices? .. and different audio streams? .. which is all commonplace in the desktop world.
Re:Audio Fingerprinting using the AudioContext API by Mirioron on Monday November 04, 2019 @02:26AM (#21439597)
Sure, but the browser should handle that logic. Even if the website prompts a user to select an audio device it should be handled on the browser's side without feedback to the website.
Re:Audio Fingerprinting using the AudioContext API by throwaway40324 on Monday November 04, 2019 @11:00PM (#21449481)
It's been a little while since I used this, but navigator.mediaDevices.enumerateDevices

will give you that list, allowing you to have a menu for a user to choose one and then the client code must use setSinkId to assign the chosen device id. https://developer.mozilla.org/en-US/docs

Re:Audio Fingerprinting using the AudioContext API by sriku on Monday November 04, 2019 @11:55PM (#21449736)
The IDs you get (both deviceID and groupID) are not user displayable. They're like random numbers. In normal browsing mode, you keep getting the same deviceIDs for the same domain, but random groupIDs for every refresh. You get different deviceIDs for different sites. In private browsing mode, you get both random every time.
Re:Audio Fingerprinting using the AudioContext API by throwaway40324 on Tuesday November 05, 2019 @12:09AM (#21449808)
Ah, I forgot that the device label is only returned when there is an active stream. And has zero support in Safari. https://developer.mozilla.org/en-US/docs/Web/API/MediaDevice...

I never knew the device ids were randomized like that, thanks for the info.

Re:Audio Fingerprinting using the AudioContext API by liability on Monday November 04, 2019 @03:12AM (#21439787)
> So you really can't build desktop quality audio systems with webaudio and siblings.

Nor should anybody even be trying. We're better off without any of this sort of horseshit.