<?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>https &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/https/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Thu, 23 Jan 2025 08:41:59 +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>https &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[A quick look inside the HSTS file]]></title>
		<link>https://shkspr.mobi/blog/2024/01/a-quick-look-inside-the-hsts-file/</link>
					<comments>https://shkspr.mobi/blog/2024/01/a-quick-look-inside-the-hsts-file/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 03 Jan 2024 12:34:36 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[CyberSecurity]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[domains]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[security]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=49041</guid>

					<description><![CDATA[You type in to your browser&#039;s address bar example.com and it automatically redirects you to the https:// version. How does your browser know that it needed to request the more secure version of a website?  The answer is... A big list.  The HTTP Strict Transport Security (HSTS) list is a list of domain names which have told Google that they always want their website served over https.  If the user …]]></description>
										<content:encoded><![CDATA[<p>You type in to your browser's address bar <code>example.com</code> and it automatically redirects you to the https:// version. How does your browser know that it needed to request the more secure version of a website?</p>

<p>The answer is... A <em>big</em> list.  The <a href="https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security">HTTP Strict Transport Security</a> (HSTS) list is a list of domain names which have told Google that they <em>always</em> want their website served over https.  If the user tries to manually request the insecure version, the browser won't let them. This means that a user's connection to, for example, their bank cannot be hijacked.  A dodgy WiFi network cannot force the user to visit an insecure and fraudulent version of a site.</p>

<p>After about a decade of use, the list is now 14MB in size, with around 130,000 entries in it.  You can <a href="https://source.chromium.org/chromium/chromium/src/+/main:net/http/transport_security_state_static.json">view the list online</a> or <a href="https://chromium.googlesource.com/chromium/src/net/+/refs/heads/main/http">download it</a>.</p>

<p>The format is relatively straightforward:</p>

<pre><code class="language-json">{
 "name": "example.com",
 "policy": "bulk-1-year",
 "mode": "force-https",
 "include_subdomains": true 
},
</code></pre>

<p>When the list is updated, <a href="https://source.chromium.org/chromium/chromium/src/+/main:net/tools/transport_security_state_generator/README.md?q=transport_security_state_static.json&amp;ss=chromium%2Fchromium%2Fsrc&amp;start=11">Chrome creates a trie with Huffman coding compression</a> - so it doesn't have to parse that monster file each time.</p>

<h2 id="a-rummage-inside"><a href="https://shkspr.mobi/blog/2024/01/a-quick-look-inside-the-hsts-file/#a-rummage-inside">A rummage inside</a></h2>

<p>The most popular (over 1,000 entries) TLDs / Public Suffixes are:</p>

<table>
<thead>
<tr>
  <th align="right">Rank</th>
  <th align="center">TLD</th>
  <th align="right">Entries</th>
</tr>
</thead>
<tbody>
<tr>
  <td align="right">1</td>
  <td align="center">com</td>
  <td align="right">43,236</td>
</tr>
<tr>
  <td align="right">2</td>
  <td align="center">tk</td>
  <td align="right">19,022</td>
</tr>
<tr>
  <td align="right">3</td>
  <td align="center">de</td>
  <td align="right">5,216</td>
</tr>
<tr>
  <td align="right">4</td>
  <td align="center">org</td>
  <td align="right">4,731</td>
</tr>
<tr>
  <td align="right">5</td>
  <td align="center">gov</td>
  <td align="right">4,507</td>
</tr>
<tr>
  <td align="right">6</td>
  <td align="center">net</td>
  <td align="right">4,410</td>
</tr>
<tr>
  <td align="right">7</td>
  <td align="center">ga</td>
  <td align="right">4,326</td>
</tr>
<tr>
  <td align="right">8</td>
  <td align="center">nl</td>
  <td align="right">2,671</td>
</tr>
<tr>
  <td align="right">9</td>
  <td align="center">cf</td>
  <td align="right">2,458</td>
</tr>
<tr>
  <td align="right">10</td>
  <td align="center">ml</td>
  <td align="right">2,271</td>
</tr>
<tr>
  <td align="right">11</td>
  <td align="center">co.uk</td>
  <td align="right">2,139</td>
</tr>
<tr>
  <td align="right">12</td>
  <td align="center">fr</td>
  <td align="right">1,714</td>
</tr>
<tr>
  <td align="right">13</td>
  <td align="center">ru</td>
  <td align="right">1,516</td>
</tr>
<tr>
  <td align="right">14</td>
  <td align="center">eu</td>
  <td align="right">1,283</td>
</tr>
<tr>
  <td align="right">15</td>
  <td align="center">com.br</td>
  <td align="right">1,226</td>
</tr>
<tr>
  <td align="right">16</td>
  <td align="center">gq</td>
  <td align="right">1,225</td>
</tr>
<tr>
  <td align="right">17</td>
  <td align="center">io</td>
  <td align="right">1,215</td>
</tr>
<tr>
  <td align="right">18</td>
  <td align="center">com.au</td>
  <td align="right">1,202</td>
</tr>
<tr>
  <td align="right">19</td>
  <td align="center">it</td>
  <td align="right">1,103</td>
</tr>
<tr>
  <td align="right">20</td>
  <td align="center">cz</td>
  <td align="right">1,004</td>
</tr>
</tbody>
</table>

<p>After <code>.com</code>, the free <code>.tk</code> domain names absolutely dominate. I wonder how many of them are fraudulent?</p>

<p>There are 2,676 <code>.uk</code> domain names - only 537 of which aren't on <code>.co.uk</code>.</p>

<p>Going a bit further, there are 418 IDNs (which start with <code>xn--</code>).</p>

<p>And about 187 have "porn" in the domain.</p>

<p>You can't really extrapolate <em>much</em> from this as a data set. Lots of the domains seem to have expired or otherwise no longer work. Reading around <a href="https://hstspreload.org"></a><a href="https://hstspreload.org">https://hstspreload.org</a> it notes that because this list is <em>hard-coded</em> into Chrome it can take months before a site is added. Similarly, removal can take a long time as well.</p>

<p>I can't help feeling that there should be a better way to manage all this though.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=49041&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2024/01/a-quick-look-inside-the-hsts-file/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Should you use Let's Encrypt for internal hostnames?]]></title>
		<link>https://shkspr.mobi/blog/2022/01/should-you-use-lets-encrypt-for-internal-hostnames/</link>
					<comments>https://shkspr.mobi/blog/2022/01/should-you-use-lets-encrypt-for-internal-hostnames/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 05 Jan 2022 12:34:08 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=41580</guid>

					<description><![CDATA[Julien Savoie has written a brilliant post explaining how you can enable https on your intranet.  This is useful for several reasons. It means your employees aren&#039;t constantly fighting browser warnings when trying to submit stuff internally. All your http traffic is encrypted. You don&#039;t need to install a self-generated root certificate on devices. Lovely!  But there&#039;s a downside. Every TLS…]]></description>
										<content:encoded><![CDATA[<p>Julien Savoie has written a brilliant post explaining <a href="https://jsavoie.github.io/2021/06/01/letsencrypt.html">how you can enable https on your <em>intra</em>net</a>.</p>

<p>This is useful for several reasons. It means your employees aren't constantly fighting browser warnings when trying to submit stuff internally. All your http traffic is encrypted. You don't need to install a self-generated root certificate on devices. Lovely!</p>

<p>But there's a downside. Every TLS certificate created by Let's Encrypt is recorded in a <a href="https://letsencrypt.org/docs/ct-logs/">Certificate Transparency log</a>.  These CT logs are primarily to detect <a href="https://certificate.transparency.dev/">maliciously or mistakenly issued certificates</a>. For example, you can look through them and see that someone unauthorised has created a cert for your domain - or its sub-domains.</p>

<p>But there is a downside. The CT logs are <em>public</em> and can be searched. Here's <a href="https://crt.sh/?q=twitter.com">all the certificates issued for Twitter's sub-domains</a>.</p>

<p>There are a few ways that this can be dangerous for use with <em>internal</em> services.</p>

<p>Firstly, it aides reconnaissance for attackers. Having a "map" of your internal infrastructure is useful. Especially if you have "obviously" named servers like <code>exchange.example.com</code> or <code>customerdata.example.com</code>.  Also handy for social engineering - who else but someone internal would know that <code>gandalf.example.com</code> was a valid server?</p>

<p>Secondly, it might expose some vulnerabilities - depending on how you name things. Let's hope you don't have <code>log4j.example.com</code>!</p>

<p>Thirdly, there's the potential for espionage. Do you want your competitors knowing that you've got <code>olympics-campaign.staging.example.com</code>?</p>

<p>I'm sure you can think of a few other ways this could be used for mischief and mayhem.</p>

<p>As I wrote a few years ago, "<a href="https://shkspr.mobi/blog/2017/11/theres-no-https-for-the-internet-of-things/">There's no HTTPS for the Internet of Things</a>". Internal networks which only have IP addresses cannot use TLS certificates. OK, so you decide to have an internal DNS - now the whole world knows you have <code>doorbell-model-xyz.myhome.example.com</code>!</p>

<p>The only real answer to this is to use <a href="https://community.letsencrypt.org/t/acme-v2-production-environment-wildcards/55578">Wildcard Certificates</a>.  You can get a TLS certificate for <code>*.internal.example.com</code></p>

<p>This requires setting up a <a href="https://letsencrypt.org/docs/challenge-types/#dns-01-challenge">DNS-01 Challenge</a> - which can be more difficult to configure and has some non-obvious risks. And, sadly, <a href="https://blog.sean-wright.com/wildcard-certs-not-quite-the-star/">Wildcard certificates come with their own difficulties</a>.</p>

<h2 id="recap"><a href="https://shkspr.mobi/blog/2022/01/should-you-use-lets-encrypt-for-internal-hostnames/#recap">Recap</a></h2>

<p>I don't think there's a good solution to this.</p>

<ul>
<li>Self-signed certificates require something to be installed on all clients. Not always possible with BYOD.</li>
<li>Named LE certificates expose details of your infrastructure which you may wish to keep private.</li>
<li>Wildcard certificates require a heightened level of co-ordination and management.</li>
</ul>

<p>These problems <a href="https://news.ycombinator.com/item?id=19353294">have all been discussed before</a>. But I can't help but wishing that there was something obvious I'm missing.</p>

<p>How would you solve this knotty problem?</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=41580&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2022/01/should-you-use-lets-encrypt-for-internal-hostnames/feed/</wfw:commentRss>
			<slash:comments>29</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Path - Privacy & Security Problems]]></title>
		<link>https://shkspr.mobi/blog/2012/01/path-privacy-security-problems/</link>
					<comments>https://shkspr.mobi/blog/2012/01/path-privacy-security-problems/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 16 Jan 2012 11:19:43 +0000</pubDate>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=5261</guid>

					<description><![CDATA[I&#039;m trying out the new Android app for Path - the new social networking service.  I&#039;ve discovered something rather troubling...  Most of the app&#039;s communication with the Path servers is over SSL.  This means that no-one can see the data you&#039;re sending and receiving.  If there are snoops on your network, they will only be able to see the encrypted data flowing back and forth.  In general, this is…]]></description>
										<content:encoded><![CDATA[<p>I'm trying out the new Android app for Path - the new social networking service.  I've discovered something rather troubling...</p>

<p>Most of the app's communication with the Path servers is over SSL.  This means that no-one can see the data you're sending and receiving.  If there are snoops on your network, they will only be able to see the encrypted data flowing back and forth.  In general, this is a good thing.</p>

<p>Apart from images.  If your friends are posting images, they are sent over http.  <strong>No security</strong>.  Anyone monitoring your network connection will be able to see all the images you're viewing.</p>

<p>Now, that's bad enough - but it turns out that all the images you <em>send</em> are visible to the the world even if you've set your post to private.</p>

<p>The images are sent over SSL, but as soon as you return to your "Path", a thumbnail is shown of what you've just posted!</p>

<p>Here's a picture of the logs, so you can see what's happening.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2012/01/path-ssl.png" alt="path ssl" title="path ssl" width="600" height="339" class="aligncenter size-full wp-image-5262">

<p>So, every image you post or see - including the avatars of your friends - are visible to all.  A rather serious security and privacy problem.</p>

<p>Oh, does anyone know what the unencrypted call to "sendgrid.net" is all about?</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=5261&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2012/01/path-privacy-security-problems/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[A (Minor) Twitter Privacy Bug?]]></title>
		<link>https://shkspr.mobi/blog/2011/05/a-minor-twitter-privacy-bug/</link>
					<comments>https://shkspr.mobi/blog/2011/05/a-minor-twitter-privacy-bug/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 09 May 2011 12:00:03 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[twitter]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=4045</guid>

					<description><![CDATA[Quick Summary  Twitter&#039;s secure API hides the contents of the tweets you are reading. But it doesn&#039;t hide the images of those you converse with.  Raised as Issue 2175.  A Bit More Detail  Twitter has a secure (HTTPS) and insecure (HTTP) API.  When calling the secure API, all the content of the returned message (tweets) are encrypted.  Eavesdroppers only see the cipher-text - essentially garbage.  …]]></description>
										<content:encoded><![CDATA[<h2 id="quick-summary"><a href="https://shkspr.mobi/blog/2011/05/a-minor-twitter-privacy-bug/#quick-summary">Quick Summary</a></h2>

<p>Twitter's secure API hides the contents of the tweets you are reading. But it doesn't hide the images of those you converse with.</p>

<p><a href="http://code.google.com/p/twitter-api/issues/detail?id=2175">Raised as Issue 2175</a>.</p>

<h2 id="a-bit-more-detail"><a href="https://shkspr.mobi/blog/2011/05/a-minor-twitter-privacy-bug/#a-bit-more-detail">A Bit More Detail</a></h2>

<p>Twitter has a secure (HTTPS) and insecure (HTTP) API.</p>

<p>When calling the secure API, all the content of the returned message (tweets) are encrypted.  Eavesdroppers only see the cipher-text - essentially garbage.</p>

<p>However, within that cipher-text are links to <em>insecure</em> resources.</p>

<p>For example, a user requesting my tweets will get an object which contains a link to my avatar image.</p>

<p>Twitter is currently returning the <em>insecure</em> link:</p>

<pre>"profile_image_url" :
    "http://a2.twimg.com/profile_images/1283757621/Sketch_Avatar.jpg"</pre>

<p>Twitter should be returning the <em>secure</em> link:</p>

<pre>"profile_image_url" :
    "https://si0.twimg.com/profile_images/1283757621/Sketch_Avatar.jpg"</pre>

<h2 id="exploiting-this-weakness"><a href="https://shkspr.mobi/blog/2011/05/a-minor-twitter-privacy-bug/#exploiting-this-weakness">Exploiting This Weakness</a></h2>

<p>A user (Anna) will request the <em>encrypted</em> text of my tweets
She then requests the <em>unencrypted</em> image.
An eavesdropper (Eve) is listening in on the connection between Anna and Twitter.</p>

<pre>Anna ----&gt;Eve----&gt;Twitter  (Secure request)
Anna &lt;----Eve&lt;----Twitter  (Secure response)</pre>

<p>When Anna makes the initial request to Twitter, the malicious Eve can't see what they're talking about.</p>

<ul>
    <li>The request "http<strong>s</strong>://example.com/twitter/edent" is itself encrypted.  Eve only sees an encrypted request to example.com - not "twitter/edent</li>
    <li>The response containing all the tweets is also encrypted</li>
</ul>

<pre>Anna ----&gt;Eve----&gt;Images  (insecure request)
Anna &lt;----Eve&lt;----Twitter  (insecure response)
</pre>

<p>Anna then makes the subsequent request for the twitter user's image, a malicious user can see</p>

<ul>
    <li>The URI of the request.</li>
    <li>The content of the image.</li>
</ul>

<h2 id="impact"><a href="https://shkspr.mobi/blog/2011/05/a-minor-twitter-privacy-bug/#impact">Impact</a></h2>

<p>Truth is, this has a pretty low security impact.</p>

<ul>
    <li>There is no way to determine a user's name based on the URI for their image. (Unless you already have both).</li>
    <li>An eavesdropper has no way of knowing if the image is from the timeline, a reply, a DM, a search, a retweet, or the public timeline.</li>
    <li>Images may be locally cached by the user's browser - so frequency analysis isn't reliable.</li>
    <li>A malicious user <em>could</em> alter the image in transit.</li>
</ul>

<p>Worst case scenario is that if a malicious man-in-the-middle knows which images relate to which Twitter users, they know the intercepted user has seen at least one tweet from that user.</p>

<p>Let's say Anna is communicating with Bob.  Eve is trying to eavesdrop.
If Bob has never tweeted, and Eve sees repeated requests from Anna for Bob's avatar, she may reasonably surmise that they are exchanging DMs.</p>

<h2 id="overall"><a href="https://shkspr.mobi/blog/2011/05/a-minor-twitter-privacy-bug/#overall">Overall</a></h2>

<p>This is a pretty low-impact privacy risk.
It can be fixed by Twitter's API returning HTTPS URIs where possible.
In the meantime, developers can replace "http://a2.twimg.com/" with "https://si0.twimg.com".</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=4045&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2011/05/a-minor-twitter-privacy-bug/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
