Closed Bug 1565374 (CVE-2019-11749) Opened 6 years ago Closed 6 years ago

Fingerprinting resistance against getUserMedia constraints doesn't work

Categories

(Core :: WebRTC: Audio/Video, defect)

69 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox-esr60 - wontfix
firefox-esr68 69+ fixed
firefox68 --- wontfix
firefox69 + fixed
firefox70 + fixed

People

(Reporter: pehrsons, Assigned: pehrsons)

Details

(Keywords: csectype-disclosure, privacy, sec-moderate, Whiteboard: [post-critsmash-triage][adv-main69+][adv-esr68.1+])

Attachments

(3 files)

Found through bug 1565317 really, which was caused by bug 1560907.
Prior to bug 1560907 code for reducing a set of constraints looked like this:

  // It looks like {audio: true}, do nothing.
  if (!aConstraint.IsMediaTrackConstraints()) {
    return;
  }

  // Keep mediaSource, ignore all other constraints.
  auto& c = aConstraint.GetAsMediaTrackConstraints();
  MOZ_DIAGNOSTIC_ASSERT(c.mMediaSource.WasPassed());
  nsString mediaSource = c.mMediaSource.Value();
  aConstraint.SetAsMediaTrackConstraints().mMediaSource.Construct(mediaSource);

But since aConstraint is already a MediaTrackConstraints, SetAsMediaTrackConstraints() does not Uninit and reset its values. The reduction is basically a no-op.

Thanks for catching this!

When we fix this, we should improve the test to catch this.

Two ways to test it:

  1. Compare track.getConstraints() against passed-in constraints
  2. Check for an impossible constraint (Thanks Andreas!) E.g. {video: {width: {min: 9999}}}

As a side-note: About (1) perhaps we shouldn't make it so easy to detect that fingerprinting anti-measures are present? But that's for a follow-up issue perhaps.

Depends on D37783

Andreas, what do you wanna do about the review in bug 1565317? My review comment is the Construct will fail because the value is already there, but I suspect you already know that. 😉

Flags: needinfo?(apehrson)

(In reply to Jan-Ivar Bruaroey [:jib] (needinfo? me) from comment #4)

Andreas, what do you wanna do about the review in bug 1565317? My review comment is the Construct will fail because the value is already there, but I suspect you already know that. 😉

Missed that actually. I'll just swap it to use Value() instead of Construct() so it can land. Otherwise the crash stays out there for longer.

Flags: needinfo?(apehrson)

Do we need sec review to land this? I'm not seeing a sec rating. I'd consider this sec-moderate fwiw.

Flags: needinfo?(dveditz)

https://wiki.mozilla.org/Security/Bug_Approval_Process

sec-moderate sounds appropriate (in which case you don't need sec-approval)

Group: core-security → media-core-security
Flags: needinfo?(dveditz)

Given that this is sec-moderate, I'm thinking we don't need to bother uplifting this to ESR60 given that it's nearing the end of its life cycle. That said, do we want this on Beta and ESR68? If so, please nominate :)

Comment on attachment 9077530 [details]
Bug 1565374 - Reset state. r?jib

Beta/Release Uplift Approval Request

  • User impact if declined: Scripts may use probing techniques (e.g. bug 1528056)—that don't incur a user prompt—on the getUserMedia API using constraints to reveal device properties of cameras on the system, adding bits to a fingerprint of the user's system, even on builds with privacy.resistFingerprinting=true.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Simple pref-only clearing of optional passed-in constraints argument.
  • String changes made/needed: None

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Are there ESR builds built with privacy.resistFingerprinting=true? If so, then this might be of importance to those builds.
  • User impact if declined: Same
  • Fix Landed on Version:
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Same
  • String or UUID changes made by this patch:
Flags: needinfo?(jib)
Attachment #9077530 - Flags: approval-mozilla-esr68?
Attachment #9077530 - Flags: approval-mozilla-beta?
Attachment #9077529 - Flags: approval-mozilla-beta?
Attachment #9077529 - Flags: approval-mozilla-esr68?

Comment on attachment 9077529 [details]
Bug 1565374 - Improve test. r?jib

Fixes a potential privacy leak via the getUserMedia API. Approved for 69.0b8 and 68.1esr (I'm sure our Tor friends will appreciate it since they set the privacy.resistFingerprinting pref).

Attachment #9077529 - Flags: approval-mozilla-esr68?
Attachment #9077529 - Flags: approval-mozilla-esr68+
Attachment #9077529 - Flags: approval-mozilla-beta?
Attachment #9077529 - Flags: approval-mozilla-beta+
Attachment #9077530 - Flags: approval-mozilla-esr68?
Attachment #9077530 - Flags: approval-mozilla-esr68+
Attachment #9077530 - Flags: approval-mozilla-beta?
Attachment #9077530 - Flags: approval-mozilla-beta+

Actually, this is going to need a rebased patch for uplift.

Attached patch backport.patchSplinter Review

Backport patch for Beta and ESR.

Flags: qe-verify-
Whiteboard: [post-critsmash-triage]
Alias: CVE-2019-11749
Whiteboard: [post-critsmash-triage] → [post-critsmash-triage][adv-main69+][adv-esr68.1+]
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: