Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a username and password be sent safely over HTTPS via URL parameters?

A colleague and I had a heated debate yesterday whether it is safe to send login credentials via URL parameters as a means of authentication. He correctly pointed out that HTTPS encrypts all non-hostname/port characters in a URL before sending a request to the server side.

However, I still think there are edge cases here where it is possible to steal these credentials, and believe they should be sent via an HTTPS POST. Is this actually a safe means of sending login/token data?

like image 715
Peter Bratton Avatar asked May 06 '09 15:05

Peter Bratton


People also ask

Are URL parameters secure in HTTPS?

An encrypted HTTPS request protects most things: This is the same for all HTTP methods (GET, POST, PUT, etc.). The URL path and query string parameters are encrypted, as are POST bodies.

Can we pass username and password in URL?

1 Answer. It is indeed not possible to pass the username and password via query parameters in standard HTTP auth. Instead, you use a special URL format, like this: http://username:[email protected]/ -- this sends the credentials in the standard HTTP "Authorization" header.

Can you ever safely include credentials in a URL?

To summarise my recommendations for securely including credentials in a URL: Always use a limited-scope token such as a capability token (key) or limited scope OAuth access token. Ideally the token should only provide access to the one resource named in the URL. Never ever ever put a username and password in a URL.

Is it safe to pass parameters in URL?

URLS and query parameters aren't secure. They should never contain sensitive or important information (passwords, static shared secrets, private information, etc).


1 Answers

The requested URL might show up in Web server logs and browser history/bookmarks which is not a good thing.

like image 74
mmx Avatar answered Sep 23 '22 18:09

mmx