Open Bug 1873973 Opened 10 months ago Updated 2 months ago

nsStandardURL incorrectly escapes ^ in the path

Categories

(Core :: Networking, defect, P3)

defect

Tracking

()

REOPENED

People

(Reporter: valentin, Assigned: sekim)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [necko-triaged][necko-monitor])

Attachments

(1 file)

No description provided.

The failing tests are:
Parsing: <wss://host/ !"$%&'()*+,-./:;<=>@[\]^_{|}~> without base`

For Firefox:
!EQ("wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~", "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~")

Chrome result:
!EQ("wss://host/%20!%22$%&'()+,-./:;%3C=%3E@[/]^_%60%7B|%7D~", "wss://host/%20!%22$%&'()+,-./:;%3C=%3E@[/]%5E_%60%7B%7C%7D~")
(they are escaping both ^ and | )

Assignee: nobody → sekim
Status: NEW → ASSIGNED

Note that ^ is a separator in the origin serialization.

We need to make sure we don't break the ability to deserialize them:
https://searchfox.org/mozilla-central/rev/f60bb10a5fe6936f9e9f9e8a90d52c18a0ffd818/caps/tests/unit/test_site_origin.js#17

Assert.equal(prinicpal1.origin, "http://example.com^userContextId=11");
Attachment #9404401 - Attachment description: WIP: Bug 1873973 - Fix nsStandardURL incorrectly escaped ^ in the path r?edgul → Bug 1873973 - Fix nsStandardURL incorrectly escaped ^ in the path r?edgul,valentin
Attachment #9404401 - Attachment description: Bug 1873973 - Fix nsStandardURL incorrectly escaped ^ in the path r?edgul,valentin → Bug 1873973: Fix nsStandardURL incorrectly escaped ^ in the path r?edgul,valentin
Attachment #9404401 - Attachment description: Bug 1873973: Fix nsStandardURL incorrectly escaped ^ in the path r?edgul,valentin → Bug 1873973 - Fix nsStandardURL incorrectly escaped "^" in the path r?edgul,valentin
Pushed by eguloien@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/25f376fb859f Fix nsStandardURL incorrectly escaped "^" in the path r=necko-reviewers,valentin
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
See Also: → 1899673

Is there a chance this broke something in the page loading code? I've been having problems with a test that loads a URL containing ^ in various places. Instead of loading in the docShell we somehow end up at the external protocol service. I've been assuming it's a problem in our (Thunderbird's) networking code, and it probably is, but I can't find anything. (Bug 1899673 comment 3.)

The url is of the form imap://user@localhost:39033/fetch%3EUID%3E^INBOX%3E1.

  • imap://user@localhost:39033/fetch%3EUID%3E^INBOX%3E1 fails to load.
  • imap://user@localhost:39033/fetch%3EUID%3E%5EINBOX%3E1 works.
  • imap://user@localhost:39033/fetch%3EUID%3E!INBOX%3E1 works.
  • imap://user@localhost:39033/fetch%3EUID%3E!INBOX%3E1?test^test (^ in query) works.
  • imap://user@localhost:39033/fetch%3EUID%3E!INBOX%3E1&test^test (^ in path) fails.
  • imap://user@localhost:39033/fetch%3EUID%3E!INBOX%3E1&test^ works.
Flags: needinfo?(valentin.gosu)
Flags: needinfo?(sekim)

I left a comment on 1899673 - I think the problem is how ImapURL uses the ^ character as a replacement for /.
Let me know if replacing ^ with { or another character that's not allowed in URL paths works

Flags: needinfo?(valentin.gosu)
Flags: needinfo?(sekim)
Regressions: 1899753
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 128 Branch → ---

Valentin, what are your thoughts on this bug?

Flags: needinfo?(valentin.gosu)

Let's leave this in the backlog for now.
We might be able to fix it at some point in the future, but right now the effort needed might be too large for the payoff.

Flags: needinfo?(valentin.gosu)
Whiteboard: [necko-triaged] → [necko-triaged][necko-priority-next]
Whiteboard: [necko-triaged][necko-priority-next] → [necko-triaged][necko-priority-monitor]
Whiteboard: [necko-triaged][necko-priority-monitor] → [necko-triaged][necko-monitor]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: