in reply to Taint and Shellshock
Is there any good reason to not wipe the whole %ENV hash before an external call in web context?
Of course not. I'd localize %ENV and set it up with reasonable defaults before shelling out:
{ local %ENV = ( PATH => '/bin:/usr/bin:/usr/local/bin", IFS => " \t\n", LOGNAME => $ENV{LOGNAME}, # propagate values known to be secur +e ... } ... system( ... ) }
update: corrected IFS} to IFS, addded propagation of secure ENV variables
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Taint and Shellshock
by kennethk (Abbot) on Sep 27, 2014 at 17:17 UTC |