Any websites can run with PWA privileges on Fenix (bypassing fix of Bug 1657026)
Categories
(Fenix :: General, defect)
Tracking
(firefox84 wontfix, firefox85 wontfix, firefox86 fixed)
People
(Reporter: sdna.muneaki.nishimura, Assigned: sebastian)
References
Details
(Keywords: csectype-other, reporter-external, sec-moderate, Whiteboard: [reporter-external] [client-bounty-form] [verif?][post-critsmash-triage][adv-main86+])
Attachments
(1 file)
549 bytes,
text/plain
|
Details |
Bug 1657026 can still be reproduced on the latest Fenix Nightly (retested it today).
As a countermeasure of Bug 1657026, a function isUnderFennecManifestDirectory
was introduced for verifying given manifest directory is under <filesDir>/mozilla/<profile>/manifests/ (see below).
https://github.com/mozilla-mobile/fenix/blob/faf765a57d78be91deed9ed9ef54d24f31075192/app/src/main/java/org/mozilla/fenix/customtabs/FennecWebAppIntentProcessor.kt#L130
But the verification logic seems incorrect.
Here, if an attacker gives wrong manifest path such as /data/local/tmp/dummy_manifest.json
, manifestsDir.name != "manifests"
returns true
, but true
means that given manifest path is under the expected directory.
return manifestsDir == null || manifestsDir.name != "manifests" ||
// Check that the folder two levels up is named "mozilla"
manifestsDir.parentFile?.parentFile != getMozillaDirectory()
It seems this comparison part should be changed like below.
return manifestsDir == null || (manifestsDir.name == "manifests" &&
// Check that the folder two levels up is named "mozilla"
manifestsDir.parentFile?.parentFile == getMozillaDirectory())
Sorry for the delay in discovering the mistake.
Comment 1•4 years ago
|
||
Sebastian, can you take a look when you're back? Thanks!
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
I'll take a look.
Assignee | ||
Comment 3•4 years ago
|
||
Assignee | ||
Comment 4•4 years ago
|
||
Patch landed in Fenix Nightly and should go out with the 86 train.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 5•4 years ago
|
||
Updated•4 years ago
|
Updated•3 years ago
|
Updated•2 years ago
|
Updated•9 months ago
|
Description
•