Are HTTPS headers encrypted?

SecurityPostEncryptionHttpsGet

Security Problem Overview


When sending data over HTTPS, I know the content is encrypted, however I hear mixed answers about whether the headers are encrypted, or how much of the header is encrypted.

How much of HTTPS headers are encrypted?

Including GET/POST request URLs, Cookies, etc.

Security Solutions


Solution 1 - Security

The whole lot is encrypted - all the headers. That's why SSL on vhosts doesn't work too well - you need a dedicated IP address because the Host header is encrypted.

The Server Name Identification (SNI) standard means that the hostname may not be encrypted if you're using TLS. Also, whether you're using SNI or not, the TCP and IP headers are never encrypted. (If they were, your packets would not be routable.)

Solution 2 - Security

The headers are entirely encrypted. The only information going over the network 'in the clear' is related to the SSL setup and D/H key exchange. This exchange is carefully designed not to yield any useful information to eavesdroppers, and once it has taken place, all data is encrypted.

Solution 3 - Security

New answer to old question, sorry. I thought I'd add my $.02

The OP asked if the headers were encrypted.

They are: in transit.

They are NOT: when not in transit.

So, your browser's URL (and title, in some cases) can display the querystring (which usually contain the most sensitive details) and some details in the header; the browser knows some header information (content type, unicode, etc); and browser history, password management, favorites/bookmarks, and cached pages will all contain the querystring. Server logs on the remote end can also contain querystring as well as some content details.

Also, the URL isn't always secure: the domain, protocol, and port are visible - otherwise routers don't know where to send your requests.

Also, if you've got an HTTP proxy, the proxy server knows the address, usually they don't know the full querystring.

So if the data is moving, it's generally protected. If it's not in transit, it's not encrypted.

Not to nit pick, but data at the end is also decrypted, and can be parsed, read, saved, forwarded, or discarded at will. And, malware at either end can take snapshots of data entering (or exiting) the SSL protocol - such as (bad) Javascript inside a page inside HTTPS which can surreptitiously make http (or https) calls to logging websites (since access to local harddrive is often restricted and not useful).

Also, cookies are not encrypted under the HTTPS protocol, either. Developers wanting to store sensitive data in cookies (or anywhere else for that matter) need to use their own encryption mechanism.

As to cache, most modern browsers won't cache HTTPS pages, but that fact is not defined by the HTTPS protocol, it is entirely dependent on the developer of a browser to be sure not to cache pages received through HTTPS.

So if you're worried about packet sniffing, you're probably okay. But if you're worried about malware or someone poking through your history, bookmarks, cookies, or cache, you are not out of the water yet.

Solution 4 - Security

HTTP version 1.1 added a special HTTP method, CONNECT - intended to create the SSL tunnel, including the necessary protocol handshake and cryptographic setup.
The regular requests thereafter all get sent wrapped in the SSL tunnel, headers and body inclusive.

Solution 5 - Security

With SSL the encryption is at the transport level, so it takes place before a request is sent.

So everything in the request is encrypted.

Solution 6 - Security

HTTPS (HTTP over SSL) sends all HTTP content over a SSL tunel, so HTTP content and headers are encrypted as well.

Solution 7 - Security

Yes, headers are encrypted. It's written here. > Everything in the HTTPS message is encrypted, including the headers, and the request/response load.

Solution 8 - Security

the URL is also encrypted, you really only have the IP, Port and if SNI, the host name that are unencrypted.

Solution 9 - Security

To understand, what is encrypted and what not, you need to know that SSL/TLS is the layer between the transport-layer and the application-layer.

in the case of HTTPS, HTTP is the application-layer, and TCP the transport-layer. That means, all Headers below the SSL-Level are unencrypted. Also, SSL itself may expose data. The exposed data includes(for each layer's Header):

NOTE: Additional Data might be exposed too, but this data is pretty sure to be exposed.

MAC:

  1. Source MAC address
  2. Destination MAC address

IP(assuming IPv4):

  1. Destination IP address
  2. Source IP address
  3. IP Options(if set)
  4. Type-Of-Service(TOS)
  5. The number of hops the current packet passed, if TTL is set to 64

TCP:

  1. Source Port
  2. Destination Port
  3. TCP-Options

Theoretically, you can encrypt the TCP-Headers, but that is hard to implement.

SSL:

  1. Hostname(if SNI is being used)

Usually, a browser won't just connect to the destination host by IP immediantely using HTTPS, there are some earlier requests, that might expose the following information(if your client is not a browser, it might behave differently, but the DNS request is pretty common):

DNS: This request is being sent to get the correct IP address of a server. It will include the hostname, and its result will include all IP addresses belonging to the server.

HTTP: the first request to your server. A browser will only use SSL/TLS if instructed to, unencrypted HTTP is used first. Usually, this will result in a redirect to the seucre site. However, some headers might be included here already:

  1. User-Agent(Specification of the client)
  2. Host (Hostname)
  3. Accept-Language (User-Language)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDan HerbertView Question on Stackoverflow
Solution 1 - SecurityGregView Answer on Stackoverflow
Solution 2 - SecuritymdbView Answer on Stackoverflow
Solution 3 - SecurityAndrew JayView Answer on Stackoverflow
Solution 4 - SecurityAviDView Answer on Stackoverflow
Solution 5 - SecurityblowdartView Answer on Stackoverflow
Solution 6 - SecurityChristian C. SalvadóView Answer on Stackoverflow
Solution 7 - SecuritykeypressView Answer on Stackoverflow
Solution 8 - SecurityxxiaoView Answer on Stackoverflow
Solution 9 - SecurityHelpfulHelperView Answer on Stackoverflow