<?xml version="1.0" encoding="windows-1252"?>
<node id="1002106" title="Re^3: Taint mode limitations" created="2012-11-03 10:51:51" updated="2012-11-03 10:51:51">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;
My issue is that Perl tries to "guess" when I have looked at the the input ("gee, the programmer captured some match groups from a regexp match on that input, so it MUST mean that he sanitized it"), instead of letting me tell it when I think I have looked at it closely enough (for example, but invoking a method untainted() on a variable).
&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;Perl isn't "guessing". It is following the clearly laid out rule for 'detainting'. That is:

&lt;blockquote&gt;&lt;i&gt;
Perl presumes that if you reference a substring using $1, $2, etc., that you knew what you were doing when you wrote the pattern. 
&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;And it goes on to say:

&lt;blockquote&gt;&lt;i&gt;
That means using a bit of thought--don't just blindly untaint anything, or you defeat the entire mechanism. 
&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;That may not be how &lt;i&gt;you think it should work&lt;/i&gt;; but it is the way it &lt;b&gt;does work&lt;/b&gt;. For better or worse.

&lt;P&gt;You can try putting forwards your arguments for a different -- presumably better in your eyes -- way of working; but given how long the current mechanism has been in place; that the mechanism is -- has to be -- deeply embedded within the Perl core; and the historic convention that says Perl does not break backward compatibility; and the net result is that you will have to learn to live with what is; because it is very unlikely to change at this point in time.


&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;p align=right&gt; [http://thebottomline.cpaaustralia.com.au/|RIP Neil Armstrong]&lt;/p&gt;&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1001997</field>
<field name="parent_node">
1002102</field>
</data>
</node>
