The first time, I force taint mode, to show the message when taint is active. The second time, I run it again without forcing taint mode, and it shows that it runs without giving me the insecure-path message. This plainly shows that it's not automatically forcing taint mode just because the version of perl is above 5.26. In the other topic you mentioned, you said you were in a 'use CGI' environment. Depending on how your webserver is set up, your real and effective user and/or group ids may be different, which would trigger automatic taint mode, as corion said much earlier in this conversation. My webserver does not, as I just checked by running:C:> perl -TE "say $^V; say qq/Taint mode: ${^TAINT}/; system(qq/notepa +d++.exe --help/)" v5.32.1 Taint mode: 1 Insecure $ENV{PATH} while running with -T switch at -e line 1. C:> perl -E "say $^V; say qq/Taint mode: ${^TAINT}/; system(qq/notepad +++.exe --help/)" v5.32.1 Taint mode: 0
inside a script. If I run normally, the last line prints 'Taint? 0' , whereas if I add -T to the shebang in my CGI script, that last line prints 'Taint? 1' , so I know that it can properly identify taint mode. So you should use the '${^TAINT}' to verify that you really are in taint mode. And use the real/effective group and user id variables to confirm what those are set at, to see if one of those is your culprit. Also, you have not shown us a Short, Self-Contained, Correct Example which replicates your tainted results when you don't think you should be in taint, showing that code without taint errors in pre-5.26 will show a taint error in post-5.26, without you intentionally enabling taint mode. Can you share such an SSCCE?print "Real Group: $(\n"; print "Effective Group: $)\n"; print "Real User: $<\n"; print "Effective User: $>\n"; print "Taint? ${^TAINT}\n";
... which is why I switched to 'system' instead. So it may be that hippo's qx experiment wasn't sufficient, though I don't expect the non-forced-taint-mode results to change, even if hippo changes over to 'system' instead of 'qx' . edit: clarified/reworded footnoteC:> perl -TE "use warnings; use strict; say $^V; say qq/Taint mode: ${ +^TAINT}/; qx/notepad++.exe --help/" v5.32.1 Taint mode: 1
In reply to Re^12: How to disable taint checking by Perl?
by pryrt
in thread How to disable taint checking by Perl?
by dissident
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |