<?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>Sun, 19 May 2013 15:52:17 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Anthony Ferrara: Preventing CSRF Attacks]]></title>
      <guid>http://www.phpdeveloper.org/news/19207</guid>
      <link>http://www.phpdeveloper.org/news/19207</link>
      <description><![CDATA[<p>
<i>Anthony Ferrara</i> has written up a new post to his site looking at <a href="http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html">efective use of CSRF tokens</a> and a few different strategies for generating them.
</p>
<blockquote>
There's been a bit of noise in the past week about the proper way to prevent Cross-Site-Request-Forgery (CSRF) attacks. It seemed to have started with this post. There's been discussion in the comments, and on Twitter about it, and there seems to be several opposing viewpoints on the matter. I want to start off by saying that I agree completely with the post in question. But I figured I'd write a post to explain WHY I agree with it.
</blockquote>
<p>
He starts with an overview of a few of the common types of request forgery including from a javascript injection, a Man-in-the-Middle attack and a replay attack. He then breaks up the "lines of defense" part of the post into three different sections - adding a hidden token field to forms, changing the token for each request and using <a href="http://blog.ircmaxell.com/2011/07/random-number-generation-in-php.html">random numbers</a> when regenrating them.
</p>]]></description>
      <pubDate>Wed, 20 Feb 2013 09:36:41 -0600</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[PHPMaster.com: 8 Practices to Secure Your Web App]]></title>
      <guid>http://www.phpdeveloper.org/news/19131</guid>
      <link>http://www.phpdeveloper.org/news/19131</link>
      <description><![CDATA[<p>
PHPMaster.com has posted a new article with some <a href="http://phpmaster.com/8-practices-to-secure-your-web-app/">high level security tips</a> and reminders for PHP developers when wanting to help prevent issues with their applications. The article provides eight tips, each with a brief description.
</p>
<blockquote>
When it comes to application security, in addition to securing your hardware and platform, you also need to write your code securely. This article will explain how to keep your application secure and less vulnerable to hacking.
</blockquote>
<p>
The good practices they recommend include input data validation, protecting against XSS attacks, preventing SQL injections, protecting session data, proper error handling and protecting included files. There's some good reminders here, but it barely scratches the surface of effectively protecting your application. These tips are the "low hanging fruit" for securing your app, so be aware that there's more things to worry about than just these eight.
</p>]]></description>
      <pubDate>Mon, 04 Feb 2013 12:56:40 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Anson Cheung: Top 6 security attacks in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/18341</guid>
      <link>http://www.phpdeveloper.org/news/18341</link>
      <description><![CDATA[<p>
<i>Anson Cheung</i> has <a href="http://www.ansoncheunghk.info/article/top-6-security-attacks-php">posted about some security attacks</a> (six of them) that you need to watch out for when developing your apps.
</p>
<blockquote>
Be aware of the most common security threats to PHP applications is the important step to secure your PHP scripts may not be immune.  Here, the article is going to go over top 6 common security threads in PHP scripts. You may familiar with this, if not, this is a good time for you to read and keep in mind.
</blockquote>
<p>The top six on his list are:</p>
<ul>
<li>SQL Injection
<li>Cross-Site Scripting (XSS)
<li>Session fixation
<li>Session capturing/hijacking
<li>Cross-Site Request Forgeries (CSRF)
<li>Code Injection
</ul>
<p>
For each item, he includes a bit of explanation as to what the issue is and a common solution as to how to prevent it.
</p>]]></description>
      <pubDate>Thu, 09 Aug 2012 17:03:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Henrik Bj&oslash;rnskov's Blog: Symfony2: Add Cross Site Request Forgery protection to login forms]]></title>
      <guid>http://www.phpdeveloper.org/news/17326</guid>
      <link>http://www.phpdeveloper.org/news/17326</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Henrik Bj&oslash;rnskov</i> has a tip on <a href="http://henrik.bjrnskov.dk/symfony2-cross-site-request-forgery/">preventing cross-site request forgeries</a> in your Symfony2 forms with the help of a simple Symfony2 configuration setting.
