ENV and BASH_ENV give the names of files that are executed when a new shell is started. Someone could point one of those to a file full of evil commands.
CDPATH gives a search path for the cd command. Changing that could make shell scripts switch into unexpected directories.
IFS gives a list of "internal field separators", which the shell treats like spaces. Here's a link that tells how to exploit this feature.
Yeah, they have to do with the shell. If you call any external programs, can you be absolutely certain that none of them will invoke a shell?
I doubt that this is a complete list of problem environment variables. It's probably best to delete everything you aren't sure is safe.
%ENV = map { ($_, $ENV{$_}) }
grep exists($ENV{$_}), qw(THIS THAT THE_OTHER);
...or something of that sort. Anyone have any suggestions of environment variables that will cause problems if they aren't kept? TERM? USER? HOME?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.