<?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>Sat, 25 May 2013 02:03:02 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[P&aacute;draic Brady's Blog: Automatic Output Escaping In PHP & The Real Future Of Preventing XSS]]></title>
      <guid>http://www.phpdeveloper.org/news/18107</guid>
      <link>http://www.phpdeveloper.org/news/18107</link>
      <description><![CDATA[<p>
<i>P&aacute;draic Brady</i> has a new post to his blog about the <a href="http://blog.astrumfutura.com/2012/06/automatic-output-escaping-in-php-and-the-real-future-of-preventing-cross-site-scripting-xss/">state of output escaping in PHP</a> and the steps that need to be taken to help prevent and protect applications from the real threat of cross-site scripting.
</p>
<blockquote>
Automatic escaping has a certain appeal given its goal of removing the need to type escape() all over your templates. Funny thing, though, is that this is basically its one and only advantage. The second claimed goal is to remove a factor of human error (i.e. forgetting to type escape() somewhere), however, this hasn't posed an issue for me in the past where simple analysis of templates can quickly locate such omissions. And no, using automatic escaping does not remove the need to analyse templates for security issues - that's still needed regardless. 
</blockquote>
<p>
He goes on to define what "automatic escaping" is and isn't and how it relates to the context of the information (the same data may not always be filtered the same way in every place). He talks about scope-limited escaping, context-aware escaping and an idea that could help make life easier - a <a href="http://www.w3.org/TR/CSP/">content security policy</a> defining how the client should behave when interpreting HTML.
</p>]]></description>
      <pubDate>Mon, 18 Jun 2012 11:58:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[P&aacute;draic Brady's Blog: XSS in PHP (Part 1): How Not to Use Htmlspecialchars]]></title>
      <guid>http://www.phpdeveloper.org/news/17667</guid>
      <link>http://www.phpdeveloper.org/news/17667</link>
      <description><![CDATA[<p>
<i>P&aacute;draic Brady</i> has <a herf="http://blog.astrumfutura.com/2012/03/a-hitchhikers-guide-to-cross-site-scripting-xss-in-php-part-1-how-not-to-use-htmlspecialchars-for-output-escaping/">written up an exhaustive guide</a> to using <a href="http://php.net/htmlspecialchars">htmlspecialchars</a> correctly and securely in your applications (though it's technically how "not to use it"). This is part one of a series looking at preventing cross-site scripting in PHP applications.
</p>
<blockquote>
<p>
While it's no harm poking fun at ourselves, in PHP we do have a serious problem. Cross-Site Scripting (XSS) remains one of the most significant classes of security problems afflicting PHP applications. Despite years of education, community awareness and the development of frameworks which can offer a huge boost in consistent practices - things are not getting any better.
</p>
<p>
So, I finally figured out what the core problem is: PHP programmers are completely clueless about XSS. It's that simple. Instead of going out and studying the topic, we blindly follow some preferred herd of people offering advice with heartfelt conviction despite the fact that they are probably just as ignorant as the rest of us. Does that sound like the behaviour of something which allegedly evolved into an intelligent species? The result is a mix of ignorance and stagnant knowledge that leaves PHP in an unenviable position beset by wrongheaded zealots.
</p>
</blockquote>
<p>
He introduces the <a href="http://php.net/htmlspecialchars">htmlspecialchars</a> function and how it has been generally assumed a good method for presenting XSS attacks.   He talks about issues with quotes, problems that IE6 seems to have that no one else does and the all-important third parameter of the function (character set detection) and the optional fourth (decoding HTML entities automatically). 
</p>
<p>
He's created <a href="https://github.com/padraic/xss">this github repository</a> with the examples from the post.
</p>]]></description>
      <pubDate>Tue, 13 Mar 2012 12:44:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brandon Savage's Blog: An XSS Vulerability In The Making]]></title>
      <guid>http://www.phpdeveloper.org/news/17640</guid>
      <link>http://www.phpdeveloper.org/news/17640</link>
      <description><![CDATA[<p>
<i>Brandon Savage</i> has a new post to his blog about what he calls a <a href="http://www.brandonsavage.net/an-xss-vulerability-in-the-making/">XSS vulnerability in the making</a>, something to watch out for when you're doing validation in PHP involving the possibility of numbers as strings.
</p>
<blockquote>
Back in September, <a href="https://crash-stats.mozilla.org/">Socorro</a> received a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=689675">security bug</a> relating to the method we were using for processing inputs for the duration of certain reports. The vulnerability included a proof of concept, with an alert box popping up on production when the link was followed. [...] I was quite surprised at the root cause of the vulnerability. We had opted to compare the incoming data against a known set of valid values - a common practice when whitelisting certain inputs. [...] As expected, when this [example] code is tested, a string of '3' and an integer of 3 work equally well, and a string of '5' and an integer of 5 fail equally. 
</blockquote>
<p>
This automatic casting that PHP does internally caused another issue as well - if the string passed in even started with a valid number from their whitelist set, it still passed.
</p>
<blockquote>
At first we thought this surely had to be a bug in PHP. However, Laura Thomson told me "If comparing two values, type juggling is performed first, which means that the string is converted to a number. This is done by <a href="http://us2.php.net/manual/en/language.types.string.php#language.types.string.conversion">taking the first number found in the string</a>. So this may be confusing/a quirk/a gotcha, but it isn't a bug." And she's right: this isn't a bug per se, but it's certainly an interesting "gotcha."
</blockquote>]]></description>
      <pubDate>Wed, 07 Mar 2012 12:02:46 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DeveloperDrive.com: What Web Developers Need to Know About Cross-Site Scripting]]></title>
      <guid>http://www.phpdeveloper.org/news/17002</guid>
      <link>http://www.phpdeveloper.org/news/17002</link>
      <description><![CDATA[<p>
On the DeveloperDrive.com site there's a recent post anyone wondering about cross-site scripting should give a read. They <a href="http://www.developerdrive.com/2011/10/what-web-developers-need-to-know-about-cross-site-scripting/">introduce you to the basic concept</a> and two things you can do to help prevent them.
</p>
<blockquote>
This little fable describes the most common vulnerability found in web sites, the Cross Site Scripting (XSS) attack. According to a report from <a href="http://www.darkreading.com/security/app-security/showArticle.jhtml?articleID=221601529">WhiteHat Security</a> 83 percent of websites they tested have had at least one serious vulnerability and 66 percent of all websites with vulnerabilities are susceptible to XSS attacks making it the most common vulnerability web developers face. To fix this, it takes 67 days on average. Tools like <a href="http://www.owasp.org/index.php/Main_Page">WebScarab</a> and <a href="http://www.parosproxy.org/index.shtml">Paros Proxy</a> can be used to scan sites for possible vulnerabilities.
</blockquote>
<p>
They offer two simple pieces of advice that it's all too easy to forget when developing applications - validate all user input to ensure it's what it should be and escape any untrusted output (even sometimes your own!) before pushing it out to the page.
</p>]]></description>
      <pubDate>Mon, 17 Oct 2011 13:39:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jason Stiles' Blog: How To Protect Your Site From XSS With PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16458</guid>
      <link>http://www.phpdeveloper.org/news/16458</link>
      <description><![CDATA[<p>
In a recent post to his blog <i>Jason Stiles</i> takes a look at some of the things you can do with PHP to help <a href="http://jstiles.com/Blog/How-To-Protect-Your-Site-From-XSS-With-PHP">protect your site from XSS</a> (cross-site scripting attacks) with some basic filtering.
</p>
<blockquote>
Cross-Site Scripting (XSS) is a type of attack where a hacker attempts to inject client-side scripting into a webpage that others are able to view.  The attack could be as simple as an annoying alert window or as sophisticated as stealing a logged in user's credentials (commonly saved in browser cookies). [...] Since these types of user input can immediately be displayed to other user's, the attack could be spread pretty quickly and even without your knowledge. 
</blockquote>
<p>
He provides a basic function to get you started filtering the input from your users - a "xss_protect" method that takes in the data, whether to strip HTML tags or not and an optional set of allowed tags if you do. He also asks for opinions and better methods in his comments:
</p>
<blockquote>
No solution is going to be perfect, but at least now you have a head start!  If you have ways of improving this function, let myself and everyone else know in <a href="http://jstiles.com/Blog/How-To-Protect-Your-Site-From-XSS-With-PHP#comments">the comments</a>. 
</blockquote>]]></description>
      <pubDate>Mon, 13 Jun 2011 09:40:42 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Padraic Brady's Blog: CodeIgniter 2.0.2: Cross-Site Scripting (XSS) Fixes And Recommendations]]></title>
      <guid>http://www.phpdeveloper.org/news/16320</guid>
      <link>http://www.phpdeveloper.org/news/16320</link>
      <description><![CDATA[<p>
<i>Padraic Brady</i> has a new post looking at a cross-site scripting issue he came across when working with CodeIgniter 2.0.2 and <a href="http://blog.astrumfutura.com/2011/05/codeigniter-2-0-2-cross-site-scripting-xss-fixes-and-recommendations/">some fixes and recommendations</a> he has about correcting the situation.
</p>
<blockquote>
EllisLabs' news release for CodeIgniter 2.0.2 makes mention of "a small vulnerability". This small vulnerability is mentioned no where else (not even the actual changelog for 2.0.2). In reality, I reported seven distinct vulnerabilities across two classes. These vulnerabilities might allow an attacker to inject arbitrary HTML, CSS or Javascript, i.e. Cross-Site Scripting (XSS) into an application's output. 
</blockquote>
<p>
He gives a list of four recommendations that CodeIgniter 2.0.2 users can take to creating (or updating) their applications including using <a href="http://htmlpurifier.org/">HTMLPurifier</a> when you need sanitization and ensuring that views and templates from third parties are clear of XSS issues.
</p>]]></description>
      <pubDate>Tue, 10 May 2011 11:12:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Secunia.com: Debian Update for PHP4 & PHP5]]></title>
      <guid>http://www.phpdeveloper.org/news/8201</guid>
      <link>http://www.phpdeveloper.org/news/8201</link>
      <description><![CDATA[<p>
On Secunia.com, two new updates for the Debian linux distribution have been posted - on for PHP4 and the other for PHP5:
</p>
<blockquote>
Debian has issued an update for php4/5. This fixes some vulnerabilities, which can be exploited by malicious people to conduct cross-site scripting attacks, cause a DoS (Denial of Service), and potentially compromise a vulnerable system.
</blockquote>
<p>
You can get more information and links to the downloads here:
</p>
<ul>
<li><a href="http://secunia.com/advisories/25945/">PHP4 announcement</a>
<li><a href="http://secunia.com/advisories/25938/">PHP5 announcement</a>
</ul>]]></description>
      <pubDate>Mon, 09 Jul 2007 10:26:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Shiflett's Blog: Character Encoding and XSS]]></title>
      <guid>http://www.phpdeveloper.org/news/8084</guid>
      <link>http://www.phpdeveloper.org/news/8084</link>
      <description><![CDATA[<p>
In <a href="http://shiflett.org/blog/2007/may/character-encoding-and-xss">this post</a> to his blog, <i>Chris Shiflett</i> talks about some issues surrounding character encoding and the cross-site scripting issues it can open up in your application.
</p>
<blockquote>
<p>
In the post [on Good and Bad PHP Code], he provides a few useful PHP interview questions, including <a href="http://blog.assembleron.com/2007/05/23/php-interview-questions-from-yahoo/">some questions from Yahoo</a>. He explains that good PHP code should be Structured, Consistent, Portable and Secure
</p>
<p>
In the comments, many additional improvements have been suggested, but there's one that has yet to be mentioned. When using htmlspecialchars() without specifying the character encoding, <a href="http://shiflett.org/blog/2005/dec/google-xss-example">XSS attacks that use UTF-7</a> are possible.
</p>
</blockquote>
<p>
Included in <a href="http://shiflett.org/blog/2007/may/character-encoding-and-xss">the post</a> is an example to illustrate the point as well as a solution, a simple one involving the header() function, to help correct the problem and prevent bad things from happening.
</p>
<p>
Be sure to check out <a href="
</p>http://shiflett.org/blog/2007/may/character-encoding-and-xss#comments">the comments</a> for more great tips.]]></description>
      <pubDate>Wed, 20 Jun 2007 09:35:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Secunia.com: PHPChain Two Cross-Site Scripting Vulnerabilities]]></title>
      <guid>http://www.phpdeveloper.org/news/7776</guid>
      <link>http://www.phpdeveloper.org/news/7776</link>
      <description><![CDATA[<p>
Secunia.com has posted <a href="http://secunia.com/advisories/25128/">a PHP-related issue</a> that users of the <a href="http://freshmeat.net/projects/phpchain/">PHPChain application</a> should look into:
</p>
<blockquote>
<p>
r0t has discovered some vulnerabilities in PHPChain, which can be exploited by malicious people to conduct cross-site scripting attacks.
</p>
<p>
Input passed to the "catid" parameter in settings.php (when "action" is set to "edit") and cat.php is not properly sanitised before it is returned to the user. This can be exploited to execute arbitrary HTML and script code in a user's browser session in context of an affected site.
</p>
</blockquote>
<p>
If a user is logged in and the exploit is in place, the attacker could gain access to the application and gain access to a user's information. The recommended fix is to correct the source code so that the information coming in is correctly sanitized.
</p>]]></description>
      <pubDate>Fri, 04 May 2007 11:28:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Secunia.com: TCExam PHP Code Execution and Cross-Site Scripting]]></title>
      <guid>http://www.phpdeveloper.org/news/7749</guid>
      <link>http://www.phpdeveloper.org/news/7749</link>
      <description><![CDATA[<p>
TCExam users will definitely want to pay attention to <a href="http://secunia.com/advisories/25008/">this latest advisory</a> posted by Secunia detailing a PHP code execution and cross-site scripting issue that's been found:
</p>
<blockquote>
rgod has discovered two vulnerabilities in TCExam, which can be exploited by malicious people to conduct cross-site scripting attacks or to compromise a vulnerable system.
</blockquote>
<p>
The two issues is related to two different inpus not being handled properly - the mishandling of the SessionUserLang cookie and the _SERVER[SCRIPT_NAME] value. Neither of these are being sanitized.
</p>
<p>
<a href="http://secunia.com/advisories/25008/">This issue</a> effects users of the TCExam 4.x series but a new version, 4.1.000, has already been released and made available for download.
</p>]]></description>
      <pubDate>Tue, 01 May 2007 14:18:00 -0500</pubDate>
    </item>
  </channel>
</rss>
