In the documentation for postfix, there is the statement:
Of course, Postfix programs do not trust data received from the
network, either. In particular, no Postfix program places
sender-provided data into shell command lines or into environment
variables. If there is one lesson that people have learned from Web
site security disasters it is this one: don't let any data from the
network near a shell.
I can understand the aversion to putting random stuff into the commandline
of a program, but I'm not sure I understand why it is bad to put random and
possibly hostile information into shell/environment variables. I can see
some pretty obvious dangers (evaling the variable or putting anything into
PATH, IFS or other important variables) but I can't see what the danger is
of putting something into a normal environment variable, so long as one treats
the variable with due caution.
For example, if I run a script like
#!/usr/bin/ksh
while read input
do
echo "$input"
done
as root from inetd, what am I exposing myself to? Sure, the badguy can
use memory on my machine, but otherwise? The above claim seems overly
paranoid and fishy to me.
chris