<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>HTML on Bryan Avery</title><link>https://bryanavery.co.uk/categories/html/</link><description>Recent content in HTML on Bryan Avery</description><generator>Hugo -- gohugo.io</generator><language>en-GB</language><copyright>© 2026 Bryan Avery.</copyright><lastBuildDate>Thu, 19 Sep 2019 12:40:30 +0000</lastBuildDate><atom:link href="https://bryanavery.co.uk/categories/html/index.xml" rel="self" type="application/rss+xml"/><item><title>Improper Neutralization of CRLF Sequences in HTTP Headers</title><link>https://bryanavery.co.uk/improper-neutralization-of-crlf-sequences-in-http-headers/</link><pubDate>Thu, 19 Sep 2019 12:40:30 +0000</pubDate><guid>https://bryanavery.co.uk/improper-neutralization-of-crlf-sequences-in-http-headers/</guid><description>&lt;div class="page" title="Page 7"&gt;&#10;&lt;div class="layoutArea"&gt;&#10;&lt;div class="column"&gt;&#10;&lt;h2&gt;Description&lt;/h2&gt;&#10;&lt;p&gt;A function call contains an HTTP response splitting flaw. Writing untrusted input into an HTTP header allows an attacker to manipulate the HTTP response rendered by the browser, leading to cache poisoning and cross-site scripting attacks.&lt;/p&gt;&#10;&lt;div class="page" title="Page 7"&gt;&#10;&lt;div class="layoutArea"&gt;&#10;&lt;div class="column"&gt;&#10;&lt;h2&gt;Recommendations&lt;/h2&gt;&#10;&lt;p&gt;Remove unexpected carriage returns and line feeds from untrusted data used to construct an HTTP response. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible.&lt;/p&gt;&#10;&lt;p&gt;A simple string extension can resolve this issue:&lt;/p&gt;&#10;&lt;pre class="p1"&gt;public static string&lt;span class="s1"&gt; CRLFRemoval(&lt;/span&gt;this string&lt;span class="s1"&gt; token)&lt;/span&gt;&#10;&lt;p&gt;{&lt;/p&gt;&#10;&lt;p&gt;&lt;span class="Apple-converted-space"&gt;    &lt;/span&gt;&lt;span class="s2"&gt;return&lt;/span&gt; token.Replace(&lt;span class="s3"&gt;&amp;quot;%0d&amp;quot;&lt;/span&gt;, &lt;span class="s2"&gt;string&lt;/span&gt;.Empty, StringComparison.InvariantCultureIgnoreCase)&lt;/p&gt;&#10;&lt;p&gt;&lt;span class="Apple-converted-space"&gt;                &lt;/span&gt;.Replace(&lt;span class="s3"&gt;&amp;quot;%0D&amp;quot;&lt;/span&gt;, &lt;span class="s2"&gt;string&lt;/span&gt;.Empty, StringComparison.InvariantCultureIgnoreCase)&lt;/p&gt;&#10;&lt;p&gt;&lt;span class="Apple-converted-space"&gt;                &lt;/span&gt;.Replace(&lt;span class="s3"&gt;&amp;quot;\r&amp;quot;&lt;/span&gt;, &lt;span class="s2"&gt;string&lt;/span&gt;.Empty)&lt;/p&gt;&#10;&lt;p&gt;&lt;span class="Apple-converted-space"&gt;                &lt;/span&gt;.Replace(&lt;span class="s3"&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;, &lt;span class="s2"&gt;string&lt;/span&gt;.Empty)&lt;/p&gt;&#10;&lt;p&gt;&lt;span class="Apple-converted-space"&gt;                &lt;/span&gt;.Replace(&lt;span class="s3"&gt;&amp;quot;%0a&amp;quot;&lt;/span&gt;, &lt;span class="s2"&gt;string&lt;/span&gt;.Empty, StringComparison.InvariantCultureIgnoreCase)&lt;/p&gt;&#10;&lt;p&gt;&lt;span class="Apple-converted-space"&gt;                &lt;/span&gt;.Replace(&lt;span class="s3"&gt;&amp;quot;%0A&amp;quot;&lt;/span&gt;, &lt;span class="s2"&gt;string&lt;/span&gt;.Empty, StringComparison.InvariantCultureIgnoreCase);&lt;/p&gt;&#10;&lt;p&gt;}&lt;/pre&gt;&lt;/p&gt;&#10;&lt;p&gt;Links for reference:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/HTTP_response_splitting" rel="noopener" target="_blank"&gt;https://en.wikipedia.org/wiki/HTTP_response_splitting&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://securiteam.com/securityreviews/5WP0E2KFGK" rel="noopener" target="_blank"&gt;https://securiteam.com/securityreviews/5WP0E2KFGK&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://www.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-017)" rel="noopener" target="_blank"&gt;https://www.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-017)&lt;/a&gt;&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;</description></item><item><title>No Caching in any Browser</title><link>https://bryanavery.co.uk/no-caching-in-any-browser/</link><pubDate>Wed, 21 Aug 2013 11:09:00 +0000</pubDate><guid>https://bryanavery.co.uk/no-caching-in-any-browser/</guid><description>&lt;p&gt;I need to stop caching across all browsers of my website for security reasons.  This has been driving me nuts over the past two weeks, as every method I try just keep allow some caching to be stored.  Easiest way to check is by pressing the back key on the browsers window as the results should update.&lt;/p&gt;</description></item></channel></rss>