On 10/30/2026 5:56 PM, Dan Cross wrote:
> In article <11c2…@dont-email.me>, > Arne Vajhøj <ar…@vajhoej.dk> wrote:
>> On 10/28/2026 1:22 PM, Dan Cross wrote:
>>> In article <11br…@dont-email.me>, >>> Arne Vajhøj <ar…@vajhoej.dk> wrote:
>>>> On 10/24/2026 8:45 PM, Dan Cross wrote:
>>>>> B) you are comparing >>>>> interfaces that are designed for _explicit_ use in controlled >>>>> ways with one designed to easily interpolate values that are >>>>> ambient *in the lexical context of the invoking code*. One is >>>>> significantly _easier_ to misuse than the other. Because that >>>>> language is also designed to process inherently untrusted data, >>>>> it must be used with significant care; yet it is positioned as >>>>> the easy-to-use beginners language. That's a dangerous mix.
>>>> I can not follow. >>>> >>>> Let me show some code. I will substitute Cobol with Fortran
>>> >>> No. You posted three code snippets that all do approximately >>> the same thing, but at the same time, failed to address the >>> substance of what i raised above. >>>
>>>> [snip] >>>> But I don't see any of the differences matter from a >>>> security perspective.
>>> >>> That was the point.
>> >> I showed that native languages had the same >> issue as PHP.
> > No, you really did not. You merely showed that other languages > can spawn programs using `LIB$SPAWN` or similar mechanisms.
That *is* the same issue as shell_exec in PHP.
> What you missed is that it is the unique combination of > anti-patterns manifest in PHP that make it dangerouus in this > regard.
The ability to execute shell commands is the ability to execute shell commands. No more no less.
> Consider this analogy: `strcpy()` is dangerous because you > cannot tell it how big the destination buffer is. `strlcpy()` > is much safer because you _do_ tell it the size of the > destination buffer, it promises to NUL-terminate the destination > (as long as size>0), _and_ it tells how much space the source > required, so that you can detect truncation. That doesn't mean > that it is perfectly safe, because you can still give it a bad > destination length; you _can_ call it with `SIZE_MAX`, but most > programmers do not.
The analogy is whether C is less safe or as safe/unsafe as another language XYZ that has a let us say cpystr function with the same problem. And the answer is that C is as safe/unsafe as XYZ (in this regard).
>> And unlike with PHP there is no easy way to close the >> problem.
> > I doubt that disabling shell actually prevents you from calling > `LIB$SPAWN` via other means.
There is a list of functions able to spawn shell commands. I even think I listed them in another post. Disable them all and no spawn. Arne