← Back to context

Comment by blueflow

6 months ago

[flagged]

I think you missed the original point, which is that joining argv is equivalent to

    sh -c "$1 $2 $3 $4 ..."

This is a form of shell injection, just like

    sh -c "ls $dir"

because there's interpolation WITHOUT escaping.

That should be:

    dir=$(escape "$dir")
    sh -c "ls $dir"

Or simply

    ls "$dir"

It's not my preconception -- it's a security problem.

It's similar to ShellShock -- you can argue it was documented behavior, but it's still a security problem.