News for hackers. Stuff that matters.
Re:Forcing Wordpress sites to use https even when not directed by martius on Thursday July 23, 2015 @07:04AM (#9934972)
Basically, now Chrome sends the header HTTPS: 1 when issuing a request over HTTP to notify it "prefers" HTTPS.

However, this header is (or was) used by several HTTP servers/proxies (including Apache, I believe) to notify the application that the client connection is established in HTTPS. Wordpress reacts to this header by generating https:// URLs, which may not work if the server doesn't serve HTTPS with a properly configured certificate.

Re:Forcing Wordpress sites to use https even when not directed by jrochkind1 on Thursday July 23, 2015 @08:02AM (#9935153)
Hm, shouldn't apache be ensuring that clients _can't_ set the flag that indicates "this is an HTTPS request"?

Otherwise app code that's _checking_ the flag, to ensure that a sensitive URL is only being accessed via HTTPS can be spoofed by the client simply saying it's HTTPS when it's not. That doesn't seem right.

If that's what's going on, it seems like a bug in apache, with security consequences.

?

Re:Forcing Wordpress sites to use https even when not directed by jrockway on Thursday July 23, 2015 @07:45AM (#9935090)
Shouldn't the frontend remove the header if it's something that it would normally add? It's a major problem if your application is expecting a header to be set by the frontend web server, but is actually getting the value from the user agent.
Re:Forcing Wordpress sites to use https even when not directed by drdaeman on Thursday July 23, 2015 @09:33AM (#9935574)
No.

The problem is, the using "HTTPS" HTTP header (that translates to "HTTP_HTTPS" environment variable in CGI terms) is a kludge. It should've been bare "HTTPS" variable in a same manner "REQUEST_ADDR" is, but someone didn't care much (or wasn't able to do things properly in early days) but shared a recipe that became so widespread, it's a nearly de-facto standard now. Or maybe this had evolved when TLS termination proxies were much more common, but due to laziness the recipe had eventually lost mandatory sanitization of X-Forwarded-For and HTTPS headers.

Still, if webserver is unaware of HTTPS (say, it had never ever had anything with TLS) it's not really webserver's fault it's not dropping some request header.

Re:Forcing Wordpress sites to use https even when not directed by k8tte on Thursday July 23, 2015 @08:01AM (#9935149)
Agree. I'm having a hard time to see how this is Chrome's fault. All discussion i've seen indicate that wordpress and woocommerce treat the HTTPS header in special (and non-standard) ways
Re:Forcing Wordpress sites to use https even when not directed by martius on Thursday July 23, 2015 @08:28AM (#9935232)
It's Chrome fault to use push for a new standardized header without properly checking its impact: the issue has been raised during the beta phase, but they underestimated it and did not rollback.

I believe it is known that some old reverse-proxies used this header before a standard solution emerged (X-forwarded-proto), Wordpress probably had to deal with this surprising behavior at some point.

Also, by naming a header "HTTPS", one could expect collision with a non-standard behavior: this is very common with HTTP/1.1.

Re:Forcing Wordpress sites to use https even when not directed by k8tte on Thursday July 23, 2015 @09:22AM (#9935501)
I agree. However, non-standard conforming software should continue to use the X- prefix, like if these proxies used a "X-HTTPS" indicating it is a non-standard header, this would be a non-issue.
Re:Forcing Wordpress sites to use https even when not directed by martius on Thursday July 23, 2015 @07:59AM (#9935139)
The issue here is that the frontend may be behind a reverse proxy, talking to the client in HTTPS but to the frontend in HTTP. In that case, the frontend should probably let the HTTPS header.

In practice, with X-Forwarded-Proto, they don't, unless they can authenticate the downstream hop.

Re:Forcing Wordpress sites to use https even when not directed by jrockway on Thursday July 23, 2015 @08:33AM (#9935248)
I haven't done web development for a while, but here's how I imagine the frontend server should behave.

Let's say you configure your frontend server to set X-Foo and X-Bar fields. First, it should always send a header to the application indicating that it's messing with X-Foo and X-Bar, say "X-Added-By-My-Webserver: X-Foo, X-Bar". That way, the application can be sure that the frontend server is properly configured. Next, it should strip any X-Foo, X-Bar, and X-Added-By-My-Webserver, to prevent the client from being able to confuse the application with information the application expects to receive from the server.

This is still flaky because the frontend server could fail, and the user could send X-Added-By-My-Webserver, and so on, but if you must use in-band signalling, this seems like the safe route. Just blissfully adding a header is not enough to protect against evil or changing user agents.

Furthermore, it seems like a bad idea to make up your own header and not use an X- prefix.

Re:Forcing Wordpress sites to use https even when not directed by ominous_prime on Thursday July 23, 2015 @08:51AM (#9935341)
The X- prefix recommendation was deprecated a couple years ago. Since everyone used that format, you had to be careful of collisions anyway. That's not to say you can't use X- to start custom headers, it's just not required.
Re:Forcing Wordpress sites to use https even when not directed by martius on Thursday July 23, 2015 @08:49AM (#9935338)
Yes, it's a bad idea, but an awful lot of bad ideas were the common practice a long time ago, when vendors had to deal with limitations of the HTTP/1.0 and 1.1 RFCs.

In fact, we aren't talking about application headers. The HTTP RFC makes a distinction between application headers and hop-by-hop headers. There are mechanisms that proxies are required to implement, but they still don't.

For instance, a proxy must declare itself by appending its signature to a "Via" header - however most of them don't.

The RFC about forwarded HTTP extension is unclear about how a hop should deal with those headers, there is no one-size-fit-all situations: http://tools.ietf.org/html/rfc7239#section-8.1

Re:Forcing Wordpress sites to use https even when not directed by donatj on Thursday July 23, 2015 @08:29AM (#9935240)
It's not their fault directly but when it breaks sites hosted with the most common server on the web, Apache, due to an Apache bug it's a lot easier to fix Chrome than every Apache installation.
Re:Forcing Wordpress sites to use https even when not directed by michaelt on Thursday July 23, 2015 @07:44AM (#9935080)
Forgive my ignorance, but why would a browser need to say that it prefers https? Doesn't that go without saying nowerdays?

Surely only the most obscure, ancient legacy systems would have problems with being redirected to https?

Re:Forcing Wordpress sites to use https even when not directed by ricogallo on Thursday July 23, 2015 @07:54AM (#9935114)
Indeed, but you can see that a bunch of Wordpress sites are obscure, ancient and insecure by default.
Re:Forcing Wordpress sites to use https even when not directed by martius on Thursday July 23, 2015 @08:02AM (#9935152)
He's talking about a client not supporting HTTPS.

A client may have reasons to prefer HTTP over HTTPS: perfs, plaintext for debug, etc. It's hard to assume that "HTTPS should be the default" in any circumstance.

I'm not sure the wordpress sites are to blame here (for once): SSL isn't free to deploy (yet).

Re:Forcing Wordpress sites to use https even when not directed by uxp on Thursday July 23, 2015 @12:19PM (#9936720)
SSL is free to deploy: https://www.startssl.com?app=12

If you have a site that gets enough traffic that you need a better supported or more validated certificate, then I'm sure the $40/yr for a cheapass godaddy cert is worth the money.

Re:Forcing Wordpress sites to use https even when not directed by martius on Thursday July 23, 2015 @08:02PM (#9939266)
Assuming you have time and knowledge to do it. Assuming you own the domain or at least are able to access to its DNS records. Assuming you can use SNI (and all your visitors too) or have your own IPv4 address. Assuming $40 is free...

No, even a free certificate doesn't mean that deploying ssl is free.