<span style="font-family: courier new,monospace;">Problem:</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">I&#39;m providing a mechanism so that a system can be configured<br>
to &#39;run&#39; executables</span><span style="font-family: courier new,monospace;"> on remote machines based on configuration<br>information submitted in a CGI text field.</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Obviously I don&#39;t want to allow the user to trash the system.</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">I&#39;m going to:</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">1/ restrict the system to allow it to only execute &#39;trusted&#39; apps<br>
&nbsp;&nbsp; located in a &#39;known&#39; directory. (can I make a chroot jail in Perl/CGI?)<br><br style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">2/ strip characters from the invocation string that could be used to hurt me:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp; &nbsp; semicolon - because another malicious command could follow<br>&nbsp;&nbsp;&nbsp; backtic&nbsp;&nbsp; - because that could run another program<br>&nbsp;&nbsp;&nbsp; ( )&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - because that could invoke a sub-shell to run ...<br>
&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - because that could invoke ...<br>&nbsp;&nbsp;&nbsp; &amp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - because other stuff might follow<br>&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - because that could clobber an important file<br><br>&nbsp;&nbsp;&nbsp; any \0xxx string that represents any of the above &#39;nasty&#39; characters.<br>
<br>Tainging only talks about the concept, not what to de-taint.<br><br>- Are there any other things I should check for/prevent?<br>- Is there any standard/common resource on the web that you<br>&nbsp; know of that talks about this (that I haven&#39;t found yet)?<br>
<br>TIA<br>Fulko<br><br><br style="font-family: courier new,monospace;"></span>