News for hackers. Stuff that matters.
Re:How Not to write a "REST" API by SomeOtherGuy2 on Wednesday February 01, 2012 @10:55AM (#3538436)
No they aren't sent plain-text:

>https://subdomain.sharefile.com/rest/getAuthID.aspx

Notice the https. The facepalm is just that there's no additional security in using POST vs GET.

Re:How Not to write a "REST" API by carbocation on Wednesday February 01, 2012 @11:00AM (#3538454)
POSTed values won't show up in typical server logs, whereas with GET their plaintext password would normally be logged on every request.

And POST over HTTPS keeps the POSTed values hidden from those who might listen, whereas with GET over HTTP it would just be out there in the URL.

Re:How Not to write a "REST" API by tptacek on Wednesday February 01, 2012 @11:55AM (#3538774)
This is exactly right.
[deleted]
Re:How Not to write a "REST" API by tptacek on Wednesday February 01, 2012 @11:56AM (#3538781)
The server log is not encrypted when using TLS, which is one reason you want to keep sensitive information out of your URLs.
Re:How Not to write a "REST" API by SomeOtherGuy2 on Wednesday February 01, 2012 @11:05AM (#3538481)
You have no way of knowing what they log and don't log. If their server logs are compromised, you should be assuming their username/password database was as well.

And HTTPS requests are encrypted. The whole request, including the "GET /someurl&password=s33krit HTTP/1.1" part. As I said, using POST doesn't add any additional security to this.

Re:How Not to write a "REST" API by tptacek on Wednesday February 01, 2012 @01:17PM (#3539184)
I don't understand the point you're trying to make here, or the stridency with which you're making it. You in fact do know that the most popular web servers do log the URL, and do not log POST parameters or individual headers.

That's why professional security audits will ding you for putting anything sensitive in a URL.

Re:How Not to write a "REST" API by SomeOtherGuy2 on Wednesday February 01, 2012 @01:47PM (#3539315)
Actually, we ding you for putting sensitive information in URLs that are used in a browser. The reason is that it will then be sent to other sites in the referrer header. When it is used for an API it doesn't matter. A security audit will check that logs are not logging sensitive information or that they are properly secured and encrypted if they do contain such information. The combination of telling users to put their password into the url and logging the url would be a problem, but not either thing on its own.
Re:How Not to write a "REST" API by tptacek on Wednesday February 01, 2012 @01:54PM (#3539354)
No, SomeOtherGuy. This is an HTTPS site. The referer header does not behave the way you're implying it does on HTTPS sites.

And having read and written this particular audit line item about 29074894389734897 times in the last 15 years, let me assure you that logging is clearly an issue.

The bit about how "if someone can see your logs you're already boned" is also message-board-logic more than reality. Logs are shipped all over the place. On a network pentest, one of the things you do when you pop a box is hunt for logs; even after you get root on the machine, you don't automatically have all the passwords that get stuck in the log files. Same goes for all the random LogLogic-style consoles those logs get fed to.

If you have more questions about this stuff, my contact info is in my profile --- just click my username above this comment. I just wanted to chime in to say that 'carbocation was exactly right, but my comments are now repeating themselves, and so I'm done on this thread.

Re:How Not to write a "REST" API by carbocation on Wednesday February 01, 2012 @11:23AM (#3538587)
I agree with your concerns. But my comment was talking about "typical server logs" and HTTPS-POST vs HTTP-GET, while yours is addressing different issues.
Re:How Not to write a "REST" API by SomeOtherGuy2 on Wednesday February 01, 2012 @12:46PM (#3539034)
I addressed why what gets in logs doesn't matter: if their server is compromised you have to assume you are boned anyways. And I don't understand why is your comment would be talking about "HTTP-GET"? The API in question is dealing with HTTPS for both GET and POST requests.
Re:How Not to write a "REST" API by cristoperb on Wednesday February 01, 2012 @04:17PM (#3539976)
I don't understand why your comments pointing out details of the http spec and common-sense security considerations are being downvoted. I guess they are coming across as overly 'stident'? Anyway, I've found them helpful. Thanks.
Re:How Not to write a "REST" API by tmcneal on Wednesday February 01, 2012 @11:06AM (#3538487)
If you're using SSL then form data in a POST request will be encrypted. HTTP headers are always encrypted using SSL. What wasn't clear to me from the documentation is whether the 'username' and 'password' are form data, or are actually custom HTTP headers. The latter choice would certainly be a facepalm.
Re:How Not to write a "REST" API by pygy_ on Wednesday February 01, 2012 @11:53AM (#3538758)
> The latter choice would certainly be a facepalm.

Why?

Re:How Not to write a "REST" API by SomeOtherGuy2 on Wednesday February 01, 2012 @11:28AM (#3538617)
>If you're using SSL then form data in a POST request will be encrypted

So will everything else, including the URI being requested, and thus the query string in it. Which is why it makes no difference using GET or POST.

Re:How Not to write a "REST" API by mootothemax on Wednesday February 01, 2012 @01:00PM (#3539102)
So will everything else, including the URI being requested

I disagree from the data I'm seeing in the access logs from my SSL-hosted site running nginx. In the logs I can see lines such as:

GET /path/script?variable=blahblah&another_variable=123

EDIT since I appear to have lost the ability to reply to comments: I disagree with SomeOtherGuy2 that The fact that it may get logged is a red-herring.

Ignoring how secure a server with a rogue user accessing it is, it's possible that there will be more than one server involved in this scenario, and central logging servers are common. Will the traffic sent to the logging server be encrypted? And what if the logging server is compromised? You're essentially storing passwords in plain text.

Re:How Not to write a "REST" API by baddox on Wednesday February 01, 2012 @01:32PM (#3539252)
It's all encrypted over the network. Obviously, your servers have to be able decrypt URL strings (and everything else), or they wouldn't be able to respond correctly. I think the assumption is just that servers may by default log decrypted URLs for GET requests, but not POST requests. But, as people have noted, that's not exactly reassuring, since you have no idea how their logging is set up.
Re:How Not to write a "REST" API by SomeOtherGuy2 on Wednesday February 01, 2012 @01:34PM (#3539262)
You are very confused. SSL is used to encrypt transmission between the browser and web server. Of course the web server decrypts the data it receives, otherwise it wouldn't be able to use it. I am saying you can not sniff someone's HTTPS traffic and see the urls they are requesting, so sensitive information being in the url is not a problem. The fact that it may get logged is a red-herring, as if someone has compromised the server to gain access to the logs, they can access whatever they want, your username and password included.
Re:How Not to write a "REST" API by SimHacker on Wednesday February 01, 2012 @12:56PM (#3539086)
But you can be 99.994% sure they're writing your plan text user name and password into their logs if you're using get, and if somebody breaks in and gets them, then they have your password, even if those passwords are properly hashed in the user database.
Re:How Not to write a "REST" API by SomeOtherGuy2 on Wednesday February 01, 2012 @01:52PM (#3539343)
No, I wouldn't be 99.994% sure of that at all. In fact, I would assume that if they are suggesting that people use GET, that they are in fact not logging the query params, as any security audit would catch that.

And again, if they are compromised, then they are compromised. It doesn't matter if they have logging disabled, someone who would have access to the logs also has access to either the httpd account or the root account. Either way, they can already read your plaintext usernames and passwords directly when they are being submitted. Of course, they don't need your username and password anyways, as they already have full access to the system.

Re:How Not to write a "REST" API by freshhawk on Wednesday February 01, 2012 @04:25PM (#3540027)
Picking a comment at random to thank you for at least trying to explain to people why their assumption of what's being logged relates in no way to security.

At least one person appreciates someone taking the time to correct this rather serious misunderstanding.

Re:How Not to write a "REST" API by Torn on Wednesday February 01, 2012 @11:07AM (#3538493)
Does HTTPs encrypt headers or just the body? Are both things they're offering secure?
Re:How Not to write a "REST" API by emillon on Wednesday February 01, 2012 @11:09AM (#3538506)
TLS is one layer below HTTP. So yes, both headers and body are encrypted.
Re:How Not to write a "REST" API by Ethervoid on Wednesday February 01, 2012 @11:26AM (#3538608)
"Everything in the HTTPS message is encrypted, including the headers, and the request/response load. With the exception of the possible CCA cryptographic attack described in limitations section below, the attacker can only know the fact that a connection is taking place between the two parties, already known to him, the domain name and IP addresses."