🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.vms
Article #58

PHP "Features"

#58
From: Simon Clubley
Date: Sat, 24 Oct 2026 12:12
60 lines
3629 bytes
On 2026-10-23, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
> In article <nk2bhaF5j2sU1@mid.individual.net>,
> Bill Gunshannon  <bill.gunshannon@gmail.com> wrote:
>>
>>It was possible to get PHP to execute arbitrary commands
>>sent to it when it was used on the web.  I saw people
>>from outside the university doing things like listing
>>directories and uploading files containing potentially
>>dangerous code.
>>
>>And, no, I no longer have any of the examples.  It was
>>possible to tighten security up to stop it but that also
>>stopped things the professors and students wanted to do.
>>
>>I do  not now and would never consider using PHP for anything.
>
> 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.
>
> 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).
>

You are correct Dan that it had to be a programming error for that
to happen (it was not some builtin feature of PHP) but it is also
_way_ too easy to make silly programming errors in PHP.

Some simple examples:

1) Equality in PHP is loose equality "==" by default. You have to use
"===" to get strict equality. This leads to warnings like this scattered
throughout the PHP manual: (See the Return Values section.)

https://www.php.net/manual/en/function.fgetc.php

This is a great source of subtle errors. I don't like to see PHP code
that uses loose equality for this reason.

2) Things that should be errors are warnings and execution continues by
default unless you make the error reporting level more strict in your
code. I always use strict error reporting when I have to use PHP for
this reason.

3) mysqli_real_escape_string() doesn't always work:

https://www.php.net/manual/en/mysqli.real-escape-string.php

(See the Warning: section)

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: <11bi7bg$2mdi4$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11bcbi1$k068$1@dont-email.me> <nk1gv8F1eecU1@mid.individual.net> <11bgih8$f7a$1@reader2.panix.com> <nk2bhaF5j2sU1@mid.individual.net> <11bh3ei$19g$1@reader2.panix.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!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: PHP "Features"
Date: Sat, 24 Oct 2026 12:12:32 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <11bi7bg$2mdi4$1@dont-email.me>
References: <11bcbi1$k068$1@dont-email.me> <nk1gv8F1eecU1@mid.individual.net> <11bgih8$f7a$1@reader2.panix.com> <nk2bhaF5j2sU1@mid.individual.net> <11bh3ei$19g$1@reader2.panix.com>
Injection-Date: Sat, 24 Oct 2026 12:12:33 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2831940"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19GyIRkBUrKCL2sWrOqFgbs5uHzuR+LNgM="; posting-host="1e9a02f085dd22b13b91aa2e9ffbd165"
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:9SIIBXCB8z9+cHXCZNwjdE0X+dk= sha256:hIKwXsO7p7v+eUdePcNtZlRlnGHVONEGEIuKzLLM3wM=
	sha1:D8BXh8ft60nQab1rGWfrx0/4J4M= sha256:GDTv+yk1Vou9/eMpHba9x6M8rAbU+V2J+4AKd1RTdlw=