News for hackers. Stuff that matters.
Re:Forcing Wordpress sites to use https even when not directed by pilif on Thursday July 23, 2015 @11:11AM (#9936202)
I don't understand this in the context of Wordpress and PHP. As a relic of the CGI spec, a header called "Foo" would be turned into an array index called "HTTP_FOO".

For a header called "HTTPS" to be turned into $_SERVER['HTTPS'] as opposed to $_SERVER['HTTP_HTTPS'] would require quite an impressive misconfiguration of the web server which also requires additional work compared to default settings (including possibly even patching PHP itself depending on SAPI).

Re:Forcing Wordpress sites to use https even when not directed by geofft on Thursday July 23, 2015 @11:22AM (#9936283)
From the Google bug report (https://crbug.com/505268), it looks like WooCommerce was looking explicitly for $_SERVER['HTTP_HTTPS'], and this code was removed when the Chrome behavior was discovered:

https://github.com/woothemes/woocommerce/issues/8479

So "breaking web applications everywhere" is an exaggeration.

It also looks like this is the implementation of the W3 "upgrade-insecure-requests" spec, so "Chrome 44 sending HTTPs header by mistake" is also not true. It's intentional.

http://www.w3.org/TR/upgrade-insecure-requests/

But it sounds like they're going to implement a different header / propose changes to the spec based on real-world feedback like this.

Re:Forcing Wordpress sites to use https even when not directed by tomsommer on Thursday July 23, 2015 @02:07PM (#9937447)
WooCommerce is not the only one doing stupid things with HTTP_HTTPS: https://github.com/search?l=php&q=HTTP_HTTPS&type=Code&utf8=...

Has anyone actually confirmed the problem on a non-WooCommerce site? or a site without bad PHP code?

Re:Forcing Wordpress sites to use https even when not directed by TazeTSchnitzel on Thursday July 23, 2015 @11:50AM (#9936512)
> As a relic of the CGI spec, a header called "Foo" would be turned into an array index called "HTTP_FOO".

Usually, yes. But CGI has some headers that don't get that prefix, things like "CONTENT_LENGTH".

It looks to me like whoever added the HTTPS variable feature to Apache implemented it as an unprefixed header rather than a proper CGI variable, for some reason, and that's the issue.

That, or it is a CGI var, but some error in Apache allows HTTP headers to set it.

Re:Forcing Wordpress sites to use https even when not directed by pilif on Thursday July 23, 2015 @12:05PM (#9936626)
I would have said that content_length is special in that it's supposed to be the actual content length, not the value sent by the client in the header.

But I definitely defer to your wisdom as I'm just a user who hasn't done pure CGI in 15 years. As somebody who works on PHP, you are probably infinitely more qualified

Re:Forcing Wordpress sites to use https even when not directed by TazeTSchnitzel on Saturday July 25, 2015 @08:45AM (#9947437)
You have a point there. If the request body was weird and lacked the header somehow, I suppose CONTENT_LENGTH would still be there.
Re:Forcing Wordpress sites to use https even when not directed by sarciszewski on Thursday July 23, 2015 @11:39AM (#9936414)
> For a header called "HTTPS" to be turned into $_SERVER['HTTPS'] as opposed to $_SERVER['HTTP_HTTPS'] would require quite an impressive misconfiguration of the web server which also requires additional work compared to default settings (including possibly even patching PHP itself depending on SAPI).

I'd just like to say that this, indeed, appears to be the case. Apache bug most likely.