RE: shell variable security

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> We have all heard about security problems with shell variables

Can some one post a test case that exploits this?  While I understand the issue that the OP addressed, I can't seem to write a shell script that exploits this. Take this sample script:

while read line; do
  foo=`echo $line`
  echo $foo
done

if I run it and enter something like "Jon; date" it just echos it back. The date command does not executed.  If I run the script with the -x argument, it looks like this:

$ bash -x x.sh
+ read line
Jon; date
++ echo 'Jon;' date
+ foo='Jon; date'
+ echo 'Jon;' date
Jon; date
+ read line

It looks like the shell is putting single quotes around the ';'. I really believe that what the OP asked about is a problem, I just can't seem to generate a test case that illustrates it.

<<winmail.dat>>

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux