News for hackers. Stuff that matters.
Re:API Shouldn't Redirect HTTP to HTTPS by moralestapia on Tuesday May 28, 2024 @04:22PM (#40505180)
No, HTTP would expose any sensitive information.

It's just clear text.

Re:API Shouldn't Redirect HTTP to HTTPS by iJohnDoe on Tuesday May 28, 2024 @04:28PM (#40505253)
Does HTTPS also hide the URL request in most logging systems? You can always see the domain (api.example.com) but you cannot see the URL? The benefit being it hides an API key if included in the URL?
Re:API Shouldn't Redirect HTTP to HTTPS by Aachen on Tuesday May 28, 2024 @04:31PM (#40505294)
The benefit is that it:

1. hides any private information anywhere in the request, URL or otherwise, API key or otherwise. Maybe you're fine if someone knows you used Bing (revealed through DNS lookups), but not what query you entered (encrypted to be decryptable only by Bing servers). An API key is obviously secret but something as oft-innocuous as search queries can also be private.

2. disallows someone on the network path from injecting extra content into the page. This can be an ISP inserting ads or tracking (mobile carriers have been playing with extra HTTP headers containing an identifier for you for advertising reasons iirc) or a local Machine-in-the-Middle attack where someone is trying to attack another website you've visited that used https.

Re:API Shouldn't Redirect HTTP to HTTPS by yjftsjthsd-h on Tuesday May 28, 2024 @04:33PM (#40505320)
Yes, it hides the URL, although sadly not the domain.
Re:API Shouldn't Redirect HTTP to HTTPS by taftster on Tuesday May 28, 2024 @05:39PM (#40505912)
It hides the domain too, in the literal HTTP request.

What it doesn't hide is the DNS lookup for that domain. You still have to translate a hostname into an IP address.

This might be a concern for certain uses. But at least it's on another port and protocol and not directly related to the HTTP request itself.

Re:API Shouldn't Redirect HTTP to HTTPS by yjftsjthsd-h on Tuesday May 28, 2024 @05:46PM (#40505950)
No, HTTPS has the domain in plaintext. There is a plan to fix this (Encrypted Client Hello), but AFAIK it's not widely used yet.
Re:API Shouldn't Redirect HTTP to HTTPS by taftster on Tuesday May 28, 2024 @06:02PM (#40506095)
Ah yes, apologies. Again, it's not strictly part of the HTTP request, but part of the TLS handshake around it. And only part of the TLS handshake as part of SNI, if supported (which is true by default).

> "Server Name Indication payload is not encrypted, thus the hostname of the server the client tries to connect to is visible to a passive eavesdropper."

https://en.wikipedia.org/wiki/Server_Name_Indication

So you're right, this is more aligned to the HTTP request than the DNS resolution of hostname that I mentioned. Strictly speaking, it's not part of HTTP per se (it's part of TLS), but still, it's in the same request in the most common definition, as you are saying.