🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.vms
Article #69

Re: Re: ‘This Is Not a Drill’: Critical PHP Vulnerabilities Are Setting the Internet on Fire

#69
From: Dan Cross
Date: Sat, 24 Oct 2026 21:04
74 lines
3318 bytes
In article <11bj186$30n6f$1@dont-email.me>,
Arne Vajhøj <arne@vajhoej.dk> wrote:
>On 10/23/2026 9:59 PM, Dan Cross wrote:
>> With the disclaimer that I've never really used PHP other than
>> playing around once or twice, I kind of remember that it could
>> use backticks to perform command substitution, like Perl or a
>> Unix shell.  My guess is that if user input had `cmd` in it and
>> was interpolated into a print statement or something without
>> escaping, it would run a command and interpolate the output
>> into whatever it printed.
>
>Backticks can be used as short form for calling shell_exec.

Yes.

>$ type dan.php
><?php
>$cmd = 'show def';
>echo "bla `$cmd` bla\n";
>$dd1 = shell_exec($cmd);
>echo $dd1;
>$dd2 = `$cmd`;
>echo $dd2;
>?>
>$ php dan.php
>bla `show def` bla
>   DISK2:[ARNE]
>   DISK2:[ARNE]
>
>> It's probably true that a language like PHP shouldn't have that
>> kind of thing built into it.  But it's also true that that's a
>> programming error (failure to sanitize one's input).
>
>Practically every technology provide a way to execute external
>commands.

Indeed, but the danger isn't the mechanism, it is the specific
implementation.  PHP is very often used to build applications
that are exposed to all kinds of untrusted inputs.  Backticks in
an environment where much input is untrusted, for example, seem
unnecessarily permissive.

term% php
<?php
$cmd='`pwd`';
echo $cmd;
eval("echo $cmd;");
?>
`pwd`/home/cross
term% 

Sure, its a cheat to use `eval` here, but maybe interpolation of
backticks should not be allowed anywhere except an assignment,
and perhaps PHP shouldn't have an `eval`.

>Having a short form like PHP backticks is probably unique.

No, that syntax comes from the Unix shell by way of Perl.

And there are other historical antecedents; consider `ADDRESS
CMS` in Rexx on VM/CMS, for example.  Sometimes these are
useful: the ability to `ADDRESS XEDIT` made REXX programs
extremely powerful in that environment.  But letting untrusted
sending commands derived from unfiltered, untrusted, inputs
would be dangerous.

>But it is really just a shell_exec call.
>
>And of course input to that type of function should be checked.

Yup.

	- Dan C.
Technical Details
Message-ID: <11bj6gh$mru$1@reader2.panix.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
References: <11bcbi1$k068$1@dont-email.me> <nk2bhaF5j2sU1@mid.individual.net> <11bh3ei$19g$1@reader2.panix.com> <11bj186$30n6f$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cross@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.os.vms
Subject: Re: Re: ‘This Is Not a Drill’: Critical PHP Vulnerabilities Are Setting the Internet on Fire
Date: Sat, 24 Oct 2026 21:04:17 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <11bj6gh$mru$1@reader2.panix.com>
References: <11bcbi1$k068$1@dont-email.me> <nk2bhaF5j2sU1@mid.individual.net> <11bh3ei$19g$1@reader2.panix.com> <11bj186$30n6f$1@dont-email.me>
Injection-Date: Sat, 24 Oct 2026 21:04:17 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
	logging-data="23422"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)