Closed Bug 1527534 (CVE-2019-9798) Opened 6 years ago Closed 6 years ago

On Android, Gecko always tries to load a library from an all-user-writable path APITRACE_LIB

Categories

(Core :: Graphics, defect, P1)

Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox-esr60 --- unaffected
firefox65 --- wontfix
firefox66 + fixed
firefox67 + fixed

People

(Reporter: jgilbert, Assigned: jgilbert)

Details

(Keywords: csectype-priv-escalation, sec-high, Whiteboard: gfx-noted[post-critsmash-triage][adv-main66+])

Attachments

(1 file)

https://searchfox.org/mozilla-central/rev/cb7faaf6b4ad2528390186f1ce64618dea71031e/gfx/gl/GLLibraryEGL.h#21

#ifdef ANDROID
// We only need to explicitly dlopen egltrace
// on android as we can use LD_PRELOAD or other tricks
// on other platforms. We look for it in /data/local
// as that's writeable by all users
//
// This should really go in GLLibraryEGL.cpp but we currently reference
// APITRACE_LIB in GLContextProviderEGL.cpp. Further refactoring
// will come in subsequent patches on Bug 732865
#  define APITRACE_LIB "/data/local/tmp/egltrace.so"
#endif

We should not be loading libraries from locations that other apps can write to. It sounds like might be the case here.

This should be opt-in, maybe by pref.

sec-high because it'd be pretty easy for a malicious app (evidence of their existence abounds) to completely MITM anything you do in your browser.

Comment on attachment 9045094 [details]
Bug 1527534 - Reuse LoadApitraceLibrary.

Security Approval Request

How easily could an exploit be constructed based on the patch?

Difficult. You have to realize that GLContext's loading of the APITRACE library isn't restricted by the pref, /and also/ have control of a malicious installed app to write a malicious hook library to that location.

Otherwise, this mostly looks like a quality-of-life refactor.

Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?

No

Which older supported branches are affected by this flaw?

all

If not all supported branches, which bug introduced the flaw?

None

Do you have backports for the affected branches?

No

If not, how different, hard to create, and risky will they be?

Trivial

How likely is this patch to cause regressions; how much testing does it need?

Unlikely to regress if tests pass.

Attachment #9045094 - Flags: sec-approval?

Comment on attachment 9045094 [details]
Bug 1527534 - Reuse LoadApitraceLibrary.

Sec-approval+. Can we get a beta and ESR60 patch as well?

Attachment #9045094 - Flags: sec-approval? → sec-approval+

ESR60 is unaffected because we don't ship ESR on Android.

Applies cleanly to Beta.

Oops, it might not apply cleanly to central once bug 1528396 lands.

What's the landing schedule?

Flags: needinfo?(abillings)

(In reply to Jeff Gilbert [:jgilbert] from comment #8)

What's the landing schedule?

Land whenever it is ready at this point.

Flags: needinfo?(abillings)

Comment on attachment 9045094 [details]
Bug 1527534 - Reuse LoadApitraceLibrary.

Beta/Release Uplift Approval Request

Feature/Bug causing the regression

None

User impact if declined

sec-high

Is this code covered by automated tests?

Yes

Has the fix been verified in Nightly?

No

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)

Any breakage will be really obvious on CI.

String changes made/needed

none

Attachment #9045094 - Flags: approval-mozilla-beta?
Group: gfx-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

Comment on attachment 9045094 [details]
Bug 1527534 - Reuse LoadApitraceLibrary.

Protect against possible exploit, let's take this for beta 11.

Attachment #9045094 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify-
Whiteboard: gfx-noted → gfx-noted[post-critsmash-triage]
Whiteboard: gfx-noted[post-critsmash-triage] → gfx-noted[post-critsmash-triage][adv-main66+]
Alias: CVE-2019-9798
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: