Article View: comp.os.vms
Article #238Re: More PHP vulnerabilities
From: Simon Clubley
Date: Mon, 23 Nov 2026 19:42
Date: Mon, 23 Nov 2026 19:42
52 lines
3407 bytes
3407 bytes
On 2026-11-20, Arne Vajhøj <arne@vajhoej.dk> wrote:
> On 11/20/2026 3:10 PM, Simon Clubley wrote:
>> On 2026-11-20, Arne Vajhøj <arne@vajhoej.dk> wrote:
>>> On 11/19/2026 4:25 PM, Arne Vajhøj wrote:
>>>> echo file_get_contents("http://arnepc5.vajhoej.dk/reveal.aspx") . "\n";
>>>> //echo file_get_contents("https://arnepc5.vajhoej.dk/reveal.aspx") . "\n";
>>>> echo file_get_contents("https://arnepc5.vajhoej.dk/reveal.aspx", false,
>>>> stream_context_create($sslctxopts)) . "\n";
>>>> echo file_get_contents("HTTPS://arnepc5.vajhoej.dk/reveal.aspx") . "\n";
>>>> echo file_get_contents("httpS://arnepc5.vajhoej.dk/reveal.aspx") . "\n";
>>>
>>>> $ php another.php
>>>> Port = 80
>>>> Port = 443
>>>> Port = 80
>>>> Port = 80
>>> And for the curious - before fix:
>>>
>>> use_ssl = resource->scheme && (ZSTR_LEN(resource->scheme) > 4) &&
>>> ZSTR_VAL(resource->scheme)[4] == 's';
>>
>> I really hope that line was always compiled by a short-circuiting
>> compiler and that line always successfully triggered short-circuiting...
>>
>> Don't be surprised if everyone is now looking for similar constructs
>> that rely on short-circuiting to be safe.
> Doesn't C require/mandate short circuiting in cases like this??
>
As Dan has pointed out, yes. However, I absolutely hate that style of
coding (and the use of short circuiting in general) - it is way too fragile.
It depends on the compiler behaving as expected and it depends on someone
not making some edit change that happens to have the unexpected side-effect
of disabling any working short circuiting.
Seriously. Please consider not using short circuiting and instead writing
your code so it works regardless of whether your compiler short-circuits
or not. (Or it suddenly decides to stop short-circuiting one day).
Oh, and before you all start mocking me, please read this:
https://www.redhat.com/en/blog/security-flaws-caused-compiler-optimizations
Even Linux has been caught out in the past by compilers not behaving
as expected.
Simon.
--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.
Technical Details
Message-ID:
<11e24vp$265v0$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11dnpep$2kvk6$2@dont-email.me> <11dpfjf$35umc$1@dont-email.me> <11dq9gg$3ghpm$1@dont-email.me> <11dqa7g$3guqc$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> Newsgroups: comp.os.vms Subject: Re: More PHP vulnerabilities Date: Mon, 23 Nov 2026 19:42:50 -0000 (UTC) Organization: A noiseless patient Spider Lines: 52 Message-ID: <11e24vp$265v0$1@dont-email.me> References: <11dnpep$2kvk6$2@dont-email.me> <11dpfjf$35umc$1@dont-email.me> <11dq9gg$3ghpm$1@dont-email.me> <11dqa7g$3guqc$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 23 Nov 2026 19:42:50 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2299872"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18lpNSeZxReMmGMIzRvrkyn0Oz2jGWk3ZY="; posting-host="4859acde95e0a5fc586b6509f7f15f50" User-Agent: slrn/0.9.8.1 (VMS/Multinet) Cancel-Lock: sha1:IYNWJt9NCaWKxW6ZVkoPa8WyDOc= sha256:VnmtwTpF2cmGinVji7LkLrqKyInDyYO3dfGcPHla86k= sha1:rvCU2ZvRzNI7k0wDPmiv0L9OcGg= sha256:FlFw4QKmDgkf0H4Qju9OKXrGESh0E0D0sd4zEm0D5j8=