From what I understand using GET to submit usernames/passwords is a security issue because the username/password are part of the URL which can show up in browser history.
Is this still an issue if the login GET request is made using AJAX?
From what I understand using GET to submit usernames/passwords is a security issue because the username/password are part of the URL which can show up in browser history.
Is this still an issue if the login GET request is made using AJAX?
From what I understand using GET to submit usernames/passwords is a security issue because the username/password are part of the URL which can show up in browser history.
That's not the only issue. Using GET for situations where the user is submitting data opens up your application to CSRF vulnerabilities.
For example, I could embed <img src="http://yoursite.com/login?username=something&password=somethingelse">
, which may log visitors on my site out of your site due to the call to the login handler. This specific example depends on implementation, but other attacks can be made. There may be cases when an attacker wants users to be logged in to their account.
Besides that, other loggers on the way (your ISP, etc) may log this for a longish period of time. Of course, the same can be said about POST request, but usually the full request dtails won't be kept for long.
Yes, it is definitely still an issue. The browser history is not the only place URL parameters can be logged, but the server will likely log them, and intermediate proxies may log them as well.
Sensitive data such as user credentials should be POSTed as form data, not passed in the querystring.
GET requests (by protocol definition) must be "idempotent", which means no side-effects. In this case, changing your session state to "logged in" instead of "not logged in" is an example of a side-effect.
Much about the way browsers and servers and proxies work rely on this principle of GETs not having any side-effects, so violating this principle means you could run into difficult-to-diagnose problems down the road.
Always use POST when what you're doing changes the state of something, even if you don't actually have any data to POST. Just do it.