URLs from firefox:// scheme are double unescaped

RESOLVED FIXED in 4.0

Status

()

Firefox for iOS
General
--
blocker
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: jhugman, Assigned: jhugman)

Tracking

unspecified
Other
iOS

Firefox Tracking Flags

(fxios-v4.0 fixed, fxios-v5.0 fixed, fxios4.0+)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
This came out of https://bugzilla.mozilla.org/show_bug.cgi?id=1266091

We try to open a google search for "cheese platter". This is correctly encoded as:

  firefox://open-url?url=https%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3Dcheese%2520platter

by the open-in demo project.

We receive this in application(application:, openURL:, sourceApplication:, annotation:):

   firefox://open-url?url=https%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3Dcheese%2520platter

Which we parse with NSURLComponents and take the url parameter we have:

   https://www.google.com/search?q=cheese%20platter

Then we double decode it with url.unescape, which results in the following invalid and ignored URL:

  https://www.google.com/search?q=cheese platter

The fix here is to not url.unescape() - NSURLComponents has already done that.
I'm marking this as blocking 4.0 because this is a one line and low risk fix.
Severity: normal → blocker
tracking-fxios: --- → 4.0+
Whiteboard: [needsuplift]
(Assignee)

Comment 2

2 years ago
Created attachment 8746257 [details] [review]
Pull request

One line fix.

I wanted to fix the url method argument being redeclared as String? but wanted to keep this minimal.

https://github.com/mozilla/firefox-ios/commit/c58b52970b15434a2e1c567bf1dcfcb7e83c68e6#diff-19fd1a6fe4b2f78eb457726f366733e0
Attachment #8746257 - Flags: review?(sarentz)
(Assignee)

Updated

2 years ago
Summary: URLs from firefox:// scheme are double escaped → URLs from firefox:// scheme are double unescaped
(Assignee)

Updated

2 years ago
Assignee: nobody → jhugman
Status: NEW → ASSIGNED
Attachment #8746257 - Flags: review?(sarentz) → review+
(Assignee)

Comment 3

2 years ago
Merged and closed.
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
status-fxios-v4.0: --- → fixed
status-fxios-v5.0: --- → fixed
Whiteboard: [needsuplift]
Target Milestone: --- → 4.0
You need to log in before you can comment on or make changes to this bug.