Closed Bug 308642 Opened 19 years ago Closed 10 years ago

wrong interpretation of password in URI when semicolon present

Categories

(Core :: Networking, defect)

x86
Windows 2000
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: bugzilla.50.mll, Unassigned)

References

(Depends on 1 open bug, )

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050702

Hello there,

NOTE: This is a bug I spotted in Firefox 1.5 beta [Mozilla/5.0 (Windows; U;
Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4] and previous
versions, too. B but the rules at
http://www.mozilla.org/support/firefox/bugs#mozilla said to check it in Mozilla,
I found had it, too, so here we go:

When you use the protocol://username:password@url scheme, and if there is a
semicolon in the password, Mozilla & Firefox don't like it and usually do a
google lucky search on "username:[part of the password before the semicolon]".

FWIW, IE handles this fine.

Reproducible: Always

Steps to Reproduce:
1. Go to an url such as http://username:passwordwitha;semicolon@myurl.com


Actual Results:  
I'm obviously not on the myurl.com site.

On Mozilla, I get redirected to http://www.username.com/;semicolon@myurl.com
On Firefox, I get redirected to http://www.webopedia.com/TERM/U/username.html

Expected Results:  
Login to myurl.com with login "username" and password "passwordwitha;semicolon"
Assignee: general → darin
Component: General → Networking
Product: Mozilla Application Suite → Core
QA Contact: general → benc
Version: unspecified → Trunk
Semicolon's a reserved sub-delim character in URIs. What happens if instead you
use http://username:passwordwitha%3Bsemicolon@myurl.com ?
Phil is right, the ';' needs to be hexencoded. Recommending Invalid for now.
However if we ever move to RFC 3986 for urlparsing the role of ';' will be much
smaller, I think we can loose the param-part of the url alltogether. The param
will be part of path-segments and it will be up to every protocol if and where
it recognizes params. This also calls for different ways to traverse path
segments with '..'. Losing the param-part in urls would allow us to be able to
parse this one right without encoding the ';'. So there is hope ... 
(In reply to comment #1)
> Semicolon's a reserved sub-delim character in URIs. What happens if instead you
> use http://username:passwordwitha%3Bsemicolon@myurl.com ?
It does work, both in Mozilla & Firefox. Thank you.


(In reply to comment #2)
> Phil is right, the ';' needs to be hexencoded. Recommending Invalid for now.
> However if we ever move to RFC 3986 for urlparsing the role of ';' will be much
> smaller, I think we can loose the param-part of the url alltogether. The param
> will be part of path-segments and it will be up to every protocol if and where
> it recognizes params. This also calls for different ways to traverse path
> segments with '..'. Losing the param-part in urls would allow us to be able to
> parse this one right without encoding the ';'. So there is hope ... 

I got about 25% of your comment. :)
But my $0.02 are that IMHO anything between the ":" and the first "@" should be
considered part of the password: there's no reason to parse the URI as if there
could be a parameter next to the password string.
Assignee: darin → nobody
QA Contact: benc → networking
Depends on: url
Is this still a problem? Note that the special-casing og ";" has been removed ~2 years ago.
Attached patch url_password_col_test.patch (deleted) — Splinter Review
This bug seems to have been fixed, as the previous comment says.
I have written a unit test to check, and indeed, the colon is properly encoded.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: