Media Capabilities Check - Devices and Codecs

doc

Inspect camera and microphone access, device enumeration, and codec support to diagnose media failures and reduce fingerprint exposure from media device APIs.

Media APIs sit at the seam between the browser and the physical device. They can tell a page what cameras and microphones exist, how the audio pipeline behaves, and — historically — which local network addresses the machine has. Every one of those is legitimate functionality, and every one has been used as a fingerprint.

Surfaces a media check touches

SurfaceWhat it can revealGate
Device enumerationCount and kind of cameras, microphones, speakersDevice labels require permission; counts do not
Audio contextSample rate, channel count, processing latency, oscillator outputNone; runs without a prompt
Codec supportWhich media formats the build can decodeNone; a query only
WebRTC ICE candidatesLocal and public addresses, network topologymDNS obfuscation by default in current browsers
Playback capabilityHardware decoding present, DRM supportedNone, or a prompt for protected content

The audio context row is the one most people miss. It is a signal-processing pipeline that is deterministic on a given machine and different across machines, and it needs no permission at all.

Device counts without permission

A page can ask how many cameras and microphones exist before any prompt is shown. It cannot learn their labels or use them. This produces a small but real signal: a laptop with two cameras and a phone with three microphones look different, and the counts are free.

Two caveats:

  • Counts are coarse. Most machines have one of each, so the signal is weak in the common case.
  • Virtual devices inflate counts. Conferencing software and virtual cameras add entries that do not correspond to hardware, which makes the count both less reliable and more distinctive.

Audio fingerprinting, plainly

The audio pipeline is a chain: oscillator, filter, compressor, destination, then read back as samples. Each stage is implemented in the browser, and small numerical differences accumulate. The result is a value that repeats exactly on the same machine and differs on another.

Properties of this signal:

  1. No permission required. It runs silently, in a fraction of a second.
  2. Deterministic. Repeat runs produce the same bytes; there is no noise to average away.
  3. Survives cookie clearing and private mode. It reads hardware and software behaviour, not stored state.
  4. Changes with audio stack updates. A driver or OS update moves the value, so it is stable over months, not years.

Noise injection is the usual countermeasure, and it has the same weakness as canvas noise: averaging across samples recovers the underlying value.

WebRTC and local addresses

WebRTC was the classic local-IP leak. A page could gather ICE candidates and read private addresses such as 192.168.x.x, revealing network topology. Current browsers changed the default: host candidates are replaced with mDNS names that cannot be resolved off-link, so the private address is no longer directly readable.

  • Public addresses can still appear. Server-reflexive candidates show the address the network presents, which is the same address any HTTP request would reveal.
  • The leak is not fully closed. Some configurations and older browsers still expose host candidates. A check that reports local addresses is measuring that specific behaviour.
  • The fix is policy, not luck. Browsers expose controls to restrict ICE candidate gathering; enterprise policy can disable it entirely.

Reading a media report

  • Counts without labels mean what they say. The page saw how many devices exist. It did not see which ones.
  • An audio hash is a machine property. It identifies an audio stack, which many machines share.
  • A local address in the output is a real finding. It means the browser released a host candidate, which is worth checking against your browser version and policy.
  • Codec lists are build information. They describe what the browser was compiled to support, not the user.

Common misreads

  • "It saw my microphone, so it recorded me." It counted devices. Recording requires an explicit prompt, and the indicator light is not optional.
  • "No local IP means WebRTC is safe." mDNS obfuscation limits one leak. Public addresses and other paths remain.
  • "An audio hash is random." It is a deterministic output of a fixed pipeline. It repeats exactly.
  • "Clearing cookies clears this." The audio value and device counts do not depend on stored state.

FAQ

Does device enumeration require permission?

Labels do. Counts do not, which is why a page can report that you have two cameras without asking.

Why does my browser show an mDNS name instead of my local IP?

Because current browsers replace host ICE candidates with unresolvable names by default, to close the historical leak.

Is the audio fingerprint stable?

Across runs on the same machine, yes. Across audio stack updates, it changes.

Can I stop audio fingerprinting?

Partially, through browser settings and extensions. Noise injection helps against naive sampling and not against averaging.