Closed Bug 1704422 (CVE-2021-4221) Opened 4 years ago Closed 3 years ago

Address Bar Spoofing due to Arabic RTL characters

Categories

(Fenix :: Toolbar, defect)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rohansharma.rohan27, Assigned: petru)

References

Details

(Keywords: csectype-spoof, reporter-external, sec-moderate, Whiteboard: desktop version is bug 1704420[fixed in Fenix 92])

Attachments

(3 files, 1 obsolete file)

Attached file firefox-android-poc.html (obsolete) —

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

STEP 1: Click on "run" in attached file ("firefox-desktop-PoC.html")
The address bar will point to "www.mozilla.org", however the actual content is being delivered by "اختبار.اختبار"

The URL is not handled properly. Arabic characters in the domain name are being rendered from Right to Left(RTL) direction rather than Left to Right(LTR).

Actual results:

http://www.mozilla.org/hello/1/index.html/رابتخا.رابتخا

Expected results:

http://اختبار.اختبار/www.mozilla.org/hello/1/index.html
The address bar should point to "اختبار.اختبار" instead of "www.mozilla.org"

Attachment #9215018 - Attachment is obsolete: true
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(amoya)
See Also: → CVE-2023-37205
Whiteboard: desktop version is bug 1704420

The reporter has submitted this for bounty consideration

Flags: sec-bounty?

Hi, we have passed 60 days for this vulnerability report. Any updates?

Adding this to the team's current sprint to work on. Also refer to: https://mozilla-hub.atlassian.net/browse/FNXV2-17223

Flags: needinfo?(amoya)
Assignee: nobody → petru.lingurar

Seems like this is happening because of us removing the http(s) protocol for URLs displayed in the url bar here.

There “http ://اختبار.اختبار/www.mozilla.org/1” would become "اختبار.اختبار/www.mozilla.org/1" as expected but by default the arabic characters need to be read from right to left so that string will actually be displayed as “www.mozilla.org/1/اختبار.اختبار“.

To enforce left to right we need to prepend the "\u200E” left-to-right mark to the string which I did in this PR.

The same solution should probably be used on desktop also which shows the same issue.

Is this "display" version of the URL used strictly for display only, or is the modified version exposed to the user in the sense of being able to select&copy it, or otherwise interact with its contents? E.g. if the user does "select all", "copy" in the URL bar, will they get the original URL or the edited version?

Flags: needinfo?(petru.lingurar)

That is indeed only used for display.
The problem arise because for display we remove the the protocols so end up beginning the displayed URL with arabic characters which are read (and as such will be displayed) from right to left.
But when interacting with the url we are using the full URL of the current page.

Attached video OnlyForDisplay.mp4
Flags: needinfo?(petru.lingurar)
URL: 1284372
URL: 1284372
See Also: → CVE-2016-5267

(In reply to Petru-Mugurel Lingurar [:petru] from comment #7)

That is indeed only used for display.
The problem arise because for display we remove the the protocols so end up beginning the displayed URL with arabic characters which are read (and as such will be displayed) from right to left.
But when interacting with the url we are using the full URL of the current page.

Thanks, that sounds like the right thing to do.

Adding Lorand from QA to see the poc and verify the fix.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Group: mobile-core-security → core-security-release

When would you process the CVE assignment?

NI for comment 12

Flags: needinfo?(tom)

This should have been marked fixed and had the appropriate tracking flags set at the time so we could process the CVE and include it in the advisory. I will assign a CVE and update the prior advisory - to confirm this was fixed in Firefox for Android 92?

Flags: needinfo?(tom) → needinfo?(kbrosnan)
Whiteboard: desktop version is bug 1704420 → desktop version is bug 1704420[fixed in Fenix 92]

Yes that looks correct.

Flags: needinfo?(kbrosnan)
Attached file advisory.txt
Alias: CVE-2021-4221
Flags: sec-bounty? → sec-bounty+
See Also: → CVE-2023-5732
Group: core-security-release
Component: Security: Android → Toolbar
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: