Closed
Bug 1328325
Opened 9 years ago
Closed 9 years ago
JavaScript injection on FxA domain through firefox://?fxa scheme
Categories
(Firefox for iOS :: Firefox Accounts, defect)
Tracking
()
RESOLVED
FIXED
| Tracking | Status | |
|---|---|---|
| fxios | 6.0+ | --- |
People
(Reporter: sdna.muneaki.nishimura, Assigned: vbudhram)
Details
(5 keywords)
Attachments
(1 file)
|
96.76 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/602.3.12 (KHTML, like Gecko) Version/10.0.2 Safari/602.3.12
Steps to reproduce:
Open following URL with the latest Firefox for iOS.
firefox://?fxa=signin&email=test@example.jp');$('.email').val('JAVASCRIPT_INJECTED!!&access_code=12345
The above PoC can be tried from following link as well.
http://mallory.csrf.jp/ios/fxa.html
Actual results:
JavaScript code "$('.email').val('JAVASCRIPT_INJECTED!!')" is injected to Firefox Accounts login page through webView.evaluateJavaScript.
This bug has been introduced by Bug 1317580.
In the following commit, URL query parameter 'email' and 'access_code' are not properly escaped and finally it's used for constructing JavaScript code.
https://github.com/mozilla-mobile/firefox-ios/pull/2249/files#diff-7c8dce404b977a471215d06058caec4aR127
Expected results:
The format of 'email' and 'access_code' should be validated before constructing JavaScript code.
Updated•9 years ago
|
Flags: sec-bounty?
Comment 1•9 years ago
|
||
Web-accessible protocol handlers that are actually commands are terrible from a security POV. Do we want every page to be able to launch these? That's a separate question from the current issue of having an XSS into the FxA context when doing so.
Assignee: nobody → vbudhram
Comment 2•9 years ago
|
||
This sounds bad. I know we're supposed to be done with 6.0, but we should consider blocking release for this. Hopefully something we can address quickly?
tracking-fxios:
--- → 6.0+
Flags: needinfo?(sleroux)
Updated•9 years ago
|
Flags: sec-bounty? → sec-bounty+
Comment 3•9 years ago
|
||
Oops, looks like Farhan was actually the reviewer.
Flags: needinfo?(sleroux) → needinfo?(fpatel)
| Assignee | ||
Comment 4•9 years ago
|
||
Hey guys,
I was the writer of the PR and this was an oversight on my part. Email validation is done on the server and that was why I choose to not include it in FxiOS. Any objections for putting up a PR that validates emails and access codes before injecting?
Flags: needinfo?(sleroux)
Comment 5•9 years ago
|
||
> Any objections for putting up a PR that validates emails and access codes before injecting?
Nope - feel free to put up a PR and we can discuss the implementation there. As for using that patch as a resolution to this bug, since we were aiming to release 6.0 today and that would involve code changes + review, it might be best to resolve this with the Javascript escaping (if it's easy/trivial) or downlift the feature and push it to 7.0.
Flags: needinfo?(sleroux)
Comment 6•9 years ago
|
||
I think at this stage it's probably best to back out/disable this feature until we can address this.
Flags: needinfo?(fpatel)
Comment 7•9 years ago
|
||
(In reply to Farhan Patel from comment #6)
> I think at this stage it's probably best to back out/disable this feature
> until we can address this.
I agree. Lets put it behind a feature flag and do a rapid 6.1 release in which we can address this and a few other issues.
Comment 8•9 years ago
|
||
Added feature flag patch to original feature bug
https://bugzilla.mozilla.org/show_bug.cgi?id=1317580
Comment 9•9 years ago
|
||
When 6.1 is shipped and this is resolved as behind a pref, please resolve *this* bug (in our sec-critical queue) as "fixed."
Flags: needinfo?(vbudhram)
| Assignee | ||
Comment 10•9 years ago
|
||
Followed up with :sleroux and this was shipped in 6.0 and not 6.1. It is behind the pref. Marking as fixed.
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(vbudhram)
Resolution: --- → FIXED
Updated•9 years ago
|
Group: firefox-core-security → core-security-release
Updated•6 years ago
|
Group: core-security-release
Updated•5 years ago
|
Keywords: csectype-sandbox-escape
Updated•2 years ago
|
Keywords: reporter-external
You need to log in
before you can comment on or make changes to this bug.
Description
•