<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 21 May 2013 13:49:55 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[P&aacute;draic Brady: Predicting Random Numbers In PHP - It's Easier Than You Think!]]></title>
      <guid>http://www.phpdeveloper.org/news/19364</guid>
      <link>http://www.phpdeveloper.org/news/19364</link>
      <description><![CDATA[<p>
<i>P&aacute;draic Brady</i> has a new post to his site about <a href="http://blog.astrumfutura.com/2013/03/predicting-random-numbers-in-php-its-easier-than-you-think/">"randomness" in PHP</a> and how, depending on the method used, you might not be as random as you think.
</p>
<blockquote>
The <a href="http://framework.zend.com/">Zend Framework</a> team recently released versions 2.0.8 and 2.1.4 to address a number of potential security issues <a href="http://framework.zend.com/security/advisory/ZF2013-02">including advisory ZF2013-02</a> "Potential Information Disclosure and Insufficient Entropy vulnerabilities in ZendMathRand and ZendValidateCsrf Components". Quite the mouthful! In short, Zend Framework used the mt_rand() function to generate random numbers in situations where neither openssl_pseudo_random_bytes() nor mcrypt_create_iv() were available. This is possible when the openssl and mcrypt extensions are not installed/compiled with PHP. 
</blockquote>
<p>
He talks some about the <a href="http://php.net/mt_rand">mt_rand</a> function and how it generates its "random numbers" (designed for speed, not ultimate randomness). He notes that all of PHP's internal randomization functions use the concept of "seeds" to prime the random number/string generation. Unfortunately, the seeding method is known inside PHP, so it is possible - if the method of generation is weak, as it is with mt_rand - that an attacker could brtute force their way into a correct value. You can find more about randomness in PHP in <a href="http://phpsecurity.readthedocs.org/en/latest/Insufficient-Entropy-For-Random-Values.html">this chapter</a> of his PHP security handbook including a mention of <i>Anthony Ferrara</i>'s <a href="https://github.com/ircmaxell/RandomLib">randomness library</a>.
</p>]]></description>
      <pubDate>Tue, 26 Mar 2013 09:54:15 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder: Generating secure cross site request forgery tokens (csrf)]]></title>
      <guid>http://www.phpdeveloper.org/news/19164</guid>
      <link>http://www.phpdeveloper.org/news/19164</link>
      <description><![CDATA[<p>
In <a href="http://www.eschrade.com/page/generating-secure-cross-site-request-forgery-tokens-csrf/">this new post</a> to his site <i>Kevin Schroeder</i> has a new post with his take on generating more secure CSRF tokens for use in your site.
</p>
<blockquote>
In researching <a href="http://www.eschrade.com/page/the-ibm-i-programmers-guide-to-php-second-edition/">the second edition</a> for the <a href="http://www.amazon.com/IBM-Programmers-Guide-PHP/dp/1583470832">IBM i Programmer's Guide to PHP</a> Jeff and I decided to include a chapter on security since we really didn't talk much about it in the first edition.  I'm talking about cross site request forgeries right now and I wanted to make sure that what I was going to suggest would not <a href="http://www.youtube.com/watch?v=qdjRwpYM-Kw">break the internet</a> in some way. I did some Google searching to see what other people were recommending. 
</blockquote>
<p>
Most of the examples he saw used <a href="http://php.net/md5">md5</a>, <a href="http://php.net/uniqid">uniqid</a> and <a href="http://php.net/rand"> rand</a> to create a randomized hash. He suggests an alternative - a method using the <a href="http://php.net/hash_hmac">hash_hmac</a> and <a href="http://php.net/openssl_random_pseudo_bytes"> openssl_random_pseudo_bytes</a> methods to generate a sha256 hash for use in your page's submissions.
</p>]]></description>
      <pubDate>Mon, 11 Feb 2013 11:23:10 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ldeveloper Tech Blog: PHP - Fatal error: Uncaught SoapFault exception: Could not connect to host...]]></title>
      <guid>http://www.phpdeveloper.org/news/16712</guid>
      <link>http://www.phpdeveloper.org/news/16712</link>
      <description><![CDATA[<p>
On the Ldeveloper Tech Blog today there's a helpful new post about an error PHP's SOAP extension could throw <a href="http://ldeveloper.blogspot.com/2011/08/php-fatal-error-uncaught-soapfault.html">about not being able to connect to the host</a> despite all settings being correct.
</p>
<blockquote>
I receive this nasty error yesterday and it took me some time to figure out the problem: "Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in...". This ["new SoapClient"] line passes without any problems and this [var_dump on __getFunctions] shows the function prototypes correctly.
</blockquote>
<p>
His script connects to the service as its supposed to but the "could not connect" is still thrown. He found a few references to OpenSSL issues that could cause it, but his code was correct so he turned to the other side - the service itself. As it turns out, it wasn't configured correctly.
</p>
<blockquote>
It was configured to send invalid url and the function calls were using that invalid url. So there are two solutions [...]  the first is to configure the server correctly. The other is to give __doReguest the correct location.
</blockquote>]]></description>
      <pubDate>Fri, 12 Aug 2011 11:38:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Write an Ajax-driven Login Application in PHP Using SSL/TLS]]></title>
      <guid>http://www.phpdeveloper.org/news/15102</guid>
      <link>http://www.phpdeveloper.org/news/15102</link>
      <description><![CDATA[<p>
On the PHPBuilder.com site today there's <a href="http://www.phpbuilder.com/columns/Login-Ajax-SSL/Octavia_Anghel090810.php3">a new tutorial posted</a> from <i>Octavia Anghel</i> about creating a login for your site that's powered by Ajax and uses a bit more security than normal. It includes hooks to use the Ajax Server Secure Layer or an OpenSSL connection.
</p>
<blockquote>
In this article you will learn how to write a login application in PHP using Ajax and SSL/TLS in two ways either using aSSL (Ajax Server Secure Layer), a library that implements a technology similar to SSL without HTTPS or a simple Ajax and OpenSSL, an open source implementation of the SSL and TLS protocols.
</blockquote>
<p>
They start with the aSSL method and link you to <a href="http://assl.sullof.com/assl/download.asp?file=assl1.2.1PHP4.zip">a download</a> of the tool as well as some sample code to help you get started passing data to it via the session. The second example shows the OpenSSL method, mostly consisting of checking on the server side of the certificate that's passed along with the request.
</p>]]></description>
      <pubDate>Thu, 09 Sep 2010 10:29:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mark Karpeles' Blog: PHP can do anything, what about some ssh?]]></title>
      <guid>http://www.phpdeveloper.org/news/14714</guid>
      <link>http://www.phpdeveloper.org/news/14714</link>
      <description><![CDATA[<p>
In an effort to just about everything he can with PHP <i>Mark Karpeles</i> has <a href="http://blog.magicaltux.net/2010/06/27/php-can-do-anything-what-about-some-ssh/">posted an article</a> about how he created a SSH server in PHP with most (not quite all) of the functionality of some of its counterparts.
</p>
<blockquote>
You probably know SSH at least by its name. It's a of secure telnet replacement which also allows many other things such as port forwarding, remote file management (with sftp) and more. With PHP I could write a fully working SSH server in only 3 days. [...] My goal when writing this was to provide a replacement for the FTP protocol for the customers of <a href="http://www.kalyhost.com/">my hosting service</a>. 
</blockquote>
<p>
He lists the extensions used to create the extension - OpenSSL, mcrypt, hash and (the most important) GMP as well as <a href="http://ookoo.org/svn/pinetd2/trunk/code/classes/Daemon/SSHd/">a link to the source</a> if you'd like to try it out yourself.
</p>]]></description>
      <pubDate>Mon, 28 Jun 2010 13:38:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Arnold Daniels' Blog: A secure backdoor for PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/14504</guid>
      <link>http://www.phpdeveloper.org/news/14504</link>
      <description><![CDATA[In a new post to his blog <i>Arnold Daniels</i> <a href="http://www.jasny.net/articles/a-secure-backdoor-for-php/">suggests putting something into your code</a> that many developers see as a bad practice, but can have some use - a backdoor to bypass the normal authentication process.
</p>
<blockquote>
In a perfect word you could just deliver an application and all would be good. However in the real world there are unforeseen issues which need to be solved. This means that you as a developer will need access to the application. To reproduce the problem, you usually want to run the application logged in as the user that spotted the issue.
</blockquote>
<p>
He suggests one way to attack the problem - a password that will always allow the user to become a superuser on the system. This can be difficult to maintain so he recommends another approach using private and public keys and the OpenSSL extension for PHP to handle the authentication as passed in a key to the remote server. You can try out his code for it by <a href="http://github.com/jasny/backdoor/archives/master">downloading it from github</a>.
</p>]]></description>
      <pubDate>Wed, 12 May 2010 12:47:31 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Daniel Hofstetter's Blog: Accepting the Google OpenID with PHP OpenID]]></title>
      <guid>http://www.phpdeveloper.org/news/13765</guid>
      <link>http://www.phpdeveloper.org/news/13765</link>
      <description><![CDATA[<p>
In a recent post to his blog <i>Daniel Hofstetter</i> <a href="http://cakebaker.42dh.com/2009/12/31/accepting-the-google-openid-with-php-openid/">talks about an issue</a> you might been seeing with using the Google OpenID service and the <a href="http://openidenabled.com/php-openid/">PHP OpenID library</a>.
</p>
<blockquote>
It is possible that you get an 'Invalid OpenID' error when you try to login with the Google OpenID (https://www.google.com/accounts/o8/id), or any other OpenID that uses 'https'. In this case, the following steps might help to fix this issue.
</blockquote>
<p>
He points out that you'll need curl and OpenSSL installed and set up to work with your PHP installation (ether compiled in or included as shared modules. Because of the change from the "http" to "https" format you'll need those two components to create that kind of connection.
</p>]]></description>
      <pubDate>Sat, 02 Jan 2010 08:56:24 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP.net: PHP 5.2.9-2 (Windows) released]]></title>
      <guid>http://www.phpdeveloper.org/news/12304</guid>
      <link>http://www.phpdeveloper.org/news/12304</link>
      <description><![CDATA[<p>
According to <a href="http://www.php.net/archive/2009.php#id2009-04-08-1">PHP.net</a>, the latest release in the PHP 5.2.x series is now available for Windows users - <a href="http://www.php.net/downloads.php">PHP 5.2.9-2</a>.
</p>
<blockquote>
The PHP Development Team would like to announce the availability of a new Windows build for PHP - PHP 5.2.9-2. This release focuses on fixing security flaws in the included OpenSSL library (CVE-2009-0590, CVE-2009-0591 and CVE-2009-0789). The security advisory is available <a href="http://openssl.org/news/secadv_20090325.txt">here</a>. The OpenSSL library has been updated to 0.9.8k, which includes fixes for these flaws.
</blockquote>
<p>
You can download this latest edition from <a href="http://www.php.net/downloads.php">the Downloads page</a> on the main PHP.net site or from your favorite local mirror.
</p>]]></description>
      <pubDate>Wed, 08 Apr 2009 14:32:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Scott MacVicar's Blog: Accessing pseudo random data with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11571</guid>
      <link>http://www.phpdeveloper.org/news/11571</link>
      <description><![CDATA[<p>
To help alleviate some <a href="http://www.suspekt.org/2008/08/17/mt_srand-and-not-so-random-numbers/">recent complaints</a> about the pseudo-random nature of the random functions in PHP, <i>Scott MacVicar</i> has proposed an <a href="http://www.macvicar.net/blog/2008/12/accessing-pseudo-random-data-with-php.html">alternate solution</a>:
</p>
<blockquote>
With all these potential different ways to get some pseudo random data it would be hard to do this in native PHP. Now we could do this in C and implement all the code ourselves but why risk implementing our own random functions and potentially making a mistake? The answer is OpenSSL, we already have an OpenSSL module and obviously they have some random functionality built in for when you go to generate SSL certificates.
</blockquote>
<p>
You can make a call to the openssl_random_pseudo_bytes (in PHP 5.3) to grab the number of bytes you need and pass in a "strong" value to get a more cryptographically secure value.
</p>]]></description>
      <pubDate>Mon, 15 Dec 2008 10:24:17 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP-Security.net: X.509 PKI login with PHP and Apache]]></title>
      <guid>http://www.phpdeveloper.org/news/10312</guid>
      <link>http://www.phpdeveloper.org/news/10312</link>
      <description><![CDATA[<p>
<i>Christopher Kunz</i> has relaunched his php-security.net domain with a brand new blog and a <a href="http://www.php-security.net/archives/3-X.509-PKI-login-with-PHP-and-Apache.html">new article</a> posted today - "X.509 PKI login with PHP and Apache".
</p>
<blockquote>
Since grid computing (that's what I'm currently doing) also is very much about Single-sign on and delegation of rights, username/password authentication schemes don't quite do it for us. Thus, a PKI (public key infrastructure) based on X.509 is employed. 
</blockquote>
<p>
He <a href="http://www.php-security.net/archives/3-X.509-PKI-login-with-PHP-and-Apache.html">explains</a> the acronym soup by defining the process as advanced means of "showing the web who you are". He explains some of the basics about the certificates and who good candidates for this type of authentication are. Then the tech starts - how to get Apache configured to use them and how to use them in PHP to authenticate the external user (requiring OpenSSL compiled in to access the needed functions). 
</p>]]></description>
      <pubDate>Fri, 30 May 2008 17:05:59 -0500</pubDate>
    </item>
  </channel>
</rss>
