oss-sec mailing list archives

Re: Shell wildcards considered dangerous?


From: Heiko Schlittermann <hs () schlittermann de>
Date: Mon, 9 Dec 2019 15:58:02 +0100

Georgi Guninski <gguninski () gmail com> (Mo 09 Dez 2019 14:23:16 CET):
====
$rm -rf /tmp/1 ;mkdir /tmp/1 ; cd /tmp/1 ; tar cf a.tar /etc/issue
$ : >  --to-command="yes .tar"

#end creating, starts PoC
tar xf *.tar

That's not a technical fault. It's a fault on the human side.

If you call the above command in a typical Bourne shell, you should be
prepared to handle the trouble. Smart admins don't do that.

If an application calls the above command via system(), you should
file a bug against that application. Smart programmers know how to
avoid the shell for such invocations (or avoid such invocations in the
first place.)


    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
--
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: F69376CE -
 ! key id 7CBF764A and 972EAC9F are revoked since 2015-01 ------------ -

Attachment: signature.asc
Description:


Current thread: