<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>Hi,</DIV><BR><DIV><DIV>On 29/01/2006, at 9:33 PM, Raphael Alla wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">If this script is called security.cgi, and you invoke it like this: hostname/security.cgi?sub_name, then it will call the sub sub_name (it is a call of sub by reference).<BR><BR>Potentially a user can call any sub from any module which it has available to it. It is seen as a bad habit to give the right to anyone on the internet to execute any sub on your system, yet I fail to find a practical threat coming from this specific construct. <BR><SPAN class="sg"><BR></SPAN></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Pointing to '<A href="http://localhost/test.cgi?what_is_my_password'">http://localhost/test.cgi?what_is_my_password'</A> would do the trick.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--- 8&lt; ---</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>#!/usr/bin/perl</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>print "Content-type: text/html\n\n";</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>my $sub = $ENV{'QUERY_STRING'};</DIV><DIV>&amp;{$sub};</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>sub what_is_my_password</DIV><DIV>{   </DIV><DIV>    print q{your password is '0wn3d'};</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--- &gt;8 ---</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>However, is this a practical threat? Not really since you are doing sanity checking. Aren't you ;)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Alfie </DIV><BR><BLOCKQUOTE type="cite"><SPAN class="sg">R.</SPAN><BR><BR><DIV><SPAN class="gmail_quote">On 1/29/06, <B class="gmail_sendername">David Dick</B> &lt;<A href="mailto:david_dick@iprimus.com.au">david_dick@iprimus.com.au</A>&gt; wrote:</SPAN> <BLOCKQUOTE class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><BR><BR>Raphael Alla wrote:<BR>&gt; *Let's condider the following perl cgi script. I cannot find a practical <BR>&gt; way to use it as a security hole. Any suggestion?<BR>&gt;<BR>&gt; *#!/usr/bin/perl<BR>&gt; my $sub = $ENV{QUERY_STRING};<BR>&gt; &amp;{$sub};<BR><BR>maybe i'm just a little tired after the weekend, but this script would <BR>appear to not do anything apart from cause an error. What are you trying<BR>to achieve?<BR><BR></BLOCKQUOTE></DIV><BR><BR clear="all"><BR>-- <BR>Raphael Alla<BR>Mitija Australia<BR>+61 4 15 678 576<BR><BR>Premium open source accounting for Australia <BR><A href="http://www.thetravelingaccountant.com">http://www.thetravelingaccountant.com</A><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Melbourne-pm mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Melbourne-pm@pm.org">Melbourne-pm@pm.org</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://mail.pm.org/mailman/listinfo/melbourne-pm">http://mail.pm.org/mailman/listinfo/melbourne-pm</A></DIV> </BLOCKQUOTE></DIV><BR></BODY></HTML>