</p>
<blockquote>
When talking with <a href="http://twitter.com/jmikola">@jmikola</a> on #Symfony-dev this afternoon we got into the subject of cross site request forgery and symfony2 login forms. And it seems that form-login already supports this but neither of us knew how it worked. So here is another quick tip. This time about securing you login form from cross site attacks.
</blockquote>
<p>
The key is to define a "csrf_provider" in your security.yml config file and point it to the "form.csrf_provider" provider. He also includes the controller and view code/templating you'll need to get the token included in the form (and validated).
</p>]]></description>
      <pubDate>Fri, 30 Dec 2011 10:28:42 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Preventing Cross-Site Request Forgeries]]></title>
      <guid>http://www.phpdeveloper.org/news/16920</guid>
      <link>http://www.phpdeveloper.org/news/16920</link>
      <description><![CDATA[<p>
SitePoint' PHPMaster.com has a new tutorial posted today from <i>Martin Psinas</i> about some tactics to <a href="http://phpmaster.com/preventing-cross-site-request-forgeries/">prevent cross-site request forgeries</a> from happening in your PHP application. The article introduces key concepts of CSRF and how you can keep it from happening in your code.
</p>
<blockquote>
Cross-site request forgery (CSRF) is a common and serious exploit where a user is tricked into performing an action he didn't explicitly intend to do. This can happen when, for example, the user is logged in to one of his favorite websites and proceeds to click a seemingly harmless link. In the background, his profile information is silently updated with an attacker's e-mail address. [...] Any action that a user is allowed to perform while logged in to a website, an attacker can perform on his/her behalf, whether it's updating a profile, adding items to a shopping cart, posting messages on a forum, or practically anything else.
</blockquote>
<p>
He shows it to you "in action" with a PHP script for a basic login page that takes a username and password, does some filtering and sets the username to the session. Their "harmless.html" file offers a link to the site's "process" page with a logout action that would allow the "harmless" file access to the current session if clicked. To prevent this from happening, they suggest a unique token be included in interactions on your site. This key is checked against a token in the current session (or other location) and is only valid if they match. 
</p>
<p>
The Symfony framework has <a href="http://www.google.com/#sclient=psy-ab&hl=en&source=hp&q=symfony+csrf">included this as a part of their forms</a> for a while now and includes automatic handling to check its validity. Solutions also exist for other frameworks like <a href="http://www.google.com/#sclient=psy-ab&hl=en&source=hp&q=zend+framework">Zend Framework</a> and many others.
</p>]]></description>
      <pubDate>Wed, 28 Sep 2011 10:12:11 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Nitschinger's Blog: Securing Lithium Forms]]></title>
      <guid>http://www.phpdeveloper.org/news/16443</guid>
      <link>http://www.phpdeveloper.org/news/16443</link>
      <description><![CDATA[<p>
<i>Michael Nitschinger</i> has a new post to his blog today showing how you can <a href="http://nitschinger.at/Securing-Lithium-Forms">secure the forms in Lithium</a> using the handy CSRF token implemented directly in the framework.
</p>
<blockquote>
CSRF (Cross-Site-Request-Forgery) attacks work by sending arbitary (form) requests from a victim. Normally, the receiving site (in our case the Controller who processes the form data) doesn't know where the data comes from. The CSRF protection in Lithium aims to solve this problem in an elegant and secure way. You can read more about those attacks <a href="http://shiflett.org/articles/cross-site-request-forgeries">here</a>. Note that you'll need to clone the latest master branch of Lithium if you want to try it out now.
</blockquote>
<p>
There's two parts to the protection, one on either side of things - a field in the form output and a check in the controller to see if the submitted value is correct. He includes code for a simple form (a title field and submit button) that lazy loads the Security helper and generates the token for you. He walks through the controller side of things a line at a time and includes a sample logging/forwarding bit in the second example to redirect users when the CSRF check doesn't pass.
</p>]]></description>
      <pubDate>Wed, 08 Jun 2011 12:03:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Protect a CodeIgniter Application Against CSRF]]></title>
      <guid>http://www.phpdeveloper.org/news/16238</guid>
      <link>http://www.phpdeveloper.org/news/16238</link>
      <description><![CDATA[<p>
In a recent post to NetTuts.com, they show you how to protect your CodeIgniter application from cross-site request forgery (CSRF) attacks by <a href="http://net.tutsplus.com/tutorials/php/protect-a-codeigniter-application-against-csrf/">using tokens in your forms and pages</a> to make things more "one time" and unique to the site.
</p>
<blockquote>
In today's tutorial, we will learn how to painlessly protect your CodeIgniter (pre 2.0) application against <a href="http://en.wikipedia.org/wiki/Cross-Site_Request_Forgery">Cross-Site Request Forgery</a> attacks. The library we'll be creating today will automate all of the protection mechanisms, making your site stronger and more secure. 
</blockquote>
<p>They've broken it up into a few different sections to dole it out in easy to follow chunks:</p>
<ul>
<li>Understanding the Attack Vector
<li>Planning
<li>Token Generation
<li>Token Validation
<li>Inject Tokens into the Views
<li>Hooks
</ul>
<p>
You can also <a href="http://nettuts.s3.amazonaws.com/965_csrfCI/source.zip">download the full source</a> of the library.
</p>]]></description>
      <pubDate>Fri, 22 Apr 2011 12:52:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Paul Reinheimer's Blog: Stop Messing up CSRF Protection]]></title>
      <guid>http://www.phpdeveloper.org/news/11374</guid>
      <link>http://www.phpdeveloper.org/news/11374</link>
      <description><![CDATA[<p>
In <a href="http://blog.preinheimer.com/index.php?/archives/283-Stop-Messing-up-CSRF-Protection.html">his latest post</a> <i>Paul Reinheimer</i> looks at cross-site request forgeries and, despite the best efforts of the PHP security community, how developers still just miss the point in protecting their own code.
</p>
<blockquote>
So, cross site request forgeries are a pretty common topic these days; they're in almost every security talk, book, site etc. This is okay; they're important [...] Most of the sites, and all of the books I've read demonstrate things correctly, but when it comes to actual implementation, time and time again, I see code that's just wrong.
</blockquote>
<p>
He looks at two of the "essentials" when it comes to protecting you and your application - comparison (not taking other values of variables into account) and the unpredictable token (not making tokens, like md5 hashes of information, random enough).
</p>]]></description>
      <pubDate>Mon, 10 Nov 2008 08:47:53 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: How to CSRF protect all your forms]]></title>
      <guid>http://www.phpdeveloper.org/news/11227</guid>
      <link>http://www.phpdeveloper.org/news/11227</link>
      <description><![CDATA[<p>
<i>Jani Hartikainen</i> has <a href="http://codeutopia.net/blog/2008/10/16/how-to-csrf-protect-all-your-forms/">posted a few ideas</a> on cross site request forgeries in a new blog entry, including some methods to help prevent it in your application.
</p>
<blockquote>
CSRF, or Cross-Site Request Forgery, is a vulnerability very common in websites. [...] This can be dangerous, especially if your admin interface is compromised: There may be a button on the other site which goes to your admin interface and deletes the latest blogpost for example - and you wouldn't want that!
</blockquote>
<p>
His method is a three-step process for protection - use POST, protect against cross-site scripting and use a CSRF key in the form to help prevent abuse. A simple script is included to show it working and is adapted to work in a <a href="http://codeutopia.net/code/library/CU/Controller/Plugin/CsrfProtect.php">controller plugin</a> for the Zend Framework.
</p>]]></description>
      <pubDate>Thu, 16 Oct 2008 12:07:26 -0500</pubDate>
    </item>
  </channel>
</rss>
