<div dir="ltr">Mike -<div><br></div><div>"<font face="arial, sans-serif">Have fun rewriting your code for PHP 5.4 and later releases, by the way." - you really are a bit passive aggressive aren't you.</font></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font face="arial, sans-serif">Needless to say, thank you for your thoughts. I genuinely appreciate them. I have learned a few things here today, which is the whole reason I monitor (but rarely jump into) the discussions here. Much appreciated.</font></div>
</div><div class="gmail_extra"><br clear="all"><div><div><b><br></b></div><div><b>--</b></div><div><b>Andy Borgmann</b><br><br><div>E-mail: <a href="mailto:andy@borgmann.me" target="_blank"><font color="#990000">andy@borgmann.me</font></a> <br>
Cell Phone: <font color="#990000">(404) 492-6527</font> </div><div>Personal Website: <a href="http://andy.borgmann.me/?r=email" target="_blank"><font color="#990000">http://andy.borgmann.me/</font></a></div>
<div><br>"<i>Preach the Word; be prepared in season and out of season; correct, <br>rebuke and encourage - with great patience and careful instruction.</i>" - 2Timothy 4:2</div></div></div>
<br><br><div class="gmail_quote">On Mon, Jul 22, 2013 at 10:36 AM, Michael B. Trausch <span dir="ltr"><<a href="mailto:mbt@naunetcorp.com" target="_blank">mbt@naunetcorp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div class="im">
<div>On 07/22/2013 10:15 AM, Andy Borgmann
wrote:<br>
</div>
<blockquote type="cite">
<div>No need to get defensive. I am not "minding" you, and I am
sure you are a great programmer and have more experience than
me. My only point in this is that PHP is not inherently
insecure. Not saying it is better than C or Java or Python.
All I am saying is that the security flaws in PHP have more to
do with poorly written code that is publicly viewable to the
world than the system itself, and that the examples provided
thus far haven't convinced me that it is any less secure than I
originally knew other than less qualified people use it due to
the low barrier of entry.</div>
</blockquote>
<br></div>
On a technical level, you are correct.<br>
<br>
On a practical level, the only way to secure the web of PHP
applications that are out there that would have any chance at being
effective would be to remove PHP's automatic-screw-yous (e.g., the
array one is particularly bad if you've ever been bitten by it—and
you'll never, ever forget it if you do get bit by it, either) as
well as remove its bad ideas.<br>
<br>
For example, there should be a standard, inbuilt method for creating
secure SQL queries, and you should have to go out of your way to
bypass it. IOW, secure by default. There is, sort of, but the
defaults are still "whatever you want". C# fixed this problem in
its world by creating an extension to the language that maps
directly to database queries (and it actually was developed for
security sake, but it seems to create far better queries than most
humans do by default, so in that case, security caused a performance
benefit, too).<div class="im"><br>
<br>
<blockquote type="cite">
<div>And I would very much be interested in what you know about
HipHop, because everything I have read about it and looked into
relates to performance, not security.</div>
</blockquote>
<br></div>
It's been three or four months since I spent any time looking at
it. I've come back to looking into it with every PHP project I have
done, including the current one. However, the base requirements for
the project I'm on, once they were decided, excluded HPHP for
technical reasons (the base cannot be compiled with it).<br>
<br>
Among the things that weren't supported the last time I checked it
out, and I <i>believe</i> are still unsupported (and these are the
overlapping ones—both technically difficult and insecure):<br>
<ul>
<li>eval—which shouldn't really ever be used anyway, as it allows
injection to occur upon the compromise of any system trusted to
inject via that method.</li>
<li>dynamic includes—With truly bad code, there is no way to avoid
them. Such code cannot ever be compiled by HPHP because the
very thing it depends on does not exist. (They do appear to
have a new mode that runs in a VM that might allow it, but
whether they enabled such functionality or not is not easily
discoverable and I'd have to check it out to test it.) Dynamic
includes are worse than most people realize because they almost
never realize just how easy it is to attack and trick a PHP
system into including things outside of the app's control.</li>
</ul>
Namespaces weren't implemented, either, the last time I checked, but
that was because they hadn't gotten around to adding support for PHP
5.3 yet. Those are a great security feature, too.<div class="im"><br>
<br>
— Mike<br>
<br>
<div>-- <br>
<table border="0">
<tbody>
<tr>
<td> <img src="cid:part1.06010909.05070705@naunetcorp.com" alt="Naunet Corporation Logo"> </td>
<td> Michael B. Trausch<br>
<br>
President, <strong>Naunet Corporation</strong><br>
☎ <a href="tel:%28678%29%20287-0693%20x130" value="+16782870693" target="_blank">(678) 287-0693 x130</a> or <a href="tel:%28888%29%20494-5810%20x130" value="+18884945810" target="_blank">(888) 494-5810 x130</a><br>
<br>
</td>
</tr>
</tbody>
</table>
</div>
</div></div>
<br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br></div>