Spoofing via filename download (firefox android)
Categories
(Firefox for Android :: Downloads, defect, P3)
Tracking
()
People
(Reporter: sas.kunz, Assigned: rsainani)
References
Details
(Keywords: csectype-spoof, reporter-external, sec-moderate, Whiteboard: [fixed in bug 1873528][client-bounty-form])
Attachments
(4 files)
I found vulnerability via filename donwload using \n or \r . lead to spoof filename
step to produce:
- open http://103.186.0.20/downloadspoof.html or downloadspoof.html
- click "open" button
impact : victim can be spoofed will think that it is a document file and even though it is an apk file
using filename : "fakeapk.doc\r\r\n\n\n\rhacked\n\rlink\rdownload\r:\rattacker.com\n.apk"
Updated•2 years ago
|
Comment 4•2 years ago
|
||
The severity field is not set for this bug.
:mavduevskiy, could you have a look please?
For more information, please visit BugBot documentation.
Updated•2 years ago
|
Comment 5•2 years ago
|
||
Thanks for reporting this bug! It looks like were are displaying the file name exactly the way it is.
There are a few paths that we could take. Firefox desktop replaces special characters with a single space, while Android Chrome with the underscore. I would actually vote for underscore in this case, as files names with empty spacing in the name often leads to unexpected problems – though generally Linux is capable of handling those.
It might also be a good idea to ask the UX team to take a look into this.
Comment 6•2 years ago
|
||
The severity field is not set for this bug.
:mavduevskiy, could you have a look please?
For more information, please visit BugBot documentation.
Comment 7•2 years ago
|
||
Firefox Desktop uses spaces, but it's careful to make sure the filename is shown on one line. It doesn't linebreak on those spaces, and formats the dialog to clearly distinguish between the part that is the filename and the part that comes from Firefox. With the simple Android panel (visually more appealing than the desktop one) you can see there's lots of room for an attacker to add text that might look like explanation "from Firefox" to further the spoof. We need to coalesce whitespace to prevent that. [On desktop they have to be careful to show the end of the filename in case the single-line filename is "too long": they truncate the front of the filename.]
Can we simply not, though? No download for you, you malicious bastard! Do we have a fallback if the download attribute isn't given at all, or is entirely invalid characters? If so, would that work? For an https link we try to use the filename in the URL, but that doesn't apply here with a data: url. Sadly we can't be that strict: a site might use a valid character on their tested platform that happens to be invalid on Android, but we shouldn't punish Firefox users for the site's problems.
Comment 8•2 years ago
|
||
Bug 1822968 is a completely different issue, but coordinate work so we don't stomp on the dialog changes
Comment 9•2 years ago
|
||
If android coalesces whitespaces, it will cause linebreak given how limited screen width is available for a phone. I do believe that going with coalesced underscore is a safer bet.
If the name is not provided, Fenix will use to come up with a based on url file name, with a fallback 'downloadfile'
We don't truncate really long file-names though, we display some lines and the rest of context is scrollable. Maybe it's also something we should look into.
I don't think we could manipulate heavily (like denying) with logic depending on the naming, but some form of sanitizing is definitely needed.
There is another bug related to not sanitized names – 1815613. A good sanitizing function would kill two birds, but the usecase is different and I won't mark it as duplicate.
I wonder what's inside the bug? I don't have access
Updated•2 years ago
|
Updated•2 years ago
|
Reporter | ||
Comment 10•1 year ago
|
||
Hello any updates?
Comment hidden (duplicate) |
Updated•1 year ago
|
Reporter | ||
Comment 12•1 year ago
|
||
I tried it on the latest Firefox Nightly and I can't reproduce it. The file name if there is a space has been changed to "_" have you fixed it?
Comment 14•1 year ago
|
||
It appears this was fixed in bug 1873528 (patch https://hg.mozilla.org/mozilla-central/rev/38e15afaa78d) by folks who likely couldn't see this bug.
If that hadn't been fixed first, the fix for bug 1815613 (filed earlier, but fixed later) may have led to blocking the control characters too. Or maybe it would not have.
The description of a spoofing attack here is different from what the developers thought they were fixing in that other bug. Therefore I'm going to close this one as "FIXED" depending on that other bug rather than make it a duplicate merely because the fix was the same. That will work better for judging this for the bug bounty.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•5 months ago
|
Description
•