Hacker News new | ask | show | jobs
by adamkhrona 5172 days ago
This is good: it's totally insecure to pass auth credentials in plain-text URLs.
3 comments

They're not passed in the URL. Try it yourself:

$ curl -vv 'http://username:password@example.com/

> GET / HTTP/1.1

> Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

dXNlcm5hbWU6cGFzc3dvcmQ= is base64 encoded 'username:password'

The Authorization header is the same one that will be used if your browser prompts you for a username/password.

Also, the Authorization header is also plain text. Whether you pass credentials on the URL or in the Authorization header, it makes little difference in terms of interceptability. They're just different lines in the HTTP request. You need SSL to secure either.

Well, basic auth is plaintext over the wire anyway. I don't think that you lose that much 'security' by putting them into the url.

That said, the most common argument that I heard against supporting this stuff is phishing, using the credentials part to push the real address as far as possible to the right/off the screen.

I - don't like that decision. I have basic auth services in internal networks and would like to access them this way.

What if I send it over https https://foo:bar@dump.ansman.se/basic-auth/foo? I don't think it should be insecure in this case.
I think the concern is making the user look like another URL you trust.