It seems like the answer is basically taint checking, which has been known about for a long time (TTBOMK it was in the original Perl 5, and maybe before).