<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>John Melton's Weblog</title>
	
	<link>http://www.jtmelton.com</link>
	<description>Java, Security and Technology</description>
	<lastBuildDate>Wed, 16 May 2012 04:49:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/jtmelton" /><feedburner:info uri="jtmelton" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>35.329235</geo:lat><geo:long>-80.804866</geo:long><item>
		<title>Year Of Security for Java – Week 20 – Trust Nothing</title>
		<link>http://feedproxy.google.com/~r/jtmelton/~3/jL0Sk9DY6qU/</link>
		<comments>http://www.jtmelton.com/2012/05/16/year-of-security-for-java-week-20-trust-nothing/#comments</comments>
		<pubDate>Wed, 16 May 2012 04:49:53 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Trust Nothing]]></category>

		<guid isPermaLink="false">http://www.jtmelton.com/?p=312</guid>
		<description><![CDATA[What is it and why should I care? While trust spawns interesting philosophical discussions, here I want to discuss the implications of trust within the applications we build. Trust is a funny thing in that we implicitly give it frequently without considering what we&#8217;re trusting. A simple example: //bad bad do not use executeDbQuery("select * [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1c9918a7a9b1394ec9f25a3d30b5b9df&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-right: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F05%2F16%2Fyear-of-security-for-java-week-20-trust-nothing%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F05%2F16%2Fyear-of-security-for-java-week-20-trust-nothing%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>What is it and why should I care?</strong><br />
While trust spawns interesting philosophical <a href="http://www.schneier.com/book-lo.html">discussions</a>, here I want to discuss the implications of trust within the applications we build. Trust is a funny thing in that we implicitly give it frequently without considering what we&#8217;re trusting. A simple example: </p>
<pre class="brush: java">
//bad bad do not use
executeDbQuery("select * from my_table where id = " + request.getParameter("my_id"));
//bad bad do not use
</pre>
<p>Here we&#8217;ve said that we trust that the user of the application has not tampered with the <em>my_id</em> request parameter in any way that may cause problems for our application. Obviously this is a poor assumption. We can do better by moving the above query to a prepared statement with parameter binding to prevent SQL injection and we can also validate the <em>my_id</em> parameter for appropriate input, but why do we do that?</p>
<p>It&#8217;s because we don&#8217;t trust the input to our system. We don&#8217;t (and shouldn&#8217;t) trust that a user or system is going to use our application in the way we would expect, or even the ways we&#8217;ve thought of necessarily (a good reason against blacklisting for security). We must build systems that not only are functional (use) but stand up under attack (abuse) or ignorant usage. Our systems must be <a href="http://en.wikipedia.org/wiki/Robustness_principle">robust</a> or as some have called it, <a href="http://www.ruggedsoftware.org/">rugged</a>. Whatever your term, the idea of trust is either explicitly or implicitly central to the idea. We can&#8217;t trust the environment. </p>
<p>If we can&#8217;t trust the environment, what does that mean? Does that mean we deal with XSS and SQLi? Yes, but much more than that, it&#8217;s a different way of thinking about the application. It becomes that simple picture of input-processing-output at varying levels of scope. A single request has inputs (request parameters, headers, database input, etc.), processing (authn/z, logic, etc.) and outputs (DB, screen, file, etc.). The application as a whole has inputs, processing and outputs that are essentially the combination of all the individual components of the application, and then you can scale on up to systems and organizations. </p>
<p>The &#8220;environment&#8221; I&#8217;m referring to changes depending on your specific situation, and it&#8217;s difficult to say that you simply can&#8217;t trust anything, because that&#8217;s usually a non-starter. You may have to trust your configuration files or your external SSO system, or any number of other entities. The idea is that you specifically label those things as trusted (an assumption) and treat everything else as being tainted. </p>
<p>These types of issues are considered in threat modelling, which is another planned topic in this series. For now, it&#8217;s sufficient to simply note that you should be thinking in terms of what data am I taking in, processing and sending out?</p>
<p><strong>What should I do about it?</strong><br />
Now that we&#8217;ve established the environment can&#8217;t be trusted, the next logical question is what constitutes the environment? </p>
<p>This could be a long answer depending on your setup, but a decent starting list for web applications in particular might look like the following: </p>
<ul>
<li>web request data (parameters, headers, body, cookies)</li>
<li>database data</li>
<li>directory data (ldap)</li>
<li>filesystem data</li>
<li>web service data (any data in headers or body)</li>
<li>external system data (any data you receive from another system &#8211; software you&#8217;re integrating with)</li>
<li>network connection data (any data you receive while acting as the &#8220;server&#8221; &#8211; generally socket-based communication)</li>
<li>user input (command line input)</li>
<li>system environment variables</li>
<li>third party software (libraries that you call that provide you data)</li>
</ul>
<p>This list is incomplete I&#8217;m sure, but the idea is there. Any data you receive from any of these users or systems is generally untrusted, possibly with certain organization/application-specific well defined exceptions. When you start to view your applications in this way, you start to build better protections around them. You build better <a href="http://www.jtmelton.com/2012/05/01/year-of-security-for-java-week-18-perform-application-layer-intrusion-detection/">defences</a>, and better <a href="http://www.jtmelton.com/2012/04/10/year-of-security-for-java-week-15-audit-security-related-events/">logging/auditing</a> so that you can detect when something actually does break (it will, I promise). However, thinking in this way can go a long way to helping you build safer and more secure systems.</p>
<p>References<br />
&#8212;&#8212;&#8212;&#8211;<br />
<a href="http://www.ruggedsoftware.org/">http://www.ruggedsoftware.org/</a><br />
<a href="http://www.schneier.com/book-lo.html">http://www.schneier.com/book-lo.html</a><br />
<a href="http://en.wikipedia.org/wiki/Robustness_principle">http://en.wikipedia.org/wiki/Robustness_principle</a><br />
<a href="http://www.jtmelton.com/2012/05/01/year-of-security-for-java-week-18-perform-application-layer-intrusion-detection/">http://www.jtmelton.com/2012/05/01/year-of-security-for-java-week-18-perform-application-layer-intrusion-detection/</a><br />
<a href="http://www.jtmelton.com/2012/04/10/year-of-security-for-java-week-15-audit-security-related-events/">http://www.jtmelton.com/2012/04/10/year-of-security-for-java-week-15-audit-security-related-events/</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Trust+Nothing' rel='tag' target='_self'>Trust Nothing</a></p>

<!-- end wp-tags-to-technorati -->

<p><a href="http://feedads.g.doubleclick.net/~a/Gac49e22qyKqh3qlGWWI8foFJTI/0/da"><img src="http://feedads.g.doubleclick.net/~a/Gac49e22qyKqh3qlGWWI8foFJTI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Gac49e22qyKqh3qlGWWI8foFJTI/1/da"><img src="http://feedads.g.doubleclick.net/~a/Gac49e22qyKqh3qlGWWI8foFJTI/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/jtmelton/~4/jL0Sk9DY6qU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jtmelton.com/2012/05/16/year-of-security-for-java-week-20-trust-nothing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jtmelton.com/2012/05/16/year-of-security-for-java-week-20-trust-nothing/</feedburner:origLink></item>
		<item>
		<title>Year Of Security for Java – Week 19 – Reduce the Attack Surface</title>
		<link>http://feedproxy.google.com/~r/jtmelton/~3/wBf9rsGEoB0/</link>
		<comments>http://www.jtmelton.com/2012/05/09/year-of-security-for-java-week-19-reduce-the-attack-surface/#comments</comments>
		<pubDate>Wed, 09 May 2012 04:00:25 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[3rd Party Libraries]]></category>
		<category><![CDATA[Keep It Simple]]></category>
		<category><![CDATA[Reduce Attack Surface]]></category>

		<guid isPermaLink="false">http://www.jtmelton.com/?p=309</guid>
		<description><![CDATA[What is it and why should I care? Reducing the attack surface of an application or system means reducing the ways that you can interact with the application, and may involve reducing the functionality the application provides. To most business folks, this sounds very, very bad. However, at its&#8217; core, it&#8217;s really just a matter [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1c9918a7a9b1394ec9f25a3d30b5b9df&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-right: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F05%2F09%2Fyear-of-security-for-java-week-19-reduce-the-attack-surface%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F05%2F09%2Fyear-of-security-for-java-week-19-reduce-the-attack-surface%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>What is it and why should I care?</strong><br />
Reducing the attack surface of an application or system means reducing the ways that you can interact with the application, and may involve reducing the functionality the application provides. </p>
<p>To most business folks, this sounds very, very bad. However, at its&#8217; core, it&#8217;s really just a matter of simplifying the system. This is a really *good* thing to the business. Rarely do you find anything that people genuinely enjoy using that is complex. The best designs are simple, and that benefits us in this case from a security perspective. </p>
<p>What does this simplification look like? My favorite example is the difference between Google&#8217;s <a href="https://www.google.com/webhp?hl=en&#038;tab=ww">standard</a> and <a href="http://www.google.com/advanced_search">advanced</a> searches. It&#8217;s likely that 99.9% of people don&#8217;t need the advanced search features. Imagine if google removed that page &#8211; that greatly simplifies the &#8220;search&#8221; application they build. It reduces the application footprint, saves them money (dev, support, etc) and gives their customers a better experience &#8211; what could be better? (Note: I&#8217;m simplifying this case as google&#8217;s standard search does allow advanced operators, but you get the idea.)</p>
<p>Most developers I&#8217;ve worked with (myself included) have the tendency to a) want to build lots of cool stuff, and b) be poor designers. This results in designs that are larger than necessary in that they encompass more code than planned (feature creep). It also results in an often unpleasant user experience. By being ruthless in removing non-required functionality, and simplifying what is required, the user experience is enhanced along with security, not to mention the bottom line &#8211; time and money.</p>
<p><strong>What should I do about it?</strong><br />
Saying you should remove features/functionality and simplify is a bit vague, I realize. I&#8217;d like to offer a few examples of common situations where you might be able to have some impact on your applications for the better. </p>
<p>1. Dead Code<br />
Every modern IDE has a &#8220;dead code&#8221; detector. If you don&#8217;t use an IDE, tons of open source &#8220;code quality&#8221; tools have this feature as well. Use it. If you&#8217;re not using code, remove it. If you comment out code, but keep it in the code-base, stop. Remove it. Heck, you can get it back through your version control if you ever really need it. </p>
<p>As much as you can you should also remove code that is &#8220;dead&#8221; because it&#8217;s not enabled via configuration. This may not always hold depending on the specific circumstance, but if you don&#8217;t have a need for a feature, don&#8217;t have it in your code base. </p>
<p>Dead code doesn&#8217;t get looked at or dealt with as closely as &#8220;live&#8221; code, so that makes it even worse from a security perspective, as there are likely to be lingering issues that aren&#8217;t dealt with because &#8220;no one is using that&#8221;. </p>
<p>2. Copied code<br />
Everybody&#8217;s done it. You&#8217;ve taken code from an old project and used it in a new one. You&#8217;ve taken an example from the web and plugged it into your app. It may have done more than you needed, even way more. What have you done? You&#8217;ve added extra code that has be maintained, debugged, supported, tuned, secured, etc. This is a bad idea. It&#8217;s fine to use others&#8217; (assuming they&#8217;re ok with it) code, but don&#8217;t add a bunch of stuff you don&#8217;t need.</p>
<p>3. Extra features<br />
It&#8217;s undoubtedly great to wow your customer. In my opinion, adding unplanned features is usually not the best way to do that. Usually, giving them the absolute best version of what they need is much better for both you and them. It&#8217;s the idea of doing a few things well as opposed to lots of things just OK. Adding in extra features is a common thing for developers to do, often because they saw some cool thing somewhere and thought &#8220;hey &#8211; that&#8217;d be cool here&#8221;. Again, adding extra features means extra code, and that&#8217;s more to do, and takes away from the quality of what you actually need to do. </p>
<p>4. Extra code &#8211; 3rd party libraries<br />
3rd party libraries are great. They are core to most any development done today. They enable us to create more functional apps quicker. However, they also put into your application TONS of functionality and features you may not have planned on being there, and that you probably don&#8217;t know exist. I would venture a guess that most J2EE apps I see probably include hundreds, if not thousands, of times more code in 3rd party libraries than in the code written for the application. That&#8217;s great from the perspective of &#8220;I didn&#8217;t have to write this&#8221;, but could mean danger when it comes to securing your application with those frameworks. From a security perspective, it doesn&#8217;t help that most of these libraries are there to have things <em>just work</em> instead of having secure defaults. I&#8217;m not saying frameworks are bad; I&#8217;m saying you need to know their capabilities well, and <a href="http://www.jtmelton.com/2012/03/29/year-of-security-for-java-week-13-know-your-frameworks/">have a plan for dealing with them from the security perspective</a>. </p>
<p>5. Extra services enabled<br />
This is particularly common with 3rd party applications, but can be true for custom apps as well. What happens is an application is built in a generic way, and then sold/used by several groups or companies to solve different problems or similar problems for different users, etc. The functionality in the app is the sum total of what all the customers need. You as an individual customer might only need 30% of the overall functionality, but you have 100% enabled. That&#8217;s a problem. The better apps give you a simple way to disable features you&#8217;re not using, and a simple way to verify it&#8217;s actually turned off. Use these features. It&#8217;s always better to have to do an update to enable a feature than to have to tell your boss you were hacked using a feature that wasn&#8217;t even needed. </p>
<p>The above represents just a handful of ideas on how to reduce attack surface in your application. They all really boil down to simplify, simplify, simplify. It helps your application be better, and thankfully helps your security be better as well. Next time you have a bug-hunting session, try some of these ideas out. Also add comments if you have more/better ideas. </p>
<p>References<br />
&#8212;&#8212;&#8212;&#8211;<br />
<a href="http://www.jtmelton.com/2012/03/29/year-of-security-for-java-week-13-know-your-frameworks/">http://www.jtmelton.com/2012/03/29/year-of-security-for-java-week-13-know-your-frameworks/</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/3rd+Party+Libraries' rel='tag' target='_self'>3rd Party Libraries</a>, <a class='technorati-link' href='http://technorati.com/tag/Keep+It+Simple' rel='tag' target='_self'>Keep It Simple</a>, <a class='technorati-link' href='http://technorati.com/tag/Reduce+Attack+Surface' rel='tag' target='_self'>Reduce Attack Surface</a></p>

<!-- end wp-tags-to-technorati -->

<p><a href="http://feedads.g.doubleclick.net/~a/saHBvJC8D0LPvbdaNyGyVKA50n4/0/da"><img src="http://feedads.g.doubleclick.net/~a/saHBvJC8D0LPvbdaNyGyVKA50n4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/saHBvJC8D0LPvbdaNyGyVKA50n4/1/da"><img src="http://feedads.g.doubleclick.net/~a/saHBvJC8D0LPvbdaNyGyVKA50n4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/jtmelton/~4/wBf9rsGEoB0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jtmelton.com/2012/05/09/year-of-security-for-java-week-19-reduce-the-attack-surface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jtmelton.com/2012/05/09/year-of-security-for-java-week-19-reduce-the-attack-surface/</feedburner:origLink></item>
		<item>
		<title>Year Of Security for Java – Week 18 – Perform Application Layer Intrusion Detection</title>
		<link>http://feedproxy.google.com/~r/jtmelton/~3/vIk635mLjvE/</link>
		<comments>http://www.jtmelton.com/2012/05/01/year-of-security-for-java-week-18-perform-application-layer-intrusion-detection/#comments</comments>
		<pubDate>Wed, 02 May 2012 03:29:03 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Application Layer Intrusion Detection]]></category>
		<category><![CDATA[AppSensor]]></category>
		<category><![CDATA[OWASP]]></category>

		<guid isPermaLink="false">http://www.jtmelton.com/?p=305</guid>
		<description><![CDATA[What is it and why should I care? Application layer intrusion detection is a simple concept that I believe is very, very powerful when it comes to protecting applications. Most of the topics I&#8217;ve covered thus far have focused on the development portion of the software life-cycle, but this topic really covers the entire span [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1c9918a7a9b1394ec9f25a3d30b5b9df&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-right: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F05%2F01%2Fyear-of-security-for-java-week-18-perform-application-layer-intrusion-detection%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F05%2F01%2Fyear-of-security-for-java-week-18-perform-application-layer-intrusion-detection%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>What is it and why should I care?</strong><br />
<a href="https://www.owasp.org/index.php/ApplicationLayerIntrustionDetection">Application layer intrusion detection</a> is a simple concept that I believe is very, very powerful when it comes to protecting applications. Most of the topics I&#8217;ve covered thus far have focused on the development portion of the software life-cycle, but this topic really covers the entire span of an application, from the requirements and planning to sun-setting. </p>
<p>The basic concept is that you plan for, implement and monitor &#8220;bad&#8221; things that occur in your application. With this type of system in place, you look for events that appear to be undesirable in some way and then keep track of them. Over time, you can make decisions about whether those individual events turn into an actual attack. </p>
<p>Many developers actually do most of the work of detection already. Consider the following pseudo-code: </p>
<pre class="brush:java">
if (user has access to record) {
    get data
    redirect to view/edit page
} else {
    log exception
    send user error message
}
</pre>
<p>I&#8217;ve seen code just like this lots of times. The problem here is the handling exceptional condition. In general, people don&#8217;t review logs, so if there&#8217;s an attacker trying to break your application, the only person seeing the error you&#8217;ve caught is the <em>_attacker_</em>. With one quick addition of sending a message to your intrusion detection engine, you can start tracking these events and actually gaining knowledge into the real-time (and historical if you choose to store it) usage of your application. After you&#8217;ve detected an actual intrusion, you also have the ability to respond to the activity in any [legal] way you see fit. Popular options include ideas like: increased logging, manipulating user account (logout, disable), or even blocking access to certain functionality.</p>
<p><strong>What should I do about it?</strong><br />
Let&#8217;s assume I&#8217;ve sold you on the idea of implementing something like this (hopefully I have). What now? </p>
<p>Well, you have a few options on how to proceed that I&#8217;m aware of: <a href="https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API">ESAPI</a>, <a href="http://www.owasp.org/index.php/OWASP_AppSensor_Project">AppSensor</a> or roll-your-own. </p>
<p>ESAPI does have an intrusion detection engine built-in that performs some of these ideas. It is admittedly not extensive, but the core is there and can certainly be extended. </p>
<p>AppSensor is one such extension of the ESAPI intrusion detection engine. The implementation is more extensive than what&#8217;s available for ESAPI. Additionally, the project offers a <a href="https://www.owasp.org/images/2/2f/OWASP_AppSensor_Beta_1.1.pdf">book</a> about the overall idea, as well as <a href="http://www.owasp.org/index.php/AppSensor_DetectionPoints">significant</a> <a href="http://www.clerkendweller.com/2010/11/12/Application-Intrusion-Detection-and-Response-Planning-Methodology">documentation</a> in addition to the <a href="http://code.google.com/p/appsensor/">code</a>. Lastly, there is actually a significant update being worked on currently on the project to update both the documentation and the code.</p>
<p>Rolling your own analysis engine can be a small or very large project depending on your needs. Nevertheless, you can certainly take the ideas and implement them in your applications and get significant benefit. </p>
<p>By just adding a little bit of effort, you can gain significant insight into the overall security health of your application(s). You can see who attacked/is attacking your application in real-time or the past, and you can actually respond to events as they occur. Who wouldn&#8217;t like that? </p>
<p><em>Author note</em>: I work on the AppSensor project, so this whole topic is near and dear to me. Please take advantage of the idea whether it&#8217;s in our implementation or not!</p>
<p>References<br />
&#8212;&#8212;&#8212;&#8211;<br />
<a href="https://www.owasp.org/index.php/ApplicationLayerIntrustionDetection">https://www.owasp.org/index.php/ApplicationLayerIntrustionDetection</a><br />
<a href="http://www.jtmelton.com/2010/11/10/application-intrusion-detection-with-owasp-appsensor/">http://www.jtmelton.com/2010/11/10/application-intrusion-detection-with-owasp-appsensor/</a><br />
<a href="http://www.owasp.org/index.php/OWASP_AppSensor_Project">http://www.owasp.org/index.php/OWASP_AppSensor_Project</a><br />
<a href="http://www.owasp.org/">http://www.owasp.org/</a><br />
<a href="http://www.youtube.com/watch?v=6gxg_t2ybcE">http://www.youtube.com/watch?v=6gxg_t2ybcE</a><br />
<a href="http://www.clerkendweller.com/2010/11/12/Application-Intrusion-Detection-and-Response-Planning-Methodology">http://www.clerkendweller.com/2010/11/12/Application-Intrusion-Detection-and-Response-Planning-Methodology</a><br />
<a href="https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API">https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Application+Layer+Intrusion+Detection' rel='tag' target='_self'>Application Layer Intrusion Detection</a>, <a class='technorati-link' href='http://technorati.com/tag/AppSensor' rel='tag' target='_self'>AppSensor</a>, <a class='technorati-link' href='http://technorati.com/tag/OWASP' rel='tag' target='_self'>OWASP</a>, <a class='technorati-link' href='http://technorati.com/tag/Security' rel='tag' target='_self'>Security</a></p>

<!-- end wp-tags-to-technorati -->

<p><a href="http://feedads.g.doubleclick.net/~a/1ldvnJ4hHMlw3QKZ0K_MeBBEAuk/0/da"><img src="http://feedads.g.doubleclick.net/~a/1ldvnJ4hHMlw3QKZ0K_MeBBEAuk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/1ldvnJ4hHMlw3QKZ0K_MeBBEAuk/1/da"><img src="http://feedads.g.doubleclick.net/~a/1ldvnJ4hHMlw3QKZ0K_MeBBEAuk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/jtmelton/~4/vIk635mLjvE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jtmelton.com/2012/05/01/year-of-security-for-java-week-18-perform-application-layer-intrusion-detection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.jtmelton.com/2012/05/01/year-of-security-for-java-week-18-perform-application-layer-intrusion-detection/</feedburner:origLink></item>
		<item>
		<title>Year Of Security for Java – Week 17 – Set a Hard Session Timeout</title>
		<link>http://feedproxy.google.com/~r/jtmelton/~3/ahFevxnXvis/</link>
		<comments>http://www.jtmelton.com/2012/04/27/year-of-security-for-java-week-17-set-a-hard-session-timeout/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 15:10:04 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[session timeout]]></category>

		<guid isPermaLink="false">http://www.jtmelton.com/?p=301</guid>
		<description><![CDATA[What is it and why should I care? A session timeout is an important security control for any application. It specifies the length of time that an application will allow a user to remain logged in before forcing the user to re-authenticate. There are 2 types: Soft Session Timeouts (last week&#8217;s topic) and Hard Session [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1c9918a7a9b1394ec9f25a3d30b5b9df&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-right: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F04%2F27%2Fyear-of-security-for-java-week-17-set-a-hard-session-timeout%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F04%2F27%2Fyear-of-security-for-java-week-17-set-a-hard-session-timeout%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>What is it and why should I care?</strong></p>
<p>A session timeout is an important security control for any application. It specifies the length of time that an application will allow a user to remain logged in before forcing the user to re-authenticate. There are 2 types: <a href="http://www.jtmelton.com/2012/04/17/year-of-security-for-java-week-16-set-a-soft-session-timeout/">Soft Session Timeouts</a> (last week&#8217;s topic) and Hard Session Timeouts (this week&#8217;s topic).</p>
<p>A hard session timeout is applied when the user has been logged in for a specific period of time, no matter what. </p>
<p>As an example, lets say we have a system where:<br />
1. Access to the application requires authentication<br />
2. Attempting to access any portion of the application except login (and change/reset pw, etc.) redirects you to the login page.<br />
3. A user logs into your system and uses the system, actively or inactively, for 9 hours and you have a hard session timeout that is set to 9 hours</p>
<p>The net effect of this will be that the next interaction this user has with the system will then redirect them to the login page.</p>
<p>The section above shows what a hard session timeout is and does, but what is it protecting against? Whereas a soft session timeout is angled more towards preventing CSRF and similar attacks, a hard session timeout (while it does help protect against those as well) is helpful to prevent things like the permanent hijacking of an account. If an attacker does overtake an account, they can&#8217;t use it forever without re-authentication. For this same reason, you should force authentication (validate old password) whenever a user attempts to change the password of the account.</p>
<p><strong>What should I do about it?</strong></p>
<p>Many applications, even those that avoid the soft session timeout, do include a hard session timeout. Unfortunately, it&#8217;s not available simply to Java developers as an option for configuration. That means you have to either roll your own, or look for some existing software outside of the core Java/J2EE options.</p>
<p>In Java, there are a few ways you can enable a hard session timeout:</p>
<p><em>Option 1: Set timeout in code</em></p>
<p>There is no specific Java API call to do this. However, you could easily setup a filter (or your handler/interceptor of choice) to perform this task. Essentially it would require you to store the last logged in time of every user and tie that to their authenticated session id. If a request is made using a session id tied to a user who has been logged in > X minutes, invalidate the session, and redirect the request to the login screen. Fairly simple idea. </p>
<p><em>Option 2: Use a third party library</em></p>
<p>Though I&#8217;m not aware of any libraries off the top of my head that do this, it wouldn&#8217;t be hard to theoretically. (If one doesn&#8217;t exist, you could always build it and donate it to the community!)</p>
<p><em>Option 3: SSO sets the timeout</em></p>
<p>This is not a Java-only option, but still should be mentioned. Many enterprises use large single sign-on (SSO) identity systems to control access to applications. Many of these systems allow you to set the timeout (both a soft timeout and a hard timeout) for an application. </p>
<p>As you can see, the hard session timeout is a useful security control. It allows you to have another layer of protection for your application and your users. </p>
<p>References<br />
&#8212;&#8212;&#8212;&#8211;<br />
<a href="http://www.jtmelton.com/2012/04/17/year-of-security-for-java-week-16-set-a-soft-session-timeout/">http://www.jtmelton.com/2012/04/17/year-of-security-for-java-week-16-set-a-soft-session-timeout/</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/CSRF' rel='tag' target='_self'>CSRF</a>, <a class='technorati-link' href='http://technorati.com/tag/session+timeout' rel='tag' target='_self'>session timeout</a></p>

<!-- end wp-tags-to-technorati -->

<p><a href="http://feedads.g.doubleclick.net/~a/PZ8WbCQevlzh_LrvdM_Os-MCP24/0/da"><img src="http://feedads.g.doubleclick.net/~a/PZ8WbCQevlzh_LrvdM_Os-MCP24/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/PZ8WbCQevlzh_LrvdM_Os-MCP24/1/da"><img src="http://feedads.g.doubleclick.net/~a/PZ8WbCQevlzh_LrvdM_Os-MCP24/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/jtmelton/~4/ahFevxnXvis" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jtmelton.com/2012/04/27/year-of-security-for-java-week-17-set-a-hard-session-timeout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jtmelton.com/2012/04/27/year-of-security-for-java-week-17-set-a-hard-session-timeout/</feedburner:origLink></item>
		<item>
		<title>Year Of Security for Java – Week 16 – Set a Soft Session Timeout</title>
		<link>http://feedproxy.google.com/~r/jtmelton/~3/G63zzIt0NFU/</link>
		<comments>http://www.jtmelton.com/2012/04/17/year-of-security-for-java-week-16-set-a-soft-session-timeout/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 03:13:46 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[session timeout]]></category>
		<category><![CDATA[web.xml]]></category>

		<guid isPermaLink="false">http://www.jtmelton.com/?p=296</guid>
		<description><![CDATA[What is it and why should I care? A session timeout is an important security control for any application. It specifies the length of time that an application will allow a user to remain logged in before forcing the user to re-authenticate. There are 2 types: Soft Session Timeouts (today&#8217;s topic) and Hard Session Timeouts [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1c9918a7a9b1394ec9f25a3d30b5b9df&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-right: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F04%2F17%2Fyear-of-security-for-java-week-16-set-a-soft-session-timeout%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F04%2F17%2Fyear-of-security-for-java-week-16-set-a-soft-session-timeout%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>What is it and why should I care?</strong></p>
<p>A session timeout is an important security control for any application. It specifies the length of time that an application will allow a user to remain logged in before forcing the user to re-authenticate. There are 2 types: Soft Session Timeouts (today&#8217;s topic) and Hard Session Timeouts (I&#8217;ll cover this next week).</p>
<p>A soft session timeout is applied when the user does not interact with the system for a period of time. </p>
<p>As an example, lets say we have a system where:<br />
1. Access to the application requires authentication<br />
2. Attempting to access any portion of the application except login (and change/reset pw, etc.) redirects you to the login page.<br />
3. A user logs into your system and walks away for 20 minutes and you have a 15 minute timeout<br />
The net effect of this will be that the next interaction this user has with the system will then redirect them to the login page.</p>
<p>The section above shows what a soft session timeout is and does, but what is it protecting against? There are many issues that are related (authentication,authorization,auditing,session hijacking, etc.), but one of the primary issues is <a href="http://www.jtmelton.com/2012/02/07/year-of-security-for-java-week-6-csrf-prevention-in-java/">CSRF</a>. By forcing a reasonably low session timeout, you add another security control that increases the difficulty of launching CSRF style attacks. Essentially, any attack that attempts to exploit the fact that the user is logged in is now either prevented or complicated by using this simple control.</p>
<p><strong>What should I do about it?</strong></p>
<p>Like many security controls, there is a tradeoff with functionality related to session timeouts. Many popular web applications that we use have no soft session timeout configured, because they don&#8217;t want to trouble a user with an extra step of logging in repeatedly. As in other situations, this is a risk decision to make things less secure for your users in order to make things simpler and easier for them. If you have an application that protects sensitive data, or your users (or you) have a lower threshold of pain with risk decisions, you should opt for including a soft (and hard &#8211; see next week) session timeout. </p>
<p>In Java, there are several ways you can do this. </p>
<p><em>Option 1</em>: Set the timeout in the web.xml</p>
<p>By far the most popular option, this is simple and allows you to configure this without having to set it in code. An example snippet showing a 15 minute timeout is below. </p>
<pre class="brush: xml">
<session-config>
  <session-timeout>15</session-timeout>	<!-- set in minutes -->
</session-config>
</pre>
<p><em>Option 2</em>: Allow the app server to set the session timeout</p>
<p>This could mean that you allow the default (30 minutes for most app servers) or that you set the value specifically in your container. Either way, this is an option. </p>
<p><em>Option 3</em>: Set timeout in code</p>
<p>This option allows you the ability to encode this setting in code. This does allow you the additional flexibility of setting differet timeouts for different users since it&#8217;s set on the session and not globally, but it&#8217;s far less common than it&#8217;s web.xml alternative</p>
<pre class="brush: java">
httpSession.setMaxInactiveInterval(15*60); // set in seconds
</pre>
<p><em>Option 4</em>: SSO sets the timeout</p>
<p>This is not a Java-only option, but still should be mentioned. Many enterprises use large single sign-on (SSO) identity systems to control access to applications. Many of these systems allow you to set the timeout for an application. </p>
<p>As you can see, the soft session timeout is a useful security control. It allows you to have another layer of protection for your application and your users. </p>
<p>References<br />
&#8212;&#8212;&#8212;&#8211;<br />
<a href="http://software-security.sans.org/blog/2010/08/11/security-misconfigurations-java-webxml-files">http://software-security.sans.org/blog/2010/08/11/security-misconfigurations-java-webxml-files</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/CSRF' rel='tag' target='_self'>CSRF</a>, <a class='technorati-link' href='http://technorati.com/tag/session+timeout' rel='tag' target='_self'>session timeout</a>, <a class='technorati-link' href='http://technorati.com/tag/web.xml' rel='tag' target='_self'>web.xml</a></p>

<!-- end wp-tags-to-technorati -->

<p><a href="http://feedads.g.doubleclick.net/~a/3J2PSob3wmT50htf3ONiE52Af_k/0/da"><img src="http://feedads.g.doubleclick.net/~a/3J2PSob3wmT50htf3ONiE52Af_k/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3J2PSob3wmT50htf3ONiE52Af_k/1/da"><img src="http://feedads.g.doubleclick.net/~a/3J2PSob3wmT50htf3ONiE52Af_k/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/jtmelton/~4/G63zzIt0NFU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jtmelton.com/2012/04/17/year-of-security-for-java-week-16-set-a-soft-session-timeout/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.jtmelton.com/2012/04/17/year-of-security-for-java-week-16-set-a-soft-session-timeout/</feedburner:origLink></item>
		<item>
		<title>Year Of Security for Java – Week 15 – Audit Security Related Events</title>
		<link>http://feedproxy.google.com/~r/jtmelton/~3/3uPjcHXJjmk/</link>
		<comments>http://www.jtmelton.com/2012/04/10/year-of-security-for-java-week-15-audit-security-related-events/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 03:54:52 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[audit logging]]></category>
		<category><![CDATA[security events]]></category>

		<guid isPermaLink="false">http://www.jtmelton.com/?p=287</guid>
		<description><![CDATA[What is it and why should I care? Auditing security related events includes two basic concepts, so we&#8217;ll begin by treating them individually. Auditing Auditing is a key part of any real software system. Many people treat logging and auditing as the same idea, though they&#8217;re actually different. Definitions might vary, but mine boils down [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1c9918a7a9b1394ec9f25a3d30b5b9df&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-right: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F04%2F10%2Fyear-of-security-for-java-week-15-audit-security-related-events%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F04%2F10%2Fyear-of-security-for-java-week-15-audit-security-related-events%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>What is it and why should I care?</strong><br />
Auditing security related events includes two basic concepts, so we&#8217;ll begin by treating them individually. </p>
<p><em>Auditing</em><br />
Auditing is a key part of any real software system. Many people treat logging and auditing as the same idea, though they&#8217;re actually different. Definitions might vary, but mine boils down to the consumer of the output. In general, logging data is consumed by developers (most often for debugging problems), and possibly business owners to see basic trending information (likely through some basic log parsing for usage statistics, etc). Auditing, on the other hand, is meant to be used by auditors to reconstruct the events that occurred in the system. The view of these events is often constrained by a time period, a specific user or set of users, a specific function or set of functions, etc. </p>
<p>Usually, logged data is unstructured and can be or represent anything. Audit data, on the other hand, is generally structured, and can be thought of more like a database record where there are specific fields that are always filled in, and the only thing that changes is the data in the column, not the column itself (to use the DB analogy). </p>
<p><em>Security Related Events</em><br />
Security related events are going to be determined by you as part of your development process, but there are several obvious candidates, such as login, logout, user management, credential management. etc. All of these are clearly security related and could be important to the security posture of your application either generally or specifically related to a single user or set of users. </p>
<p>Knowing that a security related event has occurred is important. Not knowing could lead to not only unauthorized access or usage of the system, but the inability to know that it even occurred. </p>
<p><strong>What should I do about it?</strong><br />
Auditing is the option to choose when you&#8217;re talking about security-related events. For any security-related event that occurs in the system, you should be auditing the activity. You should collect appropriate data on each event, such as event type (what happened), actor performing event (who did it), timestamp (when did they do it), etc. This type of data will allow you to filter the dataset by user, time, function, or any of the other data points when needed to determine specifically what occurred from an auditing perspective. Structured data in this form also lets you do helpful things like look at generic patterns and find that a specific user did a bunch of things outside work hours (unusual?) or everyone in the system all performed a single function within an hour of each other (maybe strange?). Some of these ideas are found in the concept of <a href="https://www.owasp.org/index.php/OWASP_AppSensor_Project">AppSensor</a>, an OWASP project I work on. </p>
<p>I would also like to point out a great talk Gunnar Peterson gave at an OWASP chapter meeting called &#8220;<a href="http://vimeo.com/15423426">Audit Logging Done Right</a>&#8220;. That video goes into detail about auditing and the power it has when used appropriately. </p>
<p>Auditing is not a new technology, and often is viewed as a boring &#8220;have to do&#8221;, but it is actually a very powerful concept that lets us gain access and visibility into what the application is doing. It also gives us all of the nice capabilities of dealing with structured data . Once you recognize the utility, I hope you&#8217;ll start auditing a few more things out of the realization of it&#8217;s power, not just obligation!</p>
<p>References<br />
&#8212;&#8212;&#8212;&#8211;<br />
<a href="http://vimeo.com/15423426">http://vimeo.com/15423426</a> &#8211; Gunnar Peterson &#8211; Audit Logging Done Right<br />
<a href="https://www.owasp.org/index.php/OWASP_AppSensor_Project">https://www.owasp.org/index.php/OWASP_AppSensor_Project</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/audit+logging' rel='tag' target='_self'>audit logging</a>, <a class='technorati-link' href='http://technorati.com/tag/Security' rel='tag' target='_self'>Security</a>, <a class='technorati-link' href='http://technorati.com/tag/security+events' rel='tag' target='_self'>security events</a></p>

<!-- end wp-tags-to-technorati -->

<p><a href="http://feedads.g.doubleclick.net/~a/oUKEW3n58Eyri851r_dX-AWpH5Q/0/da"><img src="http://feedads.g.doubleclick.net/~a/oUKEW3n58Eyri851r_dX-AWpH5Q/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/oUKEW3n58Eyri851r_dX-AWpH5Q/1/da"><img src="http://feedads.g.doubleclick.net/~a/oUKEW3n58Eyri851r_dX-AWpH5Q/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/jtmelton/~4/3uPjcHXJjmk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jtmelton.com/2012/04/10/year-of-security-for-java-week-15-audit-security-related-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jtmelton.com/2012/04/10/year-of-security-for-java-week-15-audit-security-related-events/</feedburner:origLink></item>
		<item>
		<title>Year Of Security for Java – Week 14 – Store JSPs in WEB-INF</title>
		<link>http://feedproxy.google.com/~r/jtmelton/~3/rbmKqiMGUPQ/</link>
		<comments>http://www.jtmelton.com/2012/04/03/year-of-security-for-java-week-14-store-jsps-in-web-inf/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 03:18:10 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Forced Browsing]]></category>
		<category><![CDATA[Java Server Pages]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[WEB-INF]]></category>

		<guid isPermaLink="false">http://www.jtmelton.com/?p=283</guid>
		<description><![CDATA[What is it and why should I care? Java Server Pages (JSPs) is an extremely common UI view technology used in J2EE development. JSPs represent the interface the end user interacts with while using an application. JSPs also usually include some business logic, and frequently there are portions of a page protected by some authorization [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1c9918a7a9b1394ec9f25a3d30b5b9df&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-right: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F04%2F03%2Fyear-of-security-for-java-week-14-store-jsps-in-web-inf%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F04%2F03%2Fyear-of-security-for-java-week-14-store-jsps-in-web-inf%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>What is it and why should I care?</strong><br />
Java Server Pages (JSPs) is an extremely common UI view technology used in J2EE development. JSPs represent the interface the end user interacts with while using an application. JSPs also usually include some business logic, and frequently there are portions of a page protected by some authorization constraints. Additionally, there are many times other protections in request handling (controller) code that perform some authorization before forwarding users to a given JSP. Bottom line, there is important logic (and at times data) stored in JSPs that shouldn&#8217;t be generally accessible to end users without going through the appropriate controls to gain access to them. </p>
<p>Knowing that these resources are important to the application, we&#8217;d certainly like to protect them. In general, modern applications rely on frameworks that use an MVC model for accessing an application. What that practically means regarding JSPs is that there is no direct access to the JSP during normal use of the application. You make a request to some type of controller or handler that performs some business logic and then internally forwards to a JSP for rendering. This means JSPs are generally no longer directly accessed, at least on purpose. However, if you store your JSPs in an area accessible to the web without putting them in the WEB-INF (same place where your web.xml goes) directory, they can be directly browsed by users (unless you have other protections in place). This means your pages will most likely break functionally (since they won&#8217;t have certain data they are expecting to come from the controller), and they will often times not have the appropriate authorizations performed since those are often expected to occur when a user follows the path through the controller.  </p>
<p><em>Note:</em> These same points could be made about certain types of configuration files, scripts and other types of data included in web applications, but JSPs are generally recognized as the most common resource type that is able to be force-browsed by the end user and contains important data. Also, configuration files for many frameworks work only when they are stored in WEB-INF, simplifying the issue there by forcing you to do it right. </p>
<p><strong>What should I do about it?</strong><br />
The Servlet Specification defines that the WEB-INF directory of a deployed application is not to be directly accessible by external users. In other words, if a request is made for a resource in WEB-INF, it will be rejected. The only way this won&#8217;t be the case is if there is a bug in the application server running your application. </p>
<p>For this reason, you should store your JSPs in WEB-INF. This way, your application will still be able to use them, since forwarding to a resource in WEB-INF happens server-side and doesn&#8217;t present an access issue. Additionally, you prevent external users from being able to request them successfully by force browsing to them. </p>
<p>One thing to be aware of is that code that does file manipulation (read, write, move, etc.) on server-side files is still able to access the WEB-INF directory. This means there are still plenty of bugs out there where you can do directory traversal to read the web.xml file in the WEB-INF directory. The WEB-INF directory does prevent access to external direct requests, but not to code that runs server-side &#8211; definitely something to watch out for. </p>
<p>Storing your JSPs in the WEB-INF directory is a very simple and effective mechanism that offers protection against forced browsing attempts, and you can and should use it to provide an additional layer of protection to your applications. </p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Forced+Browsing' rel='tag' target='_self'>Forced Browsing</a>, <a class='technorati-link' href='http://technorati.com/tag/Java+Server+Pages' rel='tag' target='_self'>Java Server Pages</a>, <a class='technorati-link' href='http://technorati.com/tag/JSP' rel='tag' target='_self'>JSP</a>, <a class='technorati-link' href='http://technorati.com/tag/WEB-INF' rel='tag' target='_self'>WEB-INF</a></p>

<!-- end wp-tags-to-technorati -->

<p><a href="http://feedads.g.doubleclick.net/~a/J7coanxpZkUODX5AhgTPE4djzF8/0/da"><img src="http://feedads.g.doubleclick.net/~a/J7coanxpZkUODX5AhgTPE4djzF8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/J7coanxpZkUODX5AhgTPE4djzF8/1/da"><img src="http://feedads.g.doubleclick.net/~a/J7coanxpZkUODX5AhgTPE4djzF8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/jtmelton/~4/rbmKqiMGUPQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jtmelton.com/2012/04/03/year-of-security-for-java-week-14-store-jsps-in-web-inf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jtmelton.com/2012/04/03/year-of-security-for-java-week-14-store-jsps-in-web-inf/</feedburner:origLink></item>
		<item>
		<title>Year Of Security for Java – Week 13 – Know Your Frameworks</title>
		<link>http://feedproxy.google.com/~r/jtmelton/~3/J3NS2eQXgcE/</link>
		<comments>http://www.jtmelton.com/2012/03/29/year-of-security-for-java-week-13-know-your-frameworks/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 03:23:32 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[libraries]]></category>
		<category><![CDATA[Patching]]></category>
		<category><![CDATA[third party]]></category>

		<guid isPermaLink="false">http://www.jtmelton.com/?p=279</guid>
		<description><![CDATA[What is it and why should I care? Libraries and frameworks are a reality for every J2EE developer (pretty much any developer, actually) out there. We use them for MVC, DB, logging, web services, security, XML processing, as well as a host of other features. We rely on them in our production apps every single [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1c9918a7a9b1394ec9f25a3d30b5b9df&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-right: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F03%2F29%2Fyear-of-security-for-java-week-13-know-your-frameworks%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F03%2F29%2Fyear-of-security-for-java-week-13-know-your-frameworks%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>What is it and why should I care?</strong><br />
Libraries and frameworks are a reality for every J2EE developer (pretty much any developer, actually) out there. We use them for MVC, DB, logging, web services, security, XML processing, as well as a host of other features. We rely on them in our production apps every single day. All this code written by someone else. Code that likely hasn&#8217;t been internally vetted. Code that likely hasn&#8217;t even been looked at. Yet, we still use these masses of code (generally MUCH larger than the custom code written for the app itself) to add functionality to our applications. </p>
<p>Knowing your frameworks means you don&#8217;t accept the code blindly. When you include a piece of software in your application, you&#8217;ve inherited and are now responsible for it. From a functionality perspective, you fix it when it breaks. From a security perspective, you are now responsible for dealing with it&#8217;s vulnerabilities. This is the crux of the problem: we manage a LOT of code now (code we didn&#8217;t write) and are responsible for making sure it is functional and secure: no easy task. </p>
<p><strong>What should I do about it?</strong><br />
There are many things you should do when dealing with frameworks. I&#8217;ll cover the two I think are most important. </p>
<p>First, you should patch your frameworks when new vulnerabilities are found. This is a significant effort because it obviously requires much testing and coordination to upgrade frameworks within applications. However, there have been significant vulnerabilities found in libraries that are extremely popular, and that necessitates patching. Sometimes, patching can be done without upgrading the library actually. It could be moved off to a WAF or some such product. The point is you need to prevent the vulnerability that&#8217;s been exposed. </p>
<p>Second, you should really know and understand how your framework functions. While most frameworks patch vulnerabilities reasonably quickly (especially if the vuln public knowledge), they will often not patch their &#8220;design decisions&#8221;. These are often architectural patterns that benefit functionality, but not security. One popular pattern that comes to mind is auto-binding / mass assignment. The technique of populating the model using request data is not new, and is very powerful. It can make code much easier and cleaner to write. However, it&#8217;s often implemented with no security at all. The best you&#8217;ll usually get is an opt-in mechanism for securing it. However, most people are not going to opt-in, so it will be used insecurely in many cases. Patterns like this are frequently seen in modern frameworks, and developers really need to be aware of what&#8217;s going on internally in the framework to understand how the security and functionality of their application is going to be affected. </p>
<p>Frameworks are a necessary piece to most any development work going on today, but blindly trusting them is not. Be aware of what the frameworks you&#8217;re using do and how they do it. Keep an eye on them and patch them as necessary. This will help manage the risk of using them in your applications.  </p>
<p>This post turned out to be very timely.  Aspect Security just put out a <a href="https://www.aspectsecurity.com/blog/the-unfortunate-reality-of-insecure-libraries/">nice paper</a> (sorry, behind registration wall) on some analysis they did regarding the usage of java libraries through the maven central repo. They analyzed 113 million downloads and found that 26% of those downloads have known vulnerabilities! That&#8217;s a significant number. Their analysis doesn&#8217;t say whether or not those downloads were followed by requests for the patched versions, but I would bet not. </p>
<p>References<br />
&#8212;&#8212;&#8212;&#8211;<br />
<a href="https://www.aspectsecurity.com/blog/the-unfortunate-reality-of-insecure-libraries/">https://www.aspectsecurity.com/blog/the-unfortunate-reality-of-insecure-libraries/</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/frameworks' rel='tag' target='_self'>frameworks</a>, <a class='technorati-link' href='http://technorati.com/tag/J2EE' rel='tag' target='_self'>J2EE</a>, <a class='technorati-link' href='http://technorati.com/tag/Java' rel='tag' target='_self'>Java</a>, <a class='technorati-link' href='http://technorati.com/tag/libraries' rel='tag' target='_self'>libraries</a>, <a class='technorati-link' href='http://technorati.com/tag/Patching' rel='tag' target='_self'>Patching</a>, <a class='technorati-link' href='http://technorati.com/tag/Security' rel='tag' target='_self'>Security</a>, <a class='technorati-link' href='http://technorati.com/tag/third+party' rel='tag' target='_self'>third party</a></p>

<!-- end wp-tags-to-technorati -->

<p><a href="http://feedads.g.doubleclick.net/~a/NhIqlIYA9aoUl9BRp7qAnf7Tgvg/0/da"><img src="http://feedads.g.doubleclick.net/~a/NhIqlIYA9aoUl9BRp7qAnf7Tgvg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/NhIqlIYA9aoUl9BRp7qAnf7Tgvg/1/da"><img src="http://feedads.g.doubleclick.net/~a/NhIqlIYA9aoUl9BRp7qAnf7Tgvg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/jtmelton/~4/J3NS2eQXgcE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jtmelton.com/2012/03/29/year-of-security-for-java-week-13-know-your-frameworks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.jtmelton.com/2012/03/29/year-of-security-for-java-week-13-know-your-frameworks/</feedburner:origLink></item>
		<item>
		<title>Year Of Security for Java – Week 12 – Log Forging Prevention</title>
		<link>http://feedproxy.google.com/~r/jtmelton/~3/W7-GJjLQ8O0/</link>
		<comments>http://www.jtmelton.com/2012/03/20/year-of-security-for-java-week-12-log-forging-prevention/#comments</comments>
		<pubDate>Wed, 21 Mar 2012 02:54:31 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Log Forging]]></category>

		<guid isPermaLink="false">http://www.jtmelton.com/?p=260</guid>
		<description><![CDATA[What is it and why should I care? Log forging is an issue that can occur if you allow un-trusted data to be written to a log storage mechanism. The intent of the attacker using log forging is to cover his tracks in the logs or at least make understanding what he was doing more [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1c9918a7a9b1394ec9f25a3d30b5b9df&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-right: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F03%2F20%2Fyear-of-security-for-java-week-12-log-forging-prevention%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F03%2F20%2Fyear-of-security-for-java-week-12-log-forging-prevention%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>What is it and why should I care?</strong><br />
Log forging is an issue that can occur if you allow un-trusted data to be written to a log storage mechanism. The intent of the attacker using log forging is to cover his tracks in the logs or at least make understanding what he was doing more difficult. Unfortunately, like most log-related issues, it&#8217;s generally not a concern until something happens and you actually need the logs. </p>
<p>A simple example of log forging might look like this: (first the code)</p>
<pre class="brush: java">
String someVar = getRequestParameter("xyz");
log("Data is: " + someVar);
</pre>
<p>And now for what a normal request and the associated log entry might look like: </p>
<pre class="brush: plain">
?xyz=my name is Bob

[2012-03-15 02:04:31] [bob] Data is: my name is Bob
</pre>
<p>And finally what a forged request and the associated log entry might look like: </p>
<pre class="brush: plain">
?xyz=my name is Bob\r\n[2012-03-15 02:04:39] [mary] Mary created new user\r\n[2012-03-15 02:04:46] [josh] Josh logged out\r\n[2012-03-15 02:04:55] [susan] Susan performed an important transaction

[2012-03-15 02:04:31] [bob] Data is: my name is Bob
[2012-03-15 02:04:39] [mary] Mary created new user
[2012-03-15 02:04:46] [josh] Josh logged out
[2012-03-15 02:04:55] [susan] Susan performed an important transaction
</pre>
<p>The idea here is that the attacker has surmised what a standard log entry might look like and then using simple newline characters created what appear to be new legitimate log entries.</p>
<p><em>Note</em>: If you are using a database for logging, you likely won&#8217;t have as much of an issue since each entry is going to be in a single row. However, it could still affect you if your log viewer doesn&#8217;t distinguish between rows. However, you still need to be aware of SQL injection here, which is actually a much more serious issue.</p>
<p><strong>What should I do about it?</strong><br />
Fortunately, log forging has a relatively simple fix. </p>
<p>The general approach is to <em>validate input</em> (you should already be doing this) <strong>and</strong> <em>encode output</em> (you also should be doing this). Validating input alone is not generally going to stop this attack, since there are valid cases to allow input with newlines. Encoding output in addition to validating the input, however, should solve your problem. There are various options for encoding depending on your needs. A simple fix might be to strip out any user-supplied newlines or replace them with some benign character or character sequence. Another alternative might be to HTML encode the data before storing it. This allows you to decode the data later if you need to get back to the original data, as well as have it set up nicely for a web-based log viewing experience if that&#8217;s desirable. </p>
<p>Log forging is a simple issue to understand and solve &#8211; it just takes some planning ahead to deal with properly. You&#8217;ll be glad you did though when you get that 3am call to look through the logs and figure out what&#8217;s happening!</p>
<p>I&#8217;ve actually already written a longer, more detailed article about log forging prevention <a href="http://www.jtmelton.com/2010/09/21/preventing-log-forging-in-java/">here</a>, but this shorter version was meant to show the essentials and fits in with the year of security for Java content. </p>
<p>References<br />
&#8212;&#8212;&#8212;&#8211;<br />
<a href="http://www.jtmelton.com/2010/09/21/preventing-log-forging-in-java/">http://www.jtmelton.com/2010/09/21/preventing-log-forging-in-java/</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/J2EE' rel='tag' target='_self'>J2EE</a>, <a class='technorati-link' href='http://technorati.com/tag/Java' rel='tag' target='_self'>Java</a>, <a class='technorati-link' href='http://technorati.com/tag/Log+Forging' rel='tag' target='_self'>Log Forging</a>, <a class='technorati-link' href='http://technorati.com/tag/Security' rel='tag' target='_self'>Security</a></p>

<!-- end wp-tags-to-technorati -->

<p><a href="http://feedads.g.doubleclick.net/~a/iCKzoCS6TlmRrhCXWejSWJuqn_o/0/da"><img src="http://feedads.g.doubleclick.net/~a/iCKzoCS6TlmRrhCXWejSWJuqn_o/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/iCKzoCS6TlmRrhCXWejSWJuqn_o/1/da"><img src="http://feedads.g.doubleclick.net/~a/iCKzoCS6TlmRrhCXWejSWJuqn_o/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/jtmelton/~4/W7-GJjLQ8O0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jtmelton.com/2012/03/20/year-of-security-for-java-week-12-log-forging-prevention/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jtmelton.com/2012/03/20/year-of-security-for-java-week-12-log-forging-prevention/</feedburner:origLink></item>
		<item>
		<title>Year Of Security for Java – Week 11 – X-XSS-Protection</title>
		<link>http://feedproxy.google.com/~r/jtmelton/~3/2IxDw-nWIBE/</link>
		<comments>http://www.jtmelton.com/2012/03/13/year-of-security-for-java-week-11-x-xss-protection/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 01:59:38 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Cross Site Scripting]]></category>
		<category><![CDATA[Encoding]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[X-XSS-Protection]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://www.jtmelton.com/?p=270</guid>
		<description><![CDATA[What is it and why should I care? X-XSS-Protection is a Microsoft IE technology used to help prevent reflected XSS attacks in IE. Note 1: This is not a &#8220;panacea&#8221; for XSS. There is no excuse for not developing your site in a secure manner to prevent XSS. This however is a protection offered by [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=1c9918a7a9b1394ec9f25a3d30b5b9df&amp;default=http://use.perl.org/images/pix.gif' alt='No Gravatar' width=40 height=40/><div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-right: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F03%2F13%2Fyear-of-security-for-java-week-11-x-xss-protection%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jtmelton.com%2F2012%2F03%2F13%2Fyear-of-security-for-java-week-11-x-xss-protection%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>What is it and why should I care?</strong><br />
X-XSS-Protection is a Microsoft IE technology used to <em>help</em> prevent reflected XSS attacks in IE. </p>
<p><em>Note 1</em>: This is not a &#8220;panacea&#8221; for XSS. There is no excuse for not developing your site in a secure manner to <a href="http://www.jtmelton.com/2009/01/12/the-owasp-top-ten-and-esapi-part-2-cross-site-scripting-xss/">prevent XSS</a>. This however is a protection offered by the browser itself (as opposed to an application), meant to protect the masses from the vast amount of XSS litter on the internet.<br />
<em>Note 2</em>: Firefox (by way of NoScript), Chrome (by way of WebKit) and Safari(also WebKit) have similar protections, but apparently don&#8217;t use the X-XSS-Protection header as a controlling mechanism.</p>
<p>The XSS protection provided essentially checks for request content that is matched in the response and would cause an XSS vulnerability to be exploited. The filter then performs some mangling of the content to prevent the attack from succeeding. According to the <a href="http://blogs.msdn.com/b/ieinternals/archive/2011/01/31/controlling-the-internet-explorer-xss-filter-with-the-x-xss-protection-http-header.aspx">docs</a>, IE has the protection turned on by default for most security zones, including the Internet zone, which is the primary concern for most users. </p>
<p><strong>What should I do about it?</strong><br />
The first thing you should do is work towards resolving any and all XSS issues in your application. As a security minded developer, this is a <strong>must</strong>. </p>
<p>The recommendation for the use of this header is actually not so straightforward in my opinion. In general, the other HTTP headers I&#8217;ve described already in the series have had very little downside. However, the X-XSS-Protection header <a href="http://michael-coates.blogspot.com/2009/11/ie8-xss-filter-bug.html">has</a> <a href="http://xforce.iss.net/xforce/xfdb/47442">had</a> <a href="http://hackademix.net/2009/11/21/ies-xss-filter-creates-xss-vulnerabilities/">some</a> <a href="http://www.theregister.co.uk/2009/11/20/internet_explorer_security_flaw/">problems</a> in the past. As far as I&#8217;m aware, the IE folks have done a good job of dealing with the known vulns, but I still have concerns since some of the vulns have exposed security problems.</p>
<p><em>In general, I would recommend keeping the protection enabled, unless you are very sure you have XSS all cleaned up in your app</em>. However, this comes with the caveat that you should at least put some thought into the use cases in your site first. Depending on your choice, here are the options you have available to use, and how you enable them in your application using the X-XSS-Protection HTTP header. </p>
<p>1. Enable the protection for all security zones in blocking mode (Blocking mode means the site won&#8217;t display at all if an XSS attempt is found, but rather a simple warning to the user that the attack has been blocked):</p>
<pre class="brush: plain">
X-XSS-Protection: 1; mode=block
</pre>
<p>2. Enable the protection for all security zones:</p>
<pre class="brush: plain">
X-XSS-Protection: 1
</pre>
<p>3. Leave the protection enabled for the default zones:</p>
<p>Do nothing.</p>
<p>4. Disable the protection entirely (I only recommend this in 2 cases: either you&#8217;re positive that you&#8217;ve completely resolved XSS in your app, or there&#8217;s an issue in the XSS filter that you&#8217;re aware of that causes an additional vulnerability) :</p>
<pre class="brush: plain">
X-XSS-Protection: 0
</pre>
<p>The protection provided by the X-XSS-Protection header is not complete, but it does raise the bar against attackers and helps protect users. While there have certainly been some implementation issues, the fact that all the major browsers have some implementation of reflected XSS protection shows the importance of this issue. Be prudent in implementation, but certainly do everything you can to help your users be safe.</p>
<p>References<br />
&#8212;&#8212;&#8212;&#8211;<br />
<a href="http://blogs.msdn.com/b/ieinternals/archive/2011/01/31/controlling-the-internet-explorer-xss-filter-with-the-x-xss-protection-http-header.aspx">http://blogs.msdn.com/b/ieinternals/archive/2011/01/31/controlling-the-internet-explorer-xss-filter-with-the-x-xss-protection-http-header.aspx</a><br />
<a href="http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-iv-the-xss-filter.aspx">http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-iv-the-xss-filter.aspx</a><br />
<a href="http://blogs.msdn.com/b/mikeormond/archive/2009/01/26/ie8-cross-site-scripting-xss-protection.aspx">http://blogs.msdn.com/b/mikeormond/archive/2009/01/26/ie8-cross-site-scripting-xss-protection.aspx</a><br />
<a href="http://msdn.microsoft.com/en-us/library/dd565647%28v=vs.85%29.aspx">http://msdn.microsoft.com/en-us/library/dd565647(v=vs.85).aspx</a><br />
<a href="http://michael-coates.blogspot.com/2009/07/ie-8-anti-xss-bit-overblown.html">http://michael-coates.blogspot.com/2009/07/ie-8-anti-xss-bit-overblown.html</a><br />
<a href="http://jeremiahgrossman.blogspot.com/2010/01/to-disable-ie8s-xss-filter-or-not.html">http://jeremiahgrossman.blogspot.com/2010/01/to-disable-ie8s-xss-filter-or-not.html</a><br />
<a href="http://www.jtmelton.com/2009/01/12/the-owasp-top-ten-and-esapi-part-2-cross-site-scripting-xss/">http://www.jtmelton.com/2009/01/12/the-owasp-top-ten-and-esapi-part-2-cross-site-scripting-xss/</a><br />
<a href="http://michael-coates.blogspot.com/2009/11/ie8-xss-filter-bug.html">http://michael-coates.blogspot.com/2009/11/ie8-xss-filter-bug.html</a><br />
<a href="http://xforce.iss.net/xforce/xfdb/47442">http://xforce.iss.net/xforce/xfdb/47442</a><br />
<a href="http://hackademix.net/2009/11/21/ies-xss-filter-creates-xss-vulnerabilities/">http://hackademix.net/2009/11/21/ies-xss-filter-creates-xss-vulnerabilities/</a><br />
<a href="http://www.theregister.co.uk/2009/11/20/internet_explorer_security_flaw/">http://www.theregister.co.uk/2009/11/20/internet_explorer_security_flaw/</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Cross+Site+Scripting' rel='tag' target='_self'>Cross Site Scripting</a>, <a class='technorati-link' href='http://technorati.com/tag/Encoding' rel='tag' target='_self'>Encoding</a>, <a class='technorati-link' href='http://technorati.com/tag/J2EE' rel='tag' target='_self'>J2EE</a>, <a class='technorati-link' href='http://technorati.com/tag/Java' rel='tag' target='_self'>Java</a>, <a class='technorati-link' href='http://technorati.com/tag/Security' rel='tag' target='_self'>Security</a>, <a class='technorati-link' href='http://technorati.com/tag/X-XSS-Protection' rel='tag' target='_self'>X-XSS-Protection</a>, <a class='technorati-link' href='http://technorati.com/tag/XSS' rel='tag' target='_self'>XSS</a></p>

<!-- end wp-tags-to-technorati -->

<p><a href="http://feedads.g.doubleclick.net/~a/1c_DstC6cKcTo5kthWpcIGGoQvU/0/da"><img src="http://feedads.g.doubleclick.net/~a/1c_DstC6cKcTo5kthWpcIGGoQvU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/1c_DstC6cKcTo5kthWpcIGGoQvU/1/da"><img src="http://feedads.g.doubleclick.net/~a/1c_DstC6cKcTo5kthWpcIGGoQvU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/jtmelton/~4/2IxDw-nWIBE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jtmelton.com/2012/03/13/year-of-security-for-java-week-11-x-xss-protection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jtmelton.com/2012/03/13/year-of-security-for-java-week-11-x-xss-protection/</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching using disk: basic
Object Caching 2284/2436 objects using disk: basic

Served from: www.jtmelton.com @ 2012-05-17 09:34:21 -->

