Skip to main content
MediumContent

How to fix: Camera or Microphone API Referenced

The page references the getUserMedia/mediaDevices camera-or-microphone API. This check only detects the API reference; it does not verify whether the call is gated behind an explicit user action (e.g. a click handler) or fires automatically on load.

Why it matters

If genuinely ungated (called automatically rather than in response to a user action), users may not understand that recording has begun, a significant privacy violation. Manually confirm the call site before treating this as a gesture-gating issue.

Camera and microphone access must be requested in response to explicit user action with a clear UI indicator showing when recording is active.

How to fix it

  1. 1Show a clear recording indicator when camera/mic is active
  2. 2Stop tracks immediately when the user closes the feature
  3. 3Only request access in response to an explicit user action

Code examples

Request media access on explicit user action

JavaScript
// Request only the permissions you need
const stream = await navigator.mediaDevices.getUserMedia({
  video: true,  // false if audio-only
  audio: false, // false if video-only
});

// Always stop tracks when done
stream.getTracks().forEach(track => track.stop());

References

Detected automatically by VulnRadar. The check id is webcam-microphone-access, stable across every scan so you can filter or diff on it.

See every content check

Questions

How severe is Camera or Microphone API Referenced?
VulnRadar rates this medium severity in the content category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id webcam-microphone-access, which stays the same between runs so you can filter, diff, or gate CI on it.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for camera or microphone api referenced

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: Camera or Microphone API Referenced | VulnRadar