
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Sat, 04 Apr 2026 09:15:29 GMT</lastBuildDate>
        <item>
            <title><![CDATA[The post-quantum future: challenges and opportunities]]></title>
            <link>https://blog.cloudflare.com/post-quantum-future/</link>
            <pubDate>Fri, 25 Feb 2022 16:03:25 GMT</pubDate>
            <description><![CDATA[ The story and path of post-quantum cryptography is clear. But, what are the future challenges? In this blog post, we explore them ]]></description>
            <content:encoded><![CDATA[ <p></p><blockquote><p><i>“People ask me to predict the future, when all I want to do is prevent it. Better yet, build it. Predicting the future is much too easy, anyway. You look at the people around you, the street you stand on, the visible air you breathe, and predict more of the same. To hell with more. I want better.”— </i><b><i>Ray Bradbury</i></b><i>, from Beyond 1984: The People Machines</i></p></blockquote><p>The <a href="/post-quantum-taxonomy/">story and the path are clear</a>: quantum computers are coming that will have the ability to break the cryptographic mechanisms we rely on to secure modern communications, but there is hope! The cryptographic community has designed new mechanisms to safeguard against this disruption. There are challenges: will the new safeguards be practical? How will the fast-evolving Internet migrate to this new reality? In <a href="/making-protocols-post-quantum/">other</a> <a href="/post-quantum-key-encapsulation/">blog</a> <a href="/post-quantum-key-encapsulation/">posts</a> in this series, we have outlined some potential solutions to these questions: there are new algorithms for maintaining confidentiality and authentication (in a “post-quantum” manner) in the protocols we use. But will they be fast enough to deploy at scale? Will they provide the required properties and work in all protocols? Are they easy to use?</p><p>Adding <a href="https://www.cloudflare.com/learning/ssl/quantum/what-is-post-quantum-cryptography/">post-quantum cryptography</a> into architectures and networks is not only about being novel and looking at interesting research problems or exciting engineering challenges. It is primarily about protecting people’s communications and data because a quantum adversary can not only decrypt future traffic but, if they want to, past traffic. Quantum adversaries could also be capable of other attacks (by using quantum algorithms, for example) that we may be unaware of now, so protecting against them is, in a way, the challenge of facing the unknown. We can’t fully predict everything that will happen with the advent of quantum computers<sup>1</sup>, but we can prepare and build greater protections than the ones that currently exist. We do not see the future as apocalyptic, but as an opportunity to reflect, discover and build better.</p><p>What are the challenges, then? And related to this question: what have we learned from the past that enables us to <i>build better</i> in a post-quantum world?</p>
    <div>
      <h3>Beyond a post-quantum TLS</h3>
      <a href="#beyond-a-post-quantum-tls">
        
      </a>
    </div>
    <p>As we have shown in <a href="/post-quantum-taxonomy/">other</a> <a href="/making-protocols-post-quantum/">blog posts</a>, the most important security and privacy properties to protect in the face of a quantum computer are confidentiality and authentication. The <a href="https://en.wikipedia.org/wiki/Threat_model">threat model</a> of confidentiality is clear: quantum computers will not only be able to decrypt on-going traffic, but also any traffic that was recorded and stored prior to their arrival. The threat model for authentication is a little more complex: a quantum computer could be used to impersonate a party (by successfully mounting a <a href="https://en.wikipedia.org/wiki/Man-in-the-middle_attack">monster-in-the-middle attack</a>, for example) in a connection or conversation, and it could also be used to retroactively modify elements of the past message, like the identity of a sender (by, for example, changing the authorship of a past message to a different party). Both threat models are important to consider and pose a problem not only for future traffic but also for any traffic sent now.</p><p>In the case of using a quantum computer to impersonate a party: how can this be done? Suppose an attacker is able to use a quantum computer to compromise a user’s TLS certificate private key (which has been used to sign lots of past connections). The attacker can then forge connections and pretend that they come from the honest user (by signing with the user’s key) to another user, let’s say Bob. Bob will think the connections are coming from the honest user (as they all did in the past), when, in reality, they are now coming from the attacker.</p><p>We have algorithms that protect confidentiality and authentication in the face of quantum threats. We know how to integrate them into TLS, as we have seen in <a href="/making-protocols-post-quantum/">this blog post</a>, so is that it? Will our connections then be safe? We argue that we will not yet be done, and these are the future challenges we see:</p><ul><li><p>Changing the key exchange of the TLS handshake is simple; changing the authentication of TLS, in practice, is hard.</p></li><li><p><a href="/monsters-in-the-middleboxes/">Middleboxes and middleware</a> in the network, such as antivirus software and corporate proxies, can be slow to upgrade, <a href="/why-tls-1-3-isnt-in-browsers-yet/">hindering the rollout</a> of new protocols.</p></li><li><p>TLS is not the only foundational protocol of the Internet, there are other protocols to take into account: some of them are very similar to TLS and they are easy to fix; others such as DNSSEC or QUIC are more challenging.</p></li></ul><p><a href="https://datatracker.ietf.org/doc/html/rfc8446">TLS</a> (we will be focusing on its current version, which is 1.3) is a protocol that aims to achieve three primary security properties:</p><ul><li><p><a href="https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/"><b>Confidentiality: communication can be read only by the intended recipient,</b></a></p></li><li><p><a href="https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/"><b>Integrity: communication cannot be changed in transit, and</b></a></p></li><li><p><a href="https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/"><b>Authentication: we are assured communication comes from the peer we are talking to</b></a>.</p></li></ul><p>The first two properties are easy to maintain in a quantum-computer world: confidentiality is maintained by swapping the existing non-quantum-safe algorithm for a post-quantum one; integrity is maintained because the algorithms are intractable on a quantum computer. What about the last property, authentication? There are three ways to achieve authentication in a TLS handshake, depending on whether server-only or mutual authentication is required:</p><ol><li><p>By using a ‘pre-shared’ key (PSK) generated from a previous run of the TLS connection that can be used to establish a new connection (this is often called "session resumption" or "resuming" with a PSK),</p></li><li><p>By using a <a href="/opaque-oblivious-passwords/">Password-Authenticated Key Exchange (PAKE)</a> for handshake authentication or post-handshake authentication (with the usage of <a href="https://datatracker.ietf.org/doc/draft-ietf-tls-exported-authenticator/">exported authenticators</a>, for example). This can be done by using the <a href="https://github.com/grittygrease/draft-sullivan-tls-opaque/blob/master/draft-sullivan-tls-opaque.md">OPAQUE</a> or the <a href="http://www.watersprings.org/pub/id/draft-barnes-tls-pake-00.html">SPAKE</a> protocols,</p></li><li><p>By using public certificates that advertise parameters that are employed to assure (i.e., create a proof of) the identity of the party you are talking to (this is by far the most common method).</p></li></ol><p>Securing the first authentication mechanism is easily achieved in the post-quantum sphere as a unique key is derived from the initial quantum-protected handshake. The second authentication mechanism does not pose a theoretical challenge (as public and private parameters are replaced with post-quantum counterparts) but rather faces practical limitations: certificate-based authentication involves multiple actors and it is difficult to properly synchronize this change with them, as we will see next. It is not only one public parameter and one public certificate: certificate-based authentication is achieved through the use of a certificate chain with multiple entities.</p><p>A certificate chain is a chain of trust by which different entities attest to the validity of public parameters to provide verifiability and confidence. Typically, for one party to authenticate another (for example, for a client to authenticate a server), a chain of certificates starting from a root’s Certificate Authority (CA) certificate is used, followed by at least one intermediate CA certificate, and finally by the leaf (or end-entity) certificate of the actual party. This is what you usually find in real-world connections. It is worth noting that the order of this chain (for TLS 1.3) does not require each certificate to certify the one immediately preceding it. Servers sometimes send both a current and deprecated intermediate certificate for transitional purposes, or are configured incorrectly.</p><p>What are these certificates? Why do multiple actors need to validate them? A (digital) certificate certifies the ownership of a public key by the named party of the certificate: it attests that the party owns the private counterpart of the public parameter through the use of <a href="https://en.wikipedia.org/wiki/Digital_signature">digital signatures</a>. A CA is the entity that issues these certificates. Browsers, operating systems or mobile devices operate CA “membership” programs where a CA must meet certain criteria to be incorporated into the trusted set. Devices accept their CA root certificates as they come “pre-installed” in a root store. Root certificates, in turn, are used to generate a number of intermediate certificates which will be, in turn, used to generate leaf certificates. This certificate chain process of generation, validation and revocation is not only a procedure that happens at a software level but rather an amalgamation of policies, rules, roles, and hardware<sup>2</sup> and software needs. This is what is often called the <a href="https://en.wikipedia.org/wiki/Public_key_infrastructure">Public Key Infrastructure (PKI)</a>.</p><p>All of the above goes to show that while we can change all of these parameters to post-quantum ones, it is not as simple as just modifying the TLS handshake. Certificate-based authentication involves many actors and processes, and it does not only involve one algorithm (as it happens in the key exchange phase) but typically at least six signatures: one handshake signature; two in the certificate chain; one <a href="/high-reliability-ocsp-stapling/">OCSP staple</a> and <a href="/introducing-certificate-transparency-and-nimbus/">two SCTs</a>. The last five signatures together are used to prove that the server you’re talking to is the right server for the website you’re visiting, for example. Of these five, the last three are essentially patches: the OCSP staple is used to deal with revoked certificates and the SCTs are to detect rogue CA’s. Starting with a clean slate, could we improve on the <i>status quo</i> with an efficient solution?</p><p>More pointedly, we can ask if indeed we still need to use this system of public attestation. The migration to post-quantum cryptography is also an opportunity to modify this system. The PKI as it exists is difficult to maintain, update, revoke, <a href="https://hal.inria.fr/hal-01625766/file/CSF2017-PKI%281%29.pdf">model, or compose.</a> We have an opportunity, perhaps, to rethink this system.</p><p>Even without considering making fundamental changes to public attestation, updating the existing complex system presents both technical and management/coordination challenges:</p><ul><li><p>On the technical side: are the post-quantum signatures, which have larger sizes and bigger computation times, usable in our handshakes? We explore <a href="/sizing-up-post-quantum-signatures/">this idea in this experiment</a>, but we need more information. One potential solution is to cache intermediate certificates or to use other forms of authentication beyond digital signatures (like <a href="/kemtls-post-quantum-tls-without-signatures/">KEMTLS</a>).</p></li><li><p>On the management/coordination side: how are we going to coordinate the migration of this complex system? Will there be some kind of ceremony to update algorithms? How will we deal with the situation where some systems have updated but others have not? How will we revoke past certificates?</p></li></ul><p>This challenge brings into light that the migration to post-quantum cryptography is not only about the technical changes but is dependent on how the Internet works as the interconnected community that it is. Changing systems involves coordination and the collective willingness to do so.</p><p>On the other hand, post-quantum password-based authentication for TLS is still an open discussion. Most PAKE systems nowadays use <a href="https://en.wikipedia.org/wiki/Decisional_Diffie%E2%80%93Hellman_assumption">Diffie-Hellman assumptions</a>, which can be broken by a quantum computer. There are <a href="https://eprint.iacr.org/2020/1532">some</a> <a href="https://eprint.iacr.org/2019/1271.pdf">ideas</a> on how to transition their underlying algorithms to the post-quantum world; but these seem to be so inefficient as to render their deployment infeasible. It seems, though, that password authentication has an interesting property called “<a href="https://eprint.iacr.org/2021/696.pdf">quantum annoyance</a>”. A quantum computer can compromise the algorithm, but only one instance of the problem at the time for each guess of a password: “Essentially, the adversary must guess a password, solve a discrete logarithm based on their guess, and then check to see if they were correct”, as <a href="https://eprint.iacr.org/2021/696.pdf">stated in the paper</a>. Early quantum computers might take quite a long time to solve each guess, which means that a quantum-annoying PAKE combined with a large password space could delay quantum adversaries considerably in their goal of recovering a large number of passwords. Password-based authentication for TLS, therefore, could be safe for a longer time. But this does not mean, however, that it is not threatened by quantum adversaries.</p><p>The world of security protocols, though, does not end with TLS. There are many other security protocols (such as <a href="https://www.cloudflare.com/learning/dns/dnssec/ecdsa-and-dnssec/">DNSSEC</a>, <a href="https://www.wireguard.com/">WireGuard</a>, SSH, <a href="https://en.wikipedia.org/wiki/QUIC">QUIC</a>, and more) that will need to transition to post-quantum cryptography. For DNSSEC, the challenge is complicated by the protocol not seeming to be able to <a href="https://github.com/claucece/PQNet-Workshop/blob/main/slides/PQC%20and%20DNSSEC%20(with%20animations).pdf">deal with large signatures or high computation costs on verification time</a>. According to <a href="https://www.sidnlabs.nl/downloads/7qGFW0DiOkov0vWyDK9qaK/de709198ac34477797b381f146639e27/Retrofitting_Post-Quantum_Cryptography_in_Internet_Protocols.pdf">research</a> from SIDN Labs, it seems like only Falcon-512 and Rainbow-I-CZ can be used in DNSSEC (note that, though, there is a <a href="https://eprint.iacr.org/2022/214">recent attack</a> on Rainbow).</p>
<table>
<colgroup>
<col></col>
<col></col>
<col></col>
<col></col>
</colgroup>
<thead>
  <tr>
    <th>Scheme</th>
    <th>Public key size</th>
    <th>Signature size</th>
    <th>Speed of operations</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td><span>Finalists</span><br /></td>
  </tr>
  <tr>
    <td>Dilithium2</td>
    <td>1,312</td>
    <td>2,420</td>
    <td>Very fast</td>
  </tr>
  <tr>
    <td>Falcon-512</td>
    <td>897</td>
    <td>690</td>
    <td>Fast, if you have the right hardware</td>
  </tr>
  <tr>
    <td>Rainbos-I-CZ</td>
    <td>103,648</td>
    <td>66</td>
    <td>Fast</td>
  </tr>
  <tr>
    <td><span>Alternate Candidates</span></td>
  </tr>
  <tr>
    <td><span>SPHINCS</span><sup>+</sup>-128f</td>
    <td>32</td>
    <td>17,088</td>
    <td>Slow</td>
  </tr>
  <tr>
    <td><span>SPHINCS</span><sup>+</sup><span>-128s</span></td>
    <td>32</td>
    <td>7,856</td>
    <td>Very slow</td>
  </tr>
  <tr>
    <td>GeMSS-128</td>
    <td>352,188</td>
    <td>33</td>
    <td>Very slow</td>
  </tr>
  <tr>
    <td>Picnic3</td>
    <td>35</td>
    <td>14,612</td>
    <td>Very slow</td>
  </tr>
</tbody>
</table><p>Table 1: Signature post-quantum algorithms. The orange rows show the suitable algorithms for DNSSEC.</p><p>What are the alternatives for a post-quantum DNSSEC? Perhaps, the isogeny-based signature scheme, <a href="https://eprint.iacr.org/2020/1240">SQISign</a>, might be a solution if its verification time can be improved (which currently is 42 ms as <a href="https://eprint.iacr.org/2020/1240.pdf">noted in the original paper</a> when running on a 3.40GHz Intel Core i7-6700 CPU over 250 runs for verification. Still slower than <a href="https://en.wikipedia.org/wiki/P-384">P-384</a>. Recently, it <a href="https://eprint.iacr.org/2022/234.pdf">has improved to 25ms</a>). Another solution might be the usage of <a href="https://eprint.iacr.org/2021/1144.pdf">MAYO</a>, which on an Intel i5-8400H CPU at 2.5GHz, a signing operation can take 2.50 million cycles, and a verification operation can take 1.3 million cycles. There is a lot of research that needs to be done to make isogeny-based cryptography faster so it will fit the protocol’s needs (research on this area is currently ongoing —see, for example, the <a href="https://isogenyschool2020.co.uk/">Isogeny School</a>) and provide assurance of their security properties. Another alternative could be using other forms of authentication for this protocol’s case, like using <a href="https://blog.verisign.com/security/securing-the-dns-in-a-post-quantum-world-hash-based-signatures-and-synthesized-zone-signing-keys/">hash-based signatures</a>.</p><p>DNSSEC is just one example of a protocol where post-quantum cryptography has a long road ahead, as we need hands-on experimentation to go along with technical updates. For the other protocols, there is timely research: there are, for example, proposals for a <a href="https://eprint.iacr.org/2020/379.pdf">post-quantum WireGuard</a> and for a <a href="https://openquantumsafe.org/applications/ssh.html">post-quantum SSH</a>. More research, though, needs to be done on the practical implications of these changes over real connections.</p><p>One important thing to note here is that there will likely be an intermediate period in which security protocols provide a “hybrid” set of algorithms for transitional purposes, compliance and security. “Hybrid” means that both a pre-quantum (or classical) algorithm and a post-quantum one are used to generate the secret used to encrypt or provide authentication. The security reason for using this hybrid mode is due to safeguarding in case post-quantum algorithms are broken. There are still many unknowns here (single code point, multiple codepoints, contingency plans) that we need to consider.</p>
    <div>
      <h3>The failures of cryptography in practice</h3>
      <a href="#the-failures-of-cryptography-in-practice">
        
      </a>
    </div>
    <p>The Achilles heel for cryptography is often introducing it into the real-world. Designing, implementing, and deploying cryptography is notoriously <a href="https://www.usenix.org/system/files/conference/usenixsecurity16/sec16_paper_garman.pdf">hard to get right</a> due to flaws in security proofs, implementation bugs, and vulnerabilities<sup>3</sup> of software and hardware. We often deploy cryptography that is found to be flawed and the cost of fixing it is immense (it involves resources, coordination, and more). We have some previous lessons to draw from it as a community, though. For TLS 1.3, we pushed for <a href="https://ieeexplore.ieee.org/document/7958593">verifying implementations</a> of the standard, and for using tools to <a href="https://bblanche.gitlabpages.inria.fr/publications/BlanchetETAPS12.pdf">analyze the symbolic and computational models</a>, as seen in <a href="/post-quantum-formal-analysis/">other</a> <a href="/post-quantum-easycrypt-jasmin/">blog posts</a>. Every time we design a new algorithm, we should aim for this same level of confidence, especially for the big migration to post-quantum cryptography.</p><p>In other blog posts, we have discussed our formal verification <a href="/post-quantum-easycrypt-jasmin/">efforts</a>, so we will not repeat these here. Rather let’s focus on what remains to be done on the formal verification front. Verification, analysis and implementation are not yet complete and we still need to:</p><ul><li><p>Create easy-to-understand guides into what formal analysis is and how it can be used (as formal languages are unfamiliar to developers).</p></li><li><p>Develop user-tested APIs.</p></li><li><p>Flawless integration of a post-quantum algorithm’s API into protocols’ APIs.</p></li><li><p>Test and analyze the boundaries between verified and unverified code.</p></li><li><p>Verifying specifications at the standard level by, for example, integrating <a href="https://hal.inria.fr/hal-03176482/document">hacspec</a> into IETF drafts.</p></li></ul><p>Only in doing so can we prevent some of the security issues we have had in the past. Post-quantum cryptography will be a big migration and we can, if we are not careful, repeat the same issues of the past. We want a future that is better. We want to mitigate bugs and provide high assurance of the security of connections users have.</p>
    <div>
      <h3>A post-quantum tunnel is born</h3>
      <a href="#a-post-quantum-tunnel-is-born">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5txFSxUXLbi6kiuyOjyTH9/47f7fe733085d94d038e1067862eaa67/image3-27.png" />
            
            </figure><p>We’ve described the challenges of post-quantum cryptography from a theoretical and practical perspective. These are problems we are working on and issues that we are analyzing. They will take time to solve. But what can you expect in the short-term? What new ideas do we have? Let’s look at where else we can put post-quantum cryptography.</p><p><a href="/tunnel-for-everyone/">Cloudflare Tunnel</a> is a service that creates a secure, outbound-only connection between your services and Cloudflare by deploying a lightweight connector in your environment. This is the end at the server side. At the other end, at the client side, we have <a href="/1111-warp-better-vpn/">WARP</a>, a ‘VPN’ for client devices that can secure and accelerate all HTTPS traffic. So, what if we add post-quantum cryptography to all our <a href="/post-quantumify-cloudflare">internal infrastructure</a>, and also add it to this server and the client endpoints? We would then have a post-quantum server to client connection where any request from the WARP client to a private network (one that uses Tunnel) is secure against a quantum adversary (how to do it will be similar to what is <a href="https://developers.cloudflare.com/cloudflare-one/tutorials/warp-to-tunnel">detailed here</a>). Why would we want to do this? First, because it is great to have a connection that is fully protected against quantum computers. Second, because we can better measure the impacts of post-quantum cryptography in this environment (and even measure them in a mobile environment). This will also mean that we can provide guidelines to clients and servers on how to migrate to post-quantum cryptography. It would also be the first available service to do so at this scale. How will all of us experience this transition? Only time will tell, but we are excited to work towards this vision.</p><p>And, furthermore, as Tunnel uses the <a href="https://en.wikipedia.org/wiki/QUIC">QUIC protocol</a> <a href="/getting-cloudflare-tunnels-to-connect-to-the-cloudflare-network-with-quic/">in some cases</a> and WARP uses the WireGuard protocol, this means that we can experiment with post-quantum cryptography in protocols that are novel and have not seen much experimentation in the past.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6eSXBxWZXlVqSd1tnMTbqp/5b9bca705afc12678a743deb1a741a03/image2-25.png" />
            
            </figure><p>So, what is the future in the post-quantum cryptography era? The future is better and not just the same. The future is fast and more secure. Deploying cryptography can be challenging and we have had problems with it in the past; but post-quantum cryptography is the opportunity to dream of better security, it is the path to explore, and it is the reality to make it happen.</p><p>Thank you for reading our post-quantum blog post series and expect more post-quantum content and updates from us!</p><hr /><p><i>If you are a student enrolled in a PhD or equivalent research program and looking for an internship for 2022, see </i><a href="https://research.cloudflare.com/outreach/academic-programs/interns/"><b><i>open opportunities</i></b></a><b><i>.</i></b></p><p><i>If you’re interested in contributing to projects helping Cloudflare, </i><a href="https://www.cloudflare.com/en-gb/careers/jobs/?department=Engineering&amp;location=default"><i>our engineering teams are hiring</i></a><i>.</i></p><p><i>You can reach us with questions, comments, and research ideas at </i><a><i>ask-research@cloudflare.com</i></a><i>.</i></p><p>.....</p><p><sup>1 </sup>And when we do predict, we often predict more of the same attacks we are accustomed to: adversaries breaking into connections, security being tampered with. Is this all that they will be capable of?</p><p><sup>2</sup>The private part of a public key advertised in a certificate is often the target of attacks. An attacker who steals a certificate authority's private keys is able to forge certificates, for example. Private keys are almost always stored on a hardware security module (HSM), which prevents key extraction. This is a small example of how hardware is involved in the process.</p><p><sup>3</sup>Like constant-time failures, side-channel, and timing attacks.</p> ]]></content:encoded>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Cryptography]]></category>
            <category><![CDATA[Post-Quantum]]></category>
            <guid isPermaLink="false">5qmZiK0vIXo8sNj0Aj25ZB</guid>
            <dc:creator>Sofía Celi</dc:creator>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare Research: Two Years In]]></title>
            <link>https://blog.cloudflare.com/cloudflare-research-two-years-in/</link>
            <pubDate>Sun, 10 Oct 2021 12:57:40 GMT</pubDate>
            <description><![CDATA[ What Cloudflare Research has been up to for the last two years. ]]></description>
            <content:encoded><![CDATA[ <p></p><blockquote><p>Great technology companies build innovative products and bring them into the world; iconic technology companies change the nature of the world itself.</p></blockquote><p>Cloudflare’s mission reflects our ambitions: to help build a better Internet. Fulfilling this mission requires a multifaceted approach that includes ongoing product innovation, strategic decision-making, and the audacity to challenge existing assumptions about the structure and potential of the Internet. <a href="/cloudflares-approach-to-research/">Two years ago</a>, Cloudflare Research was founded to explore opportunities that leverage fundamental and applied computer science research to help change the playing field.</p><p>We’re excited to share five operating principles that guide Cloudflare’s approach to applying research to help build a better Internet and five case studies that exemplify these principles. Cloudflare Research will be all over the blog for the next several days, so subscribe and follow along!</p>
    <div>
      <h2><b>Innovation</b> comes from all places</h2>
      <a href="#innovation-comes-from-all-places">
        
      </a>
    </div>
    <p>Innovative companies don’t become innovative by having one group of people within the company dedicated to the future; they become that way by having a culture where new ideas are free-flowing and can come from anyone. Research is most effective when it is permitted to grow beyond or outside isolated lab environments, is deeply integrated into all facets of a company’s work, and connected with the world at large. We think of our research team as a support organization dedicated to identifying and nurturing ideas that are between three and five years away.</p><p>Cloudflare Research prioritizes strong collaboration to stay on top of big questions from our product, ETI, engineering teams and industry. Within Cloudflare, we learn about problems by embedding ourselves within other teams. Externally, we invite visiting researchers and academia, sit on boards and committees, contribute to open standards design and development, attend dozens of tech conferences a year, and publish papers in conferences.</p><p>Research engineering is <i>truly full-stack</i>. We incubate ideas from conception to prototype through to production code. Our team employs specialists from academic and industry backgrounds and generalists that help connect ideas across disciplines. We work closely with the product and engineering organizations on graduation plans where code ownership is critical. We also hire many research interns who help evaluate and de-risk new ideas before we help build them into production systems and eventually hand them off to other teams at the company.</p><p>Research questions can come from all parts of the company and even from customers. Our collaborative approach has led to many positive outcomes for Cloudflare and the Internet at large.</p>
    <div>
      <h3>Case Study #1: Password security</h3>
      <a href="#case-study-1-password-security">
        
      </a>
    </div>
    <p>Several years ago, a service called <a href="https://haveibeenpwned.com/">Have I Been Pwned</a>, which lets people check if their password has been compromised in a breach, started using Cloudflare to keep the site up and running under load. However, the setup also highlighted a privacy issue: Have I Been Pwned would inevitably have access to every password submitted to the service, making it a juicy target for attackers. This insight raised the question: can such a service be offered in a privacy-preserving way?</p><p>Like much of the research team’s work, the kernel of a solution came from somewhere else at the company. The first work on the problem came from members of the support engineering organization, who developed a <a href="/validating-leaked-passwords-with-k-anonymity/">clever solution</a> that mostly solved the problem. However, this initial investigation outlined a deep and complex problem space that could have applications far beyond passwords. At this point, the research team got involved and reached out to experts, including Thomas Ristenpart at Cornell Tech, to help study it more deeply.</p><p>This collaboration led us down a path to devise a new protocol and publish a paper entitled <a href="https://dl.acm.org/doi/pdf/10.1145/3319535.3354229">Protocols for Checking Compromised Credentials</a> at <a href="https://www.sigsac.org/ccs/CCS2021/">ACM CCS 2019</a>. The paper pointed us in a direction, but a desire to take this research and make it applicable to people led us to host our first visiting researcher to help build a prototype. We found even more inspiration and support internally when we learned that another team at Cloudflare was interested in adding capabilities to the Cloudflare <a href="https://www.cloudflare.com/waf/">Web Application Firewall</a> to detect breached passwords for customers. This team ended up helping us build the prototype and integrate it into Cloudflare’s service.</p><p>This combination of customer insight, internal alignment, and external collaboration not only resulted in a powerful and unique <a href="/patching-the-internet-against-global-brute-force-campaigns/">customer feature</a>, but it also helped advance the state of the art in privacy-preserving technology for an essential aspect of our online lives: Authentication. We’ll be making an exciting announcement around this technology on Thursday, so stay tuned.</p>
    <div>
      <h2><b>A question-oriented approach</b> leads to better products</h2>
      <a href="#a-question-oriented-approach-leads-to-better-products">
        
      </a>
    </div>
    <p>To support Cloudflare’s fast-paced roadmap, the Research team takes a question-first approach. Focusing on questions is the essence of research itself, but it’s important to recognize what that means for an industry-leading company. We never stop asking big questions about the problems our products are already solving. Changes like the move from desktop to mobile computing or the transition from on-premise security solutions to the cloud happened within a decade, so it’s important to ask questions like:</p><ul><li><p>How will social and geopolitical forces changes impact the products we’re building today?</p></li><li><p>What assumptions may be present in existing systems based on the homogenous experiences of their creators?</p></li><li><p>What changes are happening in the industry that will affect the way the Internet works?</p></li><li><p>What opportunities do we see to leverage new and lower-cost hardware?</p></li><li><p>How can we scale to meet growing needs?</p></li><li><p>Are there new computing paradigms that need to be understood?</p></li><li><p>How are user expectations shifting?</p></li><li><p>Is there something we can build to help move the Internet in the right direction?</p></li><li><p>Which security or privacy risks are likely to be exacerbated in the coming years?</p></li></ul><p>By focusing on broader questions and being open to answers that don’t fit within the boundaries of existing solutions, we have the opportunity to see around corners. This type of foresight helps solve more than business problems; it can help improve products and the Internet at large. These types of questions are asked across the R&amp;D functions of the company, but research focuses on the questions that aren’t easily answered in the short-term.</p>
    <div>
      <h3>Case Study #2: SSL/TLS Recommender</h3>
      <a href="#case-study-2-ssl-tls-recommender">
        
      </a>
    </div>
    <p>When Cloudflare made <a href="https://www.cloudflare.com/application-services/products/ssl/">SSL certificates free and automatic</a> for all customers, it was a big step towards securing the web. One of the early criticisms of Cloudflare’s SSL offerings was the so-called “mullet” critique. Cloudflare offers a mode called “Flexible SSL,” which enables encryption between the browser and Cloudflare but keeps the connection between Cloudflare and the origin site unencrypted for backward compatibility. It’s called the mullet criticism because Flexible SSL provides encryption on the front half of the connection but none on the back half.</p><p>Most security risks for online communication occur between the user and Cloudflare (at the ISP or in the coffee shop, for example), not between Cloudflare and the origin server. The customers who couldn’t enable encryption on their servers had a much better security posture with Cloudflare.</p><p>In a few isolated instances, however, a customer did not take advantage of the most secure configuration possible, which resulted in unexpected and impactful security problems. Given the non-zero risk and acknowledging this valid product critique, we asked: what <i>could we do to improve the security posture of millions of websites?</i></p><p>With the help of research interns with Internet scanning and measurement expertise, we built an advanced scanning/crawling tool to see how much things could be improved. It turned out we could do a lot, so we worked with various teams across the company to connect our scanning infrastructure to Cloudflare’s product. We now offer a service to all customers called the <a href="https://developers.cloudflare.com/ssl/origin-configuration/ssl-tls-recommender">SSL/TLS recommender</a> that has helped thousands of customers secure their sites and trim their mullets. The underlying reason that websites don’t use encryption for parts of their backends is complex, and what makes this project a good example of asking questions in a pragmatic way is that it not only gives Cloudflare an improved product, but it gives researcher set of tools to further explore the fundamental problem.</p>
    <div>
      <h2>Build the tools today to deal with the issues of tomorrow</h2>
      <a href="#build-the-tools-today-to-deal-with-the-issues-of-tomorrow">
        
      </a>
    </div>
    <p>Another critical objective of research in the Cloudflare context is to help us prepare for the unknown. We identify and solve "what-if" scenarios based on how society is changing or may change. Thousands of companies rely on our infrastructure to serve their users and meet their business needs. We are continually improving their experience by future-proofing the technology that supports them during the best of times and the potential worst of times.</p><p>To prepare, we:</p><ol><li><p>Identify areas of future risk.</p></li><li><p>Explore the fundamentals of the problem.</p></li><li><p>Build expertise and validate that expertise in peer-reviewed venues.</p></li><li><p>Build operating experience with prototypes and large-scale experiments.</p></li><li><p>Build networks of relationships with those who can help in a crisis.</p></li></ol><p>We would like to emulate the strategic thinking and planning required of the often unseen groups that support society — like the <a href="https://www.cafiresci.org/research-publications">forestry service</a> or a public health department. When the fire hits or the next virus arrives, we have the best chance to not only get through it but to innovate and flourish because of the mitigations put in place and the relationships built while thinking through impending challenges.</p>
    <div>
      <h3>Case Study #3: IP Address Agility</h3>
      <a href="#case-study-3-ip-address-agility">
        
      </a>
    </div>
    <p>One area of impending risk for the Internet is the exhaustion of IPv4 addresses. There are only around four billion potential IPv4 addresses, which is fewer than the number of humans globally, let alone the number of Internet-connected devices. We decided to examine this problem more deeply in the context of Cloudflare’s unique approach to networking.</p><p>Cloudflare’s architecture challenges several assumptions about how different aspects of the Internet relate to each other. Historically, a server IP address corresponds to a specific machine. Cloudflare’s anycast architecture and server design allow any server to serve any customer site. This architecture has allowed the service to scale in incredible ways with very little work.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4OuQyv6Pdm1rWv8HYJPMGD/6cba6ee3b015ba82da845353a088afee/unnamed-7.png" />
            
            </figure><p>This insight led us to question other fundamental assumptions about how the Internet could potentially work. If an IP address doesn’t need to correspond with a specific server, what else could we decouple from it? Could we decouple hostnames from IPs? Maybe we could! We could also frame the question negatively: what do we lose if we don’t take advantage of this decoupling? It was worth an experiment, at least.</p><p>We decided to validate this assumption empirically. We ran an experiment serving all free customers from the same IP in an entire region in a cross-organizational effort that involved the DNS team, the IP addressing team, and the <a href="/unimog-cloudflares-edge-load-balancer/">edge load balancing team</a>. The experiment proved that using a single IP for millions of services was feasible, but it also highlighted some risks. The result was <a href="https://dl.acm.org/doi/10.1145/3452296.3472922">a paper</a> published in <a href="https://conferences.sigcomm.org/sigcomm/2021/">ACM SIGCOMM 2021</a> and a project to re-architect our authoritative DNS system to be infinitely more flexible.</p>
    <div>
      <h2>Going further <b>together</b></h2>
      <a href="#going-further-together">
        
      </a>
    </div>
    <p>The Internet is not simply a loose federation of companies and billions of dollars of deployed hardware; it’s a network of interconnected relationships with a global societal impact. These relationships and the technical standards that govern them are the connective tissue that allows us to build important aspects of modern society on the Internet.</p><p>Millions of Internet properties use Cloudflare’s network, which serves tens of millions of requests per second. The decisions we make, and the products we release, have significant implications on the industry and billions of people. For the majority of cases, we only control one side of the Internet connection. To serve billions of users and Internet-connected devices, we are governed by and need to support protocols such as DNS, BGP, TLS, and QUIC, defined by technical standards organizations like the Internet Engineering Task Force (IETF).</p><p>Protocols evolve, and new protocols are constantly changing to serve the evolving needs of the Internet. An important part of our mission to help build a more secure, more private, more performant, and more available Internet involves taking a leadership role in shaping these protocols, deploying them at scale, and building the open-source software that implements them.</p>
    <div>
      <h3>Case Study #4: Oblivious DNS</h3>
      <a href="#case-study-4-oblivious-dns">
        
      </a>
    </div>
    <p>When Cloudflare launched the 1.1.1.1 recursive DNS service in 2019, privacy was again at the forefront. We offered 1.1.1.1 with a new encryption standard called <a href="/dns-encryption-explained/">DNS-over-HTTPS</a> (DoH) to keep queries private as they travel over the Internet. However, even with DoH, a DNS query is associated with the IP address of the user who sent it. Cloudflare wrote a privacy policy and created technical measures to ensure that user IP data is only kept for a short amount of time and even engaged a top auditing firm to <a href="/announcing-the-results-of-the-1-1-1-1-public-dns-resolver-privacy-examination/">confirm this</a>. But still, the question remained, could we offer the service without needing to have this privacy-sensitive information in the first place? We created the <a href="/welcome-hidden-resolver/">Onion Resolver</a> to let users access the service over the Tor anonymity network, but it was extremely slow to use. Could we offer cryptographically private DNS with acceptable performance? It was an open problem.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5mSUIzWCQsR7WLfJpMjrpY/76e844601571b32df1aceb04d6db7de5/unnamed--1-.png" />
            
            </figure><p>The breakthrough came through a combination of sources. We learned about new results out of academia describing a novel proxying technique called <a href="https://www.sciendo.com/article/10.2478/popets-2019-0028">Oblivious DNS</a>. We also found other folks in the industry from Apple and Fastly who were working on the same problem. The resulting proposal combined Oblivious DNS and DoH into an elegant protocol called Oblivious DoH (or ODoH). ODoH was <a href="https://datatracker.ietf.org/doc/html/draft-pauly-dprive-oblivious-doh-07">published</a> and discussed extensively at the IETF. DNS is an especially standards-dependent protocol since different parties operate so many components of the system. ODoH adds another participant to the equation, making careful interoperability standards even more critical.</p><p>The research team took an early draft of ODoH and, with the help of an intern (whose experience on the team you’ll hear from tomorrow), we built a prototype on Cloudflare Workers. With it, we measured the performance and confirmed the viability of a large-scale ODoH deployment, leading to <a href="https://www.sciendo.com/article/10.2478/popets-2021-0085">this paper</a>, published at <a href="https://petsymposium.org/">PoPETS 2021</a>.</p><p>The results of our experimentation gave us the confidence to build a production-quality implementation. Our research engineers worked with the engineers on the resolver team to implement and <a href="/oblivious-dns/">launch ODoH</a> for 1.1.1.1. We also <a href="https://github.com/search?q=org%3Acloudflare+odoh">open-sourced</a> ODoH-related code in Go, Rust, and a Cloudflare Workers-compatible implementation. We also worked with the open source community to land the protocol in widely available tools, like <a href="http://dnscrypt.info/">dnscrypt</a>, to help further ODoH adoption. ODoH is just one example of cross-industry work to develop standards that you’ll learn more about in an upcoming post.</p>
    <div>
      <h2>From theory to practice at a global scale</h2>
      <a href="#from-theory-to-practice-at-a-global-scale">
        
      </a>
    </div>
    <p>There are thousands of papers published at dozens of venues every year on Internet technology. The ideas in academic research can change our fundamental understanding of the world scientifically but often haven’t impacted users yet. Innovation comes from all places, and it's important to adopt ideas from the wider/outside community since we're in a fortunate position to do so.</p><p>As an academic, you are rewarded for the breakthrough, not the follow-through. We value the ability to pursue, even drive, the follow-through because of the tangible improvements challenges offer to the Internet. We find that we can often learn much more about an idea by building and deploying it than by only thinking it up and writing it down. The smallest wrinkle in a lab environment or theoretical paper can become a large issue at Internet scale, and seemingly minor insights can unlock enormous potential.</p><p>We are grateful at Cloudflare to be in a rare position to leverage the diversity of the Internet to further existing research and study its real-world impact. We can bring the insights and solutions described in papers to reality because we have the insight into user behavior required to do it: right now, <i>nearly every user on the Internet uses Cloudflare directly or indirectly.</i></p><p>We also have enough scale that problems that could have been solved conventionally must now use new tools. For example, cryptographic tools like identity-based encryption and zero-knowledge proofs have been around on paper for decades. They have only recently been deployed in a few live systems but are now emerging as valuable tools in the conventional Internet and have real-life impact.</p>
    <div>
      <h3>Case Study #5: Cryptographic Attestation of Personhood</h3>
      <a href="#case-study-5-cryptographic-attestation-of-personhood">
        
      </a>
    </div>
    <p>In Case Study #4, we explored a deep and fundamental networking question. As fun as exploring the plumbing can be, it’s also important to explore user experience questions because clients and customers can immediately feel them. A big part of Cloudflare’s value is protecting customers from bots, and one of the tools we use is the CAPTCHA. People <a href="https://twitter.com/Nazenko/status/1337987291483136002">hate</a> CAPTCHAs. Few aspects of the web experience inspire more seething anger in the user experience than being stopped and asked to identify street signs and trucks in low-res images when trying to go to a site. Furthermore, the most common CAPTCHAs are inaccessible to many communities, including the blind and the visually impaired. The Bots team at Cloudflare has made great strides to reduce the number of CAPTCHAs shown on the server-side using <a href="https://www.cloudflare.com/learning/ai/what-is-machine-learning/">machine learning</a> (a challenging problem in itself). We decided to complement their work by asking if we could leverage accessibility on the client-side to provide equivalent protection to a CAPTCHA?</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6v7w30ADISIpFn4zf3VyZ5/7f6cc630e8264d47e06d9ebc17be85b2/unnamed--2-.png" />
            
            </figure><p>This question led us down the path to developing a new technique we call the <a href="/introducing-cryptographic-attestation-of-personhood/">Cryptographic Attestation of Personhood (CAP)</a>. Instead of users proving to Cloudflare that they are human by performing a human task, we could ask them to prove that they have trusted physical hardware. We identified the widely deployed WebAuthn standard to do this so that millions of users could leverage their hard security keys or the hardware biometric system built into their phones and laptops.</p><p>This project raised several exciting and profound privacy and user experience questions. With the help of a research intern experienced in anonymous authentication, we published a <a href="https://eprint.iacr.org/2021/1183">paper</a> at <a href="https://www.sac2021.ca/">SAC 2021</a> that leveraged and improved upon zero-knowledge <a href="/introducing-zero-knowledge-proofs-for-private-web-attestation-with-cross-multi-vendor-hardware/">cryptography systems</a> to add additional privacy features to our solution. Cloudflare’s ubiquity allows us to expose millions of users to this new idea and understand how it’s understood: for example, do users think sites can collect biometrics from their users this way? We have an upcoming paper submission (with the user research team) about these user experience questions.</p><p>Some answers to these research-shaped questions are surprising, some weren’t, but in all cases, the outcome of taking a questions-oriented approach was tools for solving problems.</p>
    <div>
      <h2>What to expect from the blog</h2>
      <a href="#what-to-expect-from-the-blog">
        
      </a>
    </div>
    <p>As mentioned above, Cloudflare Research will be all over the Cloudflare blog in the next several days to make several announcements and share technical explainers, including:</p><ul><li><p>A new landing page where you can read our research and find additional resources.</p></li><li><p>Technical deep dives into research papers and standards, including the projects referenced above (and MANY more).</p></li><li><p>Insights into our process and ways to collaborate with us.</p></li></ul><p>Happy reading!</p> ]]></content:encoded>
            <category><![CDATA[Research]]></category>
            <guid isPermaLink="false">1Visyte4EnzFnqlLFbM0Mv</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Heartbleed Revisited]]></title>
            <link>https://blog.cloudflare.com/heartbleed-revisited/</link>
            <pubDate>Sat, 27 Mar 2021 13:00:00 GMT</pubDate>
            <description><![CDATA[ TLS key compromise is a risk for all web services. Taking lessons from Heartbleed, Cloudflare offers the latest features that make key compromise less of a risk. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>In 2014, a bug was found in OpenSSL, a popular encryption library used to secure the majority of servers on the Internet. This bug allowed attackers to abuse an obscure feature called TLS heartbeats to read memory from affected servers. Heartbleed was big news because it allowed attackers to extract the most important secret on a server: its TLS/SSL certificate private key. After confirming that the bug was <a href="/the-results-of-the-cloudflare-challenge/">easy to exploit</a>, we revoked and reissued over <a href="/the-heartbleed-aftermath-all-cloudflare-certificates-revoked-and-reissued/">100,000 certificates</a>, which highlighted some major issues with how the Internet is secured.</p><p>As much as Heartbleed and <a href="https://www.bankinfosecurity.com/private-keys-for-23000-digital-certificates-leaked-a-10689">other key compromise events</a> were painful for security and operations teams around the world, they also provided a learning opportunity for the industry. Over the past seven years, Cloudflare has taken the lessons of Heartbleed and applied them to improve the design of our systems and the resiliency of the Internet overall. Read on to learn how using Cloudflare reduces the risk of key compromise and reduces the cost of recovery if it happens.</p>
    <div>
      <h3>Keeping keys safe</h3>
      <a href="#keeping-keys-safe">
        
      </a>
    </div>
    <p>An important tenet of security system design is defense-in-depth. Important things should be protected with multiple layers of defense. This is why security-conscious people keep spare house keys in a secure lockbox rather than under the mat. For cryptographic systems that face the Internet, defense-in-depth means designing your systems so that keys are not one exploit away from being stolen. This wasn’t the case for OpenSSL and Heartbleed. Private keys were loaded into memory into a memory-unsafe Internet-facing process, so only a single memory disclosure bug was needed to exfiltrate them.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4utbSsV9R3VODJsjcgNPGb/6844289c0ab586527f721c9772af4202/image6-22.png" />
            
            </figure><p>Keyless SSL: keeping the server separate from the key</p><p>An effective defense-in-depth strategy for protecting TLS/SSL private keys is splitting the process into two parts: the private key/authentication part, and the encryption/decryption part. This is exactly why we developed Keyless SSL, to allow customers to keep full control over their private keys while allowing Cloudflare to handle the rest of the connection details. <a href="/keyless-ssl-the-nitty-gritty-technical-details/">Keyless SSL</a> provides physical separation between where a key is being used and where it is stored. We support Keyless SSL for both software and hardware security modules (HSMs), and today we’re announcing that we now support <a href="/keyless-ssl-supports-fips-140-2-l3-hsm">multiple cloud-based HSMs</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4Bndw9miSZSb1LZhH9bPoT/f9ba0c1e2d7ae1055f7f23cb7d65e534/image1-1.gif" />
            
            </figure><p>Geo Key Manager: configurable key management by geography</p><p>Heartbleed showed us that this strategy could also be useful to add an extra layer of security for private keys that we manage for our customers. In 2017, we launched <a href="/geo-key-manager-how-it-works/">Geo Key Manager</a>, a feature that allows customers to select which locations in the world they want their keys to be stored. Geo Key Manager protects keys against physical compromise of servers in different geographies. In 2019, we took this even further by implementing a strategy called <a href="/going-keyless-everywhere/">Keyless Everywhere</a>, moving all managed keys onto a system that provides logical separation between the Internet and the private keys.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7qPpBQgpHNVn59GIVqCD0h/4c6bfa78273296fe75e34325bb2c0119/image2-1.jpg" />
            
            </figure><p>Delegated Credentials: key separation with no latency</p><p>Keyless SSL is a great security solution, but depending on where keys are stored it can introduce some latency. Because of this, we worked with the IETF to develop a new standard called <a href="/keyless-delegation/">Delegated Credentials</a>, which allows connections to use short-lived keys that are signed by the certificate instead of the certificate itself in TLS. This eliminates the additional latency introduced by Keyless SSL. We support Delegated Credentials for all Keyless SSL and Geo Key Manager customers; and Firefox 89 (May 2021) will enable Delegated Credential support by default.</p>
    <div>
      <h3>Making revocation work</h3>
      <a href="#making-revocation-work">
        
      </a>
    </div>
    <p>When Heartbleed happened and hundreds of thousands of certificates were deemed potentially compromised, the logical thing to do was to revoke and reissue these certificates. Doing so caused some unexpected consequences.</p><p>The first consequence of revocation was a massive surge of network traffic related to the revocation information. In 2014, there were three main mechanisms for certificate revocation:</p><ul><li><p>Certificate Revocation Lists (CRLs)</p><ul><li><p>A list of revoked serial numbers for a given certificate authority</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7k5nVuOjuLVYHHODuRVunR/97784bde40fad5bbf527f1e406c02cea/image3.jpg" />
            
            </figure></li></ul></li><li><p>Online Certificate Status Protocol (OCSP)</p><ul><li><p>A protocol to query a certificate authority about the revocation status of a certificate</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2QEflfTvpxn0peLcEXrC9R/e95fef4f9811c8ffb211f44776df06b5/image5.jpg" />
            
            </figure></li><li><p>OCSP can be queried by the browser or responses can be included by the server at connection time “OCSP stapling”</p></li></ul></li><li><p>CRLSets — Chrome’s custom revocation system</p><ul><li><p>A meta-list of revoked serial numbers, limited to high-value certificates</p></li></ul></li></ul><p>Tens of thousands of certificates were revoked at once due to potential compromise from Heartbleed. After this, the CRL for a prominent CA, GlobalSign, increased from <a href="/the-hard-costs-of-heartbleed/">22KB to 4.7MB in a day</a>. This caused major disruptions in Cloudflare’s internal caching infrastructure and bandwidth spikes that affected the Internet at large as all clients that relied on CRLs to check for certificate validation (mostly Microsoft Windows) downloaded the file.</p><p>After this revocation event, it became clear that there were other reasons why revocation wasn’t a functional system. In Firefox, if a user makes a connection to a site and a stapled OCSP response is not provided, Firefox queries the OCSP server for a response. However, Firefox implements a fail-open strategy: if the OCSP response takes too long, the revocation check is bypassed and the page is rendered. An attacker with a privileged network position could use a compromised <i>and revoked</i> certificate to attack users by simply blocking the OCSP request and letting the browser skip the revocation check. OCSP stapling is a way for a server to get the OCSP response to the browser in a reliable way, but since stapling is not a requirement for clients, an attacker could just not include the staple and the browser would fail open, leaving the user vulnerable to attack. OCSP also doesn’t provide strong protection against key compromise in fail-open mode (plus, OCSP is a <a href="https://www.eff.org/deeplinks/2020/11/macos-leaks-application-usage-forces-apple-make-hard-decisions">privacy leak</a>, but that’s another issue).</p><p>The situation in Chrome is even worse from a security perspective. Since neither OCSP nor CRLs are checked for the majority of certificates (CRLSets only contain revoked “Extended Validation” certificates), most certificates are trusted without checking revocation status. The solution to revoking the set of Cloudflare-managed certificates in Chrome for Heartbleed was actually a short patch to the Chromium codebase. Clearly not a scalable solution!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1XZmNGWOhzhZBL19rynmUH/49eb85d1d327415ee10ea49670b5b9c2/image7-11.png" />
            
            </figure><p>Mass revocation of certificates back in 2014 plainly didn’t work. Some of the certificates at the time were valid for up to five years, so a compromised key was a problem for a long time.</p><p>In 2015, a new standard emerged that seemed to provide a reasonable solution to this problem: <a href="https://scotthelme.co.uk/ocsp-must-staple/">OCSP Must-staple</a>. Certificates issued with the must-staple feature are only trusted if accompanied by a valid OCSP staple. If a must-staple certificate is compromised and revoked, then it can only be used to attack users for the lifetime of the last issued OCSP (usually 10 days or less). This is a big improvement and allows certificate owners to limit their overall risk.</p><p>Cloudflare has supported best-effort OCSP stapling <a href="/ocsp-stapling-how-cloudflare-just-made-ssl-30/">since 2012</a>. In 2017, we set out to improve the reliability of our OCSP stapling so that we could support OCSP must-staple certificates. The result of this work was <a href="/high-reliability-ocsp-stapling/">High-reliability OCSP</a> stapling and a research study published <a href="https://dl.acm.org/doi/10.1145/3278532.3278543">in IMC</a> that demonstrated the feasibility of OCSP must-staple more broadly on the Internet. Cloudflare now supports OCSP must-staple certificates, providing an additional safety net in case of a future key compromise.</p>
    <div>
      <h3>2014 vs. now</h3>
      <a href="#2014-vs-now">
        
      </a>
    </div>
    <p>We’ve come a long way in seven years. Cloudflare is constantly innovating in the TLS/SSL key protection and security space. Here’s what changed over the past few years:</p><p>2014</p><ul><li><p>Five year certificates</p></li><li><p>Opportunistic OCSP stapling</p></li><li><p>No OCSP must-staple</p></li><li><p>Keys in Internet-facing process</p></li><li><p>No Keyless SSL</p></li><li><p>No Delegated Credentials</p></li></ul><p>2021</p><ul><li><p>Configurable lifetime certificates (from one year down to two weeks with <a href="/advanced-certificate-manager">ACM</a>)</p></li><li><p>100% OCSP stapling support</p></li><li><p>OCSP Must-staple support</p></li><li><p>Keyless Everywhere</p></li><li><p>Keyless SSL + Cloud HSM support! (new)</p></li><li><p>Geo Key Manager</p></li><li><p>Delegated Credential Support</p></li></ul><p>These improvements and more are big reasons why Cloudflare is a leader in the security space and why the next Heartbleed won’t be as bad as the last.</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[TLS]]></category>
            <guid isPermaLink="false">tn3L4Hbe10jPgNgoWQyKf</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Securing the post-quantum world]]></title>
            <link>https://blog.cloudflare.com/securing-the-post-quantum-world/</link>
            <pubDate>Fri, 11 Dec 2020 12:00:00 GMT</pubDate>
            <description><![CDATA[ As quantum computing matures, R&D efforts in cryptography are keeping pace. We’re working with academia and industry peers to create new cryptography standards resilient to quantum computer attacks. ]]></description>
            <content:encoded><![CDATA[ <p></p>
    <div>
      <h3>Quantum computing is inevitable; cryptography prepares for the future</h3>
      <a href="#quantum-computing-is-inevitable-cryptography-prepares-for-the-future">
        
      </a>
    </div>
    <p>Quantum computing began in the early 1980s. It operates on principles of quantum physics rather than the limitations of circuits and electricity, which is why it is capable of processing highly complex mathematical problems so efficiently. Quantum computing could one day achieve things that classical computing simply cannot.</p><p>The evolution of quantum computers has been slow. Still, work is accelerating, thanks to the efforts of academic institutions such as Oxford, MIT, and the University of Waterloo, as well as companies like IBM, Microsoft, Google, and Honeywell. <a href="https://www.itpro.co.uk/technology/31818/what-is-quantum-computing">IBM has held a leadership role</a> in this innovation push and has named optimization the most likely application for consumers and organizations alike. Honeywell expects to release what it calls the <a href="https://spectrum.ieee.org/tech-talk/computing/hardware/honeywell-claims-it-has-most-powerful-quantum-computer">“world’s most powerful quantum computer”</a> for applications like fraud detection, optimization for trading strategies, security, <a href="https://www.cloudflare.com/learning/ai/what-is-machine-learning/">machine learning</a>, and chemistry and materials science.</p><p>In 2019, the Google Quantum Artificial Intelligence (AI) team announced that their 53-qubit (analogous to bits in classical computing) machine had achieved “quantum supremacy.” This was the first time a quantum computer was able to solve a problem faster than any classical computer in existence. This was considered a significant milestone.</p><p>Quantum computing will change the face of Internet security forever — particularly in the realm of cryptography, which is the way communications and information are secured across channels like the Internet. Cryptography is critical to almost every aspect of modern life, from banking to cellular communications to connected refrigerators and systems that keep subways running on time. This ultra-powerful, highly sophisticated new generation of computing has the potential to unravel decades of work that have been put into developing the cryptographic <a href="https://quantumalgorithmzoo.org/">algorithms</a> and standards we use today.</p>
    <div>
      <h3>Quantum computers will crack modern cryptographic algorithms</h3>
      <a href="#quantum-computers-will-crack-modern-cryptographic-algorithms">
        
      </a>
    </div>
    <p>Quantum computers can take a very large integer and find out its prime factor extremely rapidly by using <a href="/the-quantum-menace/">Shor’s algorithm</a>. Why is this so important in the context of cryptographic security?</p><p>Most cryptography today is based on algorithms that incorporate difficult problems from number theory, like factoring. The forerunner of nearly all modern cryptographic schemes is RSA (Rivest-Shamir-Adleman), which was devised back in 1976. Basically, every participant of a public key cryptography system like RSA has both a public key and a private key. To send a secure message, data is encoded as a large number and scrambled using the public key of the person you want to send it to. The person on the receiving end can decrypt it with their private key. In RSA, the public key is a large number, and the private key is its prime factors. With Shor’s algorithm, a quantum computer with enough qubits could factor large numbers. For RSA, someone with a quantum computer can take a public key and factor it to get the private key, which allows them to read any message encrypted with that public key. This ability to factor numbers breaks nearly all modern cryptography. Since cryptography is what provides pervasive security for how we communicate and share information online, this has significant implications.</p><p>Theoretically, if an adversary were to gain control of a quantum computer, they could create total chaos. They could create cryptographic certificates and impersonate banks to steal funds, disrupt Bitcoin, break into digital wallets, and access and decrypt confidential communications. Some liken this to Y2K. But, unlike Y2K, there’s no fixed date as to when existing cryptography will be rendered insecure. Researchers have been preparing and working hard to get ahead of the curve by building quantum-resistant cryptography solutions.</p><p>When will a quantum computer be built that is powerful enough to break all modern cryptography? By <a href="https://www.rand.org/content/dam/rand/pubs/research_reports/RR3100/RR3102/RAND_RR3102z.appendixC-D.pdf">some estimates</a>, it may take 10 to 15 years. Companies and universities have made a commitment to innovation in the field of quantum computing, and progress is certainly being made. Unlike classical computers, quantum computers rely on quantum effects, which only happen at the atomic scale. To instantiate a qubit, you need a particle that exhibits quantum effects like an electron or a photon. These particles are extremely small and hard to manage, so one of the biggest hurdles to the realization of quantum computers is how to keep the qubits stable long enough to do the expensive calculations involved in cryptographic algorithms.</p>
    <div>
      <h3>Both quantum computing and quantum-resistant cryptography are works in progress</h3>
      <a href="#both-quantum-computing-and-quantum-resistant-cryptography-are-works-in-progress">
        
      </a>
    </div>
    <p>It takes a long time for hardware technology to develop and mature. Similarly, new cryptographic techniques take a long time to discover and refine. To protect today’s data from tomorrow’s quantum adversaries, we need new cryptographic techniques that are not vulnerable to Shor’s algorithm.</p><p>The <a href="https://csrc.nist.gov/Projects/Post-Quantum-Cryptography">National Institute of Standards and Technology (NIST)</a> is leading the charge in defining <a href="https://www.cloudflare.com/learning/ssl/quantum/what-is-post-quantum-cryptography/">post-quantum cryptography algorithms </a>to replace RSA and ECC. There is a project currently underway to test and select a set of post-quantum computing-resistant algorithms that go beyond existing public-key cryptography. NIST plans to make a recommendation sometime between 2022 and 2024 for two to three algorithms for both encryption and digital signatures. As <a href="https://www.sciencemag.org/news/2019/08/cryptographers-scramble-protect-internet-hackers-quantum-computers">Dustin Moody</a>, NIST mathematician points out, the organization wants to cover as many bases as possible: “If some new attack is found that breaks all lattices, we’ll still have something to fall back on.”</p><p>We’re following closely. The participants of NIST have developed high-speed implementations of post-quantum algorithms on different computer architectures. We’ve taken some of these algorithms and tested them in Cloudflare’s systems in various capacities. Last year, Cloudflare and Google performed the <a href="/the-tls-post-quantum-experiment/">TLS Post-Quantum Experiment</a>, which involved implementing and supporting new key exchange mechanisms based on post-quantum cryptography for all Cloudflare customers for a period of a few months. As an edge provider, Cloudflare was well positioned to turn on post-quantum algorithms for millions of websites to measure performance and use these algorithms to provide confidentiality in TLS connections. This experiment led us to some useful insights around which algorithms we should focus on for TLS and which we should not (<a href="/sidh-go/">sorry, SIDH</a>!).</p><p>More recently, we have been working with researchers from the University of Waterloo and Radboud University on a new protocol called KEMTLS, which will be presented at <a href="https://rwc.iacr.org/2021/">Real World Crypto 2021</a>. In our last TLS experiment, we replaced the key negotiation part of TLS with quantum-safe alternatives but continued to rely on digital signatures. KEMTLS is designed to be fully post-quantum and relies only on public-key encryption.</p><p>On the implementation side, Cloudflare team members including Armando Faz Hernandez and visiting researcher Bas Westerbaan have developed high-speed assembly versions of several of the NIST finalists (<a href="https://pq-crystals.org/">Kyber, Dilithium</a>), as well as other relevant post-quantum algorithms (CSIDH, SIDH) in our <a href="https://github.com/cloudflare/circl">CIRCL cryptography library</a> written in Go.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4nOM9IQgBdMkqvr9OJjuu0/f5fd162299b8bb132f38b91a2c2e714a/image2-31.png" />
            
            </figure><p>A visualization of AVX2-optimized NTT for Kyber by Bas Westerbaan</p>
    <div>
      <h3>Post-quantum security, coming soon?</h3>
      <a href="#post-quantum-security-coming-soon">
        
      </a>
    </div>
    <p>Everything that is encrypted with today’s public key cryptography can be decrypted with tomorrow’s quantum computers. Imagine waking up one day, and everyone’s diary from 2020 is suddenly public. Although it’s impossible to find enough storage to record keep <i>all</i> the ciphertext sent over the Internet, there are <a href="https://en.wikipedia.org/wiki/Utah_Data_Center">current and active efforts</a> to collect a <i>lot</i> of it. This makes deploying post-quantum cryptography as soon as possible a pressing privacy concern.</p><p>Cloudflare is taking steps to accelerate this transition. First, we endeavor to use post-quantum cryptography for most internal services by the end of 2021. Second, we plan to be among the first services to offer post-quantum cipher suites to customers as standards emerge. We’re optimistic that collaborative efforts among NIST, Microsoft, Cloudflare, and other computing companies will yield a robust, standards-based solution. Although powerful quantum computers are likely in our future, Cloudflare is helping to make sure the Internet is ready for when they arrive.</p><p>For more on Quantum Computing, check out my interview with <a href="https://cloudflare.tv/event/2eWU9jyPcSCMqCcqb4HuEo">Scott Aaronson</a> and this segment by <a href="https://cloudflare.tv/event/5G46CmInDoEyAFmk9Ewi3O">Sofía Celi and Armando Faz</a> (in Spanish!) on Cloudflare TV.</p> ]]></content:encoded>
            <category><![CDATA[Privacy Week]]></category>
            <category><![CDATA[Cryptography]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Post-Quantum]]></category>
            <guid isPermaLink="false">7xIMhuQpXYNYAvmjiKgiq</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Helping build the next generation of privacy-preserving protocols]]></title>
            <link>https://blog.cloudflare.com/next-generation-privacy-protocols/</link>
            <pubDate>Tue, 08 Dec 2020 12:00:00 GMT</pubDate>
            <description><![CDATA[ Today, we’re making several announcements around improving Internet protocols with respect to something important to our customers and Internet users worldwide: privacy. ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3KjEAqn2Lizr1zW42YzTU4/6492bcae03200a5c1688671ecc3b6291/Privacy-protocols-2.png" />
            
            </figure><p>Over the last ten years, Cloudflare has become an important part of Internet infrastructure, powering websites, APIs, and web services to help make them more secure and efficient. The Internet is growing in terms of its capacity and the number of people using it and evolving in terms of its design and functionality. As a player in the Internet ecosystem, Cloudflare has a responsibility to help the Internet grow in a way that respects and provides value for its users. Today, we’re making several announcements around improving Internet protocols with respect to something important to our customers and Internet users worldwide: privacy.</p><p>These initiatives are:</p><ul><li><p>Fixing one of the last information leaks in HTTPS through <a href="/encrypted-client-hello"><b>Encrypted Client Hello (ECH)</b></a><b>,</b> previously known as <a href="/encrypted-sni/">Encrypted SNI</a></p></li><li><p>Making <a href="https://www.cloudflare.com/learning/dns/what-is-dns/">DNS</a> even more private by supporting <a href="/oblivious-dns"><b>Oblivious DNS-over-HTTPS (ODoH)</b></a></p></li><li><p>Developing a superior protocol for password authentication, <a href="/opaque-oblivious-passwords"><b>OPAQUE</b></a>, that makes password breaches less likely to occur</p></li></ul><p>Each of these projects impacts an aspect of the Internet that influences our online lives and digital footprints. Whether we know it or not, there is a lot of private information about us and our lives floating around online. This is something we can help fix.</p><p>For over a year, we have been working through standards bodies like the IETF and partnering with the biggest names in Internet technology (including Mozilla, Google, Equinix, and more) to design, deploy, and test these new privacy-preserving protocols at Internet scale. Each of these three protocols touches on a critical aspect of our online lives, and we expect them to help make real improvements to privacy online as they gain adoption.</p>
    <div>
      <h3>A continuing tradition at Cloudflare</h3>
      <a href="#a-continuing-tradition-at-cloudflare">
        
      </a>
    </div>
    <p>One of Cloudflare’s core missions is to support and develop technology that helps build a better Internet. As an industry, we’ve made exceptional progress in making the Internet more secure and robust. Cloudflare is proud to have played a part in this progress through multiple initiatives over the years.</p><p>Here are a few highlights:</p><ul><li><p><a href="/introducing-universal-ssl/"><b>Universal SSL</b></a>™. We’ve been one of the driving forces for encrypting the web. We launched Universal SSL in 2014 to give website encryption to our customers for free and have actively been working along with certificate authorities like Let’s Encrypt, web browsers, and website operators to help remove <a href="/tag/mixed-content-errors/">mixed content</a>. Before Universal SSL launched to give all Cloudflare customers HTTPS for free, only 30% of connections to websites were encrypted. Through the industry’s efforts, that number is now <a href="https://letsencrypt.org/stats/">80%</a> -- and a much more significant proportion of overall Internet traffic. Along with doing our part to encrypt the web, we have supported the Certificate Transparency project via <a href="/introducing-certificate-transparency-and-nimbus/">Nimbus</a> and <a href="https://ct.cloudflare.com/">Merkle Town</a>, which has improved accountability for the certificate ecosystem HTTPS relies on for trust.</p></li><li><p><b>TLS 1.3 and QUIC</b>. We’ve also been a proponent of upgrading existing security protocols. Take Transport Layer Security (TLS), the underlying protocol that secures HTTPS. Cloudflare engineers helped contribute to the design of TLS 1.3, the latest version of the standard, and <a href="/introducing-tls-1-3/">in 2016</a> we launched support for an early version of the protocol. This early deployment helped lead to improvements to the final version of the protocol. TLS 1.3 is now the most widely used encryption protocol on the web and a vital component of the <a href="/last-call-for-quic/">emerging QUIC standard</a>, of which we were also early adopters.</p></li><li><p><b>Securing Routing, Naming, and Time</b>. We’ve made major efforts to help secure other critical components of the Internet. Our efforts to help secure Internet routing through our <a href="/cloudflares-rpki-toolkit/">RPKI toolkit</a>, <a href="https://conferences.sigcomm.org/imc/2019/presentations/p221.pdf">measurement studies</a>, and “<a href="/is-bgp-safe-yet-rpki-routing-security-initiative/">Is BGP Safe Yet</a>” tool have significantly improved the Internet’s resilience against disruptive route leaks. Our time service (<a href="/secure-time/">time.cloudflare.com</a>) has helped keep people’s clocks in sync with more secure protocols like <a href="/nts-is-now-rfc/">NTS</a> and <a href="/roughtime/">Roughtime</a>. We’ve also made DNS more secure by supporting <a href="/dns-encryption-explained/">DNS-over-HTTPS and DNS-over-TLS</a> in 1.1.1.1 at launch, along with one-click DNSSEC in our <a href="/introducing-universal-dnssec/">authoritative DNS</a> service and <a href="/one-click-dnssec-with-cloudflare-registrar/">registrar</a>.</p></li></ul><p>Continuing to improve the security of the systems of trust online is critical to the Internet’s growth. However, there is a more fundamental principle at play: respect. The infrastructure underlying the Internet should be designed to respect its users.</p>
    <div>
      <h3>Building an Internet that respects users</h3>
      <a href="#building-an-internet-that-respects-users">
        
      </a>
    </div>
    <p>When you sign in to a specific website or service with a privacy policy, you know what that site is expected to do with your data. It’s explicit. There is no such visibility to the users when it comes to the operators of the Internet itself. You may have an agreement with your Internet Service Provider (ISP) and the site you’re visiting, but it’s doubtful that you even know which <a href="http://www.washingtonpost.com/graphics/national/security-of-the-internet/bgp">networks your data is traversing</a>. Most people don’t have a concept of the Internet beyond what they see on their screen, so it’s hard to imagine that people would accept or even understand what a privacy policy from a <a href="/the-relative-cost-of-bandwidth-around-the-world/">transit wholesaler</a> or an <a href="https://us-cert.cisa.gov/ncas/alerts/TA17-075A">inspection middlebox</a> would even mean.</p><p>Without encryption, Internet browsing information is implicitly shared with countless third parties online as information passes between networks. Without secure routing, users’ traffic can be hijacked and disrupted. Without privacy-preserving protocols, users’ online life is not as private as they would think or expect. The infrastructure of the Internet wasn’t built in a way that reflects their expectations.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7rjHEqRERPxkcFeoNRwfAX/37548cf8be78a4849c9a188c076ca483/image3.png" />
            
            </figure><p>Normal network flow</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/76hMzZSOArtOdRiTWCeXqH/b2063a3b7aef6e410f30efcbc242f4b6/image1-7.png" />
            
            </figure><p>Network flow with malicious route leak</p><p>The good news is that the Internet is continuously evolving. One of the groups that help guide that evolution is the Internet Architecture Board (IAB). The IAB provides architectural oversight to the Internet Engineering Task Force (IETF), the Internet’s main standard-setting body. The IAB recently published <a href="https://www.rfc-editor.org/rfc/rfc8890.html">RFC 8890</a>, which states that individual end-users should be prioritized when designing Internet protocols. It says that if there’s a conflict between the interests of end-users and the interest of service providers, corporations, or governments, IETF decisions should favor end users. One of the prime interests of end-users is the right to privacy, and the IAB published <a href="https://tools.ietf.org/html/rfc6973">RFC 6973</a> to indicate how Internet protocols should take privacy into account.</p><p>Today’s technical blog posts are about <b>improvements to the Internet designed to respect user privacy</b>. Privacy is a complex topic that spans multiple disciplines, so it’s essential to clarify what we mean by “improving privacy.” We are specifically talking about changing the protocols that handle privacy-sensitive information exposed “on-the-wire” and modifying them so that this data is exposed to fewer parties. This data continues to exist. It’s just no longer available or visible to third parties without building a mechanism to collect it at a higher layer of the Internet stack, the application layer. <i>These changes go beyond website encryption</i>; they go deep into the design of the systems that are foundational to making the Internet what it is.</p>
    <div>
      <h3>The toolbox: cryptography and secure proxies</h3>
      <a href="#the-toolbox-cryptography-and-secure-proxies">
        
      </a>
    </div>
    <p>Two tools for making sure data can be used without being seen are <i>cryptography</i> and <i>secure</i> <i>proxies</i>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/71bC5CqEyrYCZ0RpSJGbHI/922ebc973778951111a1a1881b978e71/Cryptography-and-Secure-Proxies.png" />
            
            </figure><p>Cryptography allows information to be transformed into a format that a very limited number of people (those with the key) can understand. Some describe cryptography as a tool that transforms data security problems into key management problems. This is a humorous but fair description. Cryptography makes it easier to reason about privacy because only key holders can view data.</p><p>Another tool for protecting access to data is isolation/segmentation. By physically limiting which parties have access to information, you effectively build privacy walls. A popular architecture is to rely on policy-aware proxies to pass data from one place to another. Such proxies can be configured to strip sensitive data or block data transfers between parties according to what the privacy policy says.</p><p>Both these tools are useful individually, but they can be even more effective if combined. Onion routing (the cryptographic technique <a href="/cloudflare-onion-service/">underlying Tor</a>) is one example of how proxies and encryption can be used in tandem to enforce strong privacy. Broadly, if party A wants to send data to party B, they can encrypt the data with party B’s key and encrypt the metadata with a proxy’s key and send it to the proxy.</p><p>Platforms and services built on top of the Internet can build in consent systems, like privacy policies presented through user interfaces. The infrastructure of the Internet relies on layers of underlying protocols. Because these layers of the Internet are so far below where the user interacts with them, it’s almost impossible to build a concept of user consent. In order to respect users and protect them from privacy issues, the protocols that glue the Internet together should be designed with privacy enabled by default.</p>
    <div>
      <h3>Data vs. metadata</h3>
      <a href="#data-vs-metadata">
        
      </a>
    </div>
    <p>The transition from a mostly unencrypted web to an encrypted web has done a lot for end-user privacy. For example, the “<a href="https://codebutler.com/2010/10/24/firesheep/">coffeeshop stalker</a>” is no longer an issue for most sites. When accessing the majority of sites online, users are no longer broadcasting every aspect of their web browsing experience (search queries, browser versions, authentication cookies, etc.) over the Internet for any participant on the path to see. Suppose a site is configured correctly to use HTTPS. In that case, users can be confident their data is secure from onlookers and reaches only the intended party because their connections are both encrypted and authenticated.</p><p>However, HTTPS only protects the <i>content</i> of web requests. Even if you only browse sites over HTTPS, that doesn’t mean that your <i>browsing</i> <i>patterns</i> are private. This is because HTTPS fails to encrypt a critical aspect of the exchange: the metadata. When you make a phone call, the metadata is the phone number, not the call’s contents. Metadata is the data about the data.</p><p>To illustrate the difference and why it matters, here’s a diagram of what happens when you visit a website like an imageboard. Say you’re going to a specific page on that board (<a href="https://images.com/room101/">https://.com/room101/</a>) that has specific embedded images hosted on .com.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2WDSyOoFNRtXcGj5XXQC9p/b1c9ce791e8d84798b93782c97703c37/image5-2.png" />
            
            </figure><p>Page load for an imageboard, returning an HTML page with an image from an embarassing site</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6DvbyOK8cIcvblLUmPsQCl/c994c812f99f917e5ae4c86898da827c/image4.png" />
            
            </figure><p>Subresource fetch for the image from an embarassing site</p><p>The space inside the dotted line here represents the part of the Internet that your data needs to transit. They include your local area network or coffee shop, your ISP, an Internet transit provider, and it could be the network portion of the cloud provider that hosts the server. Users often don’t have a relationship with these entities or a contract to prevent these parties from doing anything with the user’s data. And even if those entities don’t look at the data, a well-placed observer intercepting Internet traffic could see anything sent unencrypted. It would be best if they just didn’t see it at all. In this example, the fact that the user visited .com can be seen by an observer, which is expected. However, though page content is encrypted, it’s possible to learn <i>which specific page you’ve visited</i> can be seen since .com is also visible.</p><p>It’s a general rule that if data is available to on-path parties on the Internet, some of these on-path parties will use this data. It’s also true that these on-path parties need some metadata in order to facilitate the transport of this data. This balance is explored in <a href="https://www.rfc-editor.org/rfc/rfc8558.html">RFC 8558</a>, which explains how protocols should be designed thoughtfully with respect to the balance between too much metadata (bad for privacy) and too little metadata (bad for operations).</p><p>In an ideal world, Internet protocols would be designed with the principle of least privilege. They would provide the minimum amount of information needed for the on-path parties (the pipes) to do the job of transporting the data to the right place and keep everything else confidential by default. Current protocols, including TLS 1.3 and QUIC, are important steps towards this ideal but fall short with respect to metadata privacy.</p>
    <div>
      <h3>Knowing both who you are and what you do online can lead to profiling</h3>
      <a href="#knowing-both-who-you-are-and-what-you-do-online-can-lead-to-profiling">
        
      </a>
    </div>
    <p>Today’s announcements reflect two metadata protection levels: the first involves limiting the amount of metadata available to third-party observers (like ISPs). The second involves restricting the amount of metadata that users share with service providers themselves.</p><p>Hostnames are an example of metadata that needs to be protected from third-party observers, which DoH and ECH intend to do. However, it doesn’t make sense to hide the hostname from the site you’re visiting. It also doesn’t make sense to hide it from a directory service like DNS. A DNS server needs to know which hostname you’re resolving to resolve it for you!</p><p>A privacy issue arises when a service provider knows about both what sites you’re visiting and who you are. Individual websites do not have this dangerous combination of information (except in the case of third party cookies, which <a href="https://www.cnbc.com/2020/01/14/google-chrome-to-end-support-for-third-party-cookies-within-two-years.html">are going away soon in browsers</a>), but DNS providers do. Thankfully, it’s not actually necessary for a DNS resolver to know *both* the hostname of the service you’re going to and which IP you’re coming from. Disentangling the two, which is the goal of ODoH, is good for privacy.</p>
    <div>
      <h3>The Internet is part of 'our' Infrastructure</h3>
      <a href="#the-internet-is-part-of-our-infrastructure">
        
      </a>
    </div>
    <p>Roads should be well-paved, well lit, have accurate signage, and be optimally connected. They aren't designed to stop a car based on who's inside it. Nor should they be! Like transportation infrastructure, Internet infrastructure is responsible for getting data where it needs to go, not looking inside packets, and making judgments. But the Internet is made of computers and software, and software tends to be written to make decisions based on the data it has available to it.</p><p>Privacy-preserving protocols attempt to eliminate the temptation for infrastructure providers and others to peek inside and make decisions based on personal data. A non-privacy preserving protocol like HTTP keeps data and metadata, like passwords, IP addresses, and hostnames, as explicit parts of the data sent over the wire. The fact that they are explicit means that they are available to any observer to collect and act on. A protocol like HTTPS improves upon this by making some of the data (such as passwords and site content) invisible on the wire using encryption.</p><p>The three protocols we are exploring today extend this concept.</p><ul><li><p><b>ECH</b> takes most of the unencrypted metadata in TLS (including the hostname) and encrypts it with a key that was fetched ahead of time.</p></li><li><p><b>ODoH</b> (a new variant of DoH co-designed by Apple, Cloudflare, and Fastly engineers) uses proxies and onion-like encryption to make the source of a DNS query invisible to the DNS resolver. This protects the user’s IP address when resolving hostnames.</p></li><li><p><b>OPAQUE</b> uses a new cryptographic technique to keep passwords hidden <b><i>even from the server</i></b>. Utilizing a construction called an Oblivious Pseudo-Random Function (as seen in <a href="/privacy-pass-the-math/">Privacy Pass</a>), the server does not learn the password; it only learns whether or not the user knows the password.</p></li></ul><p>By making sure Internet infrastructure acts more like physical infrastructure, user privacy is more easily protected. The Internet is more private if private data can only be collected where the user has a chance to consent to its collection.</p>
    <div>
      <h3>Doing it together</h3>
      <a href="#doing-it-together">
        
      </a>
    </div>
    <p>As much as we’re excited about working on new ways to make the Internet more private, innovation at a global scale doesn’t happen in a vacuum. Each of these projects is the output of a collaborative group of individuals working out in the open in organizations like the IETF and the IRTF. Protocols must come about through a consensus process that involves all the parties that make up the interconnected set of systems that power the Internet. From browser builders to cryptographers, from DNS operators to website administrators, this is truly a global team effort.</p><p>We also recognize that sweeping technical changes to the Internet will inevitably also impact the technical community. Adopting these new protocols may have legal and policy implications. We are actively working with governments and civil society groups to help educate them about the impact of these potential changes.</p><p>We’re looking forward to sharing our work today and hope that more interested parties join in developing these protocols. The projects we are announcing today were designed by experts from academia, industry, and hobbyists together and were built by engineers from Cloudflare Research (including the work of interns, which we will highlight) with everyone’s support Cloudflare.</p><p>If you’re interested in this type of work, <a href="https://www.cloudflare.com/careers/jobs/">we’re hiring</a>!</p> ]]></content:encoded>
            <category><![CDATA[Privacy Week]]></category>
            <category><![CDATA[Encryption]]></category>
            <category><![CDATA[Cryptography]]></category>
            <category><![CDATA[DNS]]></category>
            <category><![CDATA[DoH]]></category>
            <category><![CDATA[Authentication]]></category>
            <category><![CDATA[Passwords]]></category>
            <category><![CDATA[TLS]]></category>
            <category><![CDATA[Encrypted SNI]]></category>
            <category><![CDATA[Research]]></category>
            <guid isPermaLink="false">6Npild5sJTVfGo3GttHrTd</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[SAD DNS Explained]]></title>
            <link>https://blog.cloudflare.com/sad-dns-explained/</link>
            <pubDate>Fri, 13 Nov 2020 19:06:13 GMT</pubDate>
            <description><![CDATA[ Researchers from UC Riverside and Tsinghua University found a new way to revive a decade-old DNS cache poisoning attack. Read our deep dive into how the SAD DNS attack on DNS resolvers works, how we protect against this attack in 1.1.1.1, and what the future holds for DNS cache poisoning attacks. ]]></description>
            <content:encoded><![CDATA[ <p>This week, at the <a href="https://www.sigsac.org/ccs/CCS2020/conference-program.html">ACM CCS 2020 conference</a>, researchers from UC Riverside and Tsinghua University announced a new attack against the <a href="https://www.cloudflare.com/learning/dns/what-is-dns/">Domain Name System (DNS)</a> called <a href="https://www.saddns.net/">SAD DNS</a> (Side channel AttackeD DNS). This attack leverages recent features of the networking stack in modern operating systems (like Linux) to allow attackers to revive a classic attack category: DNS cache poisoning. As part of a coordinated disclosure effort earlier this year, the researchers contacted Cloudflare and other major DNS providers and we are happy to announce that 1.1.1.1 Public Resolver is no longer vulnerable to this attack.</p><p>In this post, we’ll explain what the vulnerability was, how it relates to previous attacks of this sort, what mitigation measures we have taken to protect our users, and future directions the industry should consider to prevent this class of attacks from being a problem in the future.</p>
    <div>
      <h3>DNS Basics</h3>
      <a href="#dns-basics">
        
      </a>
    </div>
    <p>The Domain Name System (DNS) is what allows users of the Internet to get around without memorizing long sequences of numbers. What’s often called the “phonebook of the Internet” is more like a helpful system of translators that take natural language <a href="https://www.cloudflare.com/learning/dns/glossary/what-is-a-domain-name/">domain names</a> (like blog.cloudflare.com or gov.uk) and translate them into the native language of the Internet: IP addresses (like 192.0.2.254 or [2001:db8::cf]). This translation happens behind the scenes so that users only need to remember hostnames and don’t have to get bogged down with remembering IP addresses.</p><p>DNS is both a system and a protocol. It refers to the hierarchical system of computers that manage the data related to naming on a network and it refers to the language these computers use to speak to each other to communicate answers about naming. The DNS protocol consists of pairs of messages that correspond to questions and responses. Each DNS question (query) and answer (reply) follows a standard format and contains a set of parameters that contain relevant information such as the name of interest (such as blog.cloudflare.com) and the type of response record desired (such as A for IPv4 or AAAA for IPv6).</p>
    <div>
      <h3>The DNS Protocol and Spoofing</h3>
      <a href="#the-dns-protocol-and-spoofing">
        
      </a>
    </div>
    <p>These DNS messages are exchanged over a network between machines using a transport protocol. Originally, DNS used UDP, a simple stateless protocol in which messages are endowed with a set of metadata indicating a source port and a destination port. More recently, DNS has adapted to use more complex transport protocols such as TCP and even advanced protocols like TLS or HTTPS, which incorporate encryption and strong authentication into the mix (see Peter Wu’s blog post about <a href="/dns-encryption-explained/">DNS protocol encryption</a>).</p><p>Still, the most common transport protocol for message exchange is UDP, which has the advantages of being fast, ubiquitous and requiring no setup. Because UDP is stateless, the pairing of a response to an outstanding query is based on two main factors: the source address and port pair, and information in the DNS message. Given that UDP is both stateless and unauthenticated, anyone, and not just the recipient, can send a response with a forged source address and port, which opens up a range of potential problems.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/dCFbp5FSjzJUvxRtOx371/3905b3efe9706c5044b5399aacca28d8/image4-6.png" />
            
            </figure><p>The blue portions contribute randomness</p><p>Since the transport layer is inherently unreliable and untrusted, the DNS protocol was designed with additional mechanisms to protect against forged responses. The first two bytes in the message form a message or transaction ID that must be the same in the query and response. When a DNS client sends a query, it will set the ID to a random value and expect the value in the response to match. This unpredictability introduces entropy into the protocol, which makes it less likely that a malicious party will be able to construct a valid DNS reply without first seeing the query. There are other potential variables to account for, like the DNS query name and query type are also used to pair query and response, but these are trivial to guess and don’t introduce an additional entropy.</p><p>Those paying close attention to the diagram may notice that the amount of entropy introduced by this measure is only around 16 bits, which means that there are fewer than a hundred thousand possibilities to go through to find the matching reply to a given query. More on this later.</p>
    <div>
      <h3>The DNS Ecosystem</h3>
      <a href="#the-dns-ecosystem">
        
      </a>
    </div>
    <p>DNS servers fall into one of a few main categories: recursive resolvers (like 1.1.1.1 or 8.8.8.8), nameservers (like the <a href="/f-root/">DNS root servers</a> or <a href="https://www.cloudflare.com/dns/">Cloudflare Authoritative DNS</a>). There are also elements of the ecosystem that act as “forwarders” such as <a href="http://www.thekelleys.org.uk/dnsmasq/doc.html">dnsmasq</a>. In a typical DNS lookup, these DNS servers work together to complete the task of delivering the IP address for a specified domain to the client (the client is usually a stub resolver - a simple resolver built into an operating system). For more detailed information about the DNS ecosystem, take a look at <a href="https://www.cloudflare.com/learning/dns/dns-server-types/">our learning site</a>. The SAD DNS attack targets the communication between recursive resolvers and nameservers.</p><p>Each of the participants in DNS (client, resolver, nameserver) uses the DNS protocol to communicate with each other. Most of the latest innovations in DNS revolve around <a href="/dns-encryption-explained/">upgrading the transport</a> between users and recursive resolvers to use encryption. Upgrading the transport protocol between resolvers and authoritative servers is a bit more complicated as it requires a new discovery mechanism to instruct the resolver when to (and when not to use) a more secure channel.  Aside from a few examples like <a href="/encrypting-dns-end-to-end/">our work with Facebook</a> to encrypt recursive-to-authoritative traffic with DNS-over-TLS, most of these exchanges still happen over UDP. This is the core issue that enables this new attack on DNS, and one that we’ve seen before.</p>
    <div>
      <h3>Kaminsky’s Attack</h3>
      <a href="#kaminskys-attack">
        
      </a>
    </div>
    <p>Prior to 2008, recursive resolvers typically used a single open port (usually port 53) to send and receive messages to authoritative nameservers. This made guessing the source port trivial, so the only variable an attacker needed to guess to forge a response to a query was the 16-bit message ID. The attack <a href="https://www.linuxjournal.com/content/understanding-kaminskys-dns-bug">Kaminsky described</a> was relatively simple: whenever a recursive resolver queried the authoritative name server for a given domain, an attacker would flood the resolver with DNS responses for some or all of the 65 thousand or so possible message IDs. If the malicious answer with the right message ID arrived before the response from the authoritative server, then the DNS cache would be effectively poisoned, returning the attacker’s chosen answer instead of the real one for as long as the DNS response was valid (called the TTL, or time-to-live).</p><p>For popular domains, resolvers contact authoritative servers once per TTL (which can be as short as 5 minutes), so there are plenty of opportunities to mount this attack. Forwarders that cache DNS responses are also vulnerable to this type of attack.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1UE6h36FxkzSRIJlh4HQj4/843403c141ee61cf047365a9b8e7a0f5/image3-4.png" />
            
            </figure><p>In response to this attack, DNS resolvers started doing source port randomization and careful checking of the security ranking of cached data. To poison these updated resolvers, forged responses would not only need to guess the message ID, but they would also have to guess the source port, bringing the number of guesses from the tens of thousands to over a billion. This made the attack effectively infeasible. Furthermore, the IETF published <a href="https://tools.ietf.org/html/rfc5452">RFC 5452</a> on how to harden DNS from guessing attacks.</p><p>It should be noted that this attack did not work for DNSSEC-signed domains since their answers are digitally signed. However, even now in 2020, DNSSEC is far from universal.</p>
    <div>
      <h3>Defeating Source Port Randomization with Fragmentation</h3>
      <a href="#defeating-source-port-randomization-with-fragmentation">
        
      </a>
    </div>
    <p>Another way to avoid having to guess the source port number and message ID is to split the DNS response in two. As is often the case in computer security, old attacks become new again when attackers discover new capabilities. In 2012, researchers Amir Herzberg and Haya Schulman from Bar Ilan University <a href="https://arxiv.org/pdf/1205.4011.pdf;">discovered</a> that it was possible for a remote attacker to defeat the protections provided by source port randomization. This new attack leveraged another feature of UDP: fragmentation. For a primer on the topic of UDP fragmentation, check out our <a href="/ip-fragmentation-is-broken/">previous blog post</a> on the subject by Marek Majkowski.</p><p>The key to this attack is the fact that all the randomness that needs to be guessed in a DNS poisoning attack is concentrated at the beginning of the DNS message (UDP header and DNS header).If the UDP response packet (sometimes called a datagram) is split into two fragments, the first half containing the message ID and source port and the second containing part of the DNS response, then all an attacker needs to do is forge the second fragment and make sure that the fake second fragment arrives at the resolver before the true second fragment does. When a datagram is fragmented, each fragment is assigned a 16-bit IDs (called IP-ID), which is used to reassemble it at the other end of the connection. Since the second fragment only has the IP-ID as entropy (again, this is a familiar refrain in this area), this attack is feasible with a relatively small number of forged packets. The downside of this attack is the precondition that the response must be fragmented in the first place, and the fragment must be carefully altered to pass the original section counts and UDP checksum.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6HX4qrdRButwYt5dYR5wum/3d6b5054b4d782279417484a12553bda/image5-1.png" />
            
            </figure><p>Also discussed in the original and <a href="https://pki.cad.sit.fraunhofer.de/media/doc-CCS2018.pdf">follow-up papers</a> is a method of forcing two remote servers to send packets between each other which are fragmented at an attacker-controlled point, making this attack much more feasible. The details are in the paper, but it boils down to the fact that the control mechanism for describing the maximum transmissible unit (MTU) between two servers -- which determines at which point packets are fragmented -- can be set via a forged UDP packet.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/21fbVKVHIVx78Vr9H0kIo3/1b9012b11ef9a6bb39920b2429dba302/image1-8.png" />
            
            </figure><p>We explored this risk in a previous blog post in the context of certificate issuance last year when we introduced our <a href="/secure-certificate-issuance/">multi-path DCV service</a>, which mitigates this risk in the context of certificate issuance by making DNS queries from multiple vantage points. Nevertheless, fragmentation-based attacks are proving less and less effective as DNS providers move to eliminate support for fragmented DNS packets (one of the major goals of <a href="https://dnsflagday.net/2020/">DNS Flag Day 2020</a>).</p>
    <div>
      <h3>Defeating Source Port Randomization via ICMP error messages</h3>
      <a href="#defeating-source-port-randomization-via-icmp-error-messages">
        
      </a>
    </div>
    <p>Another way to defeat the source port randomization is to use some measurable property of the server that makes the source port easier to guess. If the attacker could ask the server which port number is being used for a pending query, that would make the construction of a spoofed packet much easier. No such thing exists, but it turns out there is something close enough - the attacker can discover which ports are surely closed (and thus avoid having to send traffic). One such mechanism is the ICMP “port unreachable” message.</p><p>Let’s say the target receives a UDP datagram destined for its IP and some port, the datagram either ends up either being accepted and silently discarded by the application, or rejected because the port is closed. If the port is closed, or more importantly, closed to the IP address that the UDP datagram was sent from, the target will send back an ICMP message notifying the attacker that the port is closed. This is handy to know since the attacker now doesn’t have to bother trying to guess the pending message ID on this port and move to other ports. A single scan of the server effectively reduces the search space of valid UDP responses from 2<sup>32</sup> (over a billion) to 2<sup>17</sup> (around a hundred thousand), at least in theory.</p><p>This trick doesn’t always work. Many resolvers use “connected” UDP sockets instead of “open” UDP sockets to exchange messages between the resolver and nameserver. Connected sockets are tied to the peer address and port on the OS layer, which makes it impossible for an attacker to guess which “connected” UDP sockets are established between the target and the victim, and since the attacker isn’t the victim, it can’t directly observe the outcome of the probe.</p><p>To overcome this, the researchers found a very clever trick: they leverage ICMP rate limits as a side channel to reveal whether a given port is open or not. ICMP rate limiting was introduced (somewhat ironically, given this attack) as a security feature to prevent a server from being used as an unwitting participant in a <a href="https://www.cloudflare.com/learning/ddos/smurf-ddos-attack/">reflection attack</a>. In broad terms, it is used to limit how many ICMP responses a server will send out in a given time period. Say an attacker wanted to scan 10,000 ports and sent a burst of 10,000 UDP packets to a server configured with an ICMP rate limit of 50 per second, then only the first 50 would get an ICMP “port unreachable” message in reply.</p><p>Rate limiting seems innocuous until you remember one of the core rules of data security: <i>don’t let private information influence publicly measurable metrics</i>. ICMP rate limiting violates this rule because the rate limiter’s behavior can be influenced by an attacker making guesses as to whether a “secret” port number is open or not.</p><blockquote><p><i>don’t let private information influence publicly measurable metrics</i></p></blockquote><p>An attacker wants to know whether the target has an open port, so it sends a spoofed UDP message from the authoritative server to that port. If the port is open, no ICMP reply is sent and the rate counter remains unchanged. If the port is inaccessible, then an ICMP reply is sent (back to the authoritative server, not to the attacker) and the rate is increased by one. Although the attacker doesn’t see the ICMP response, it has influenced the counter. The counter itself isn’t known outside the server, but whether it has hit the rate limit or not <i>can</i> be measured by any outside observer by sending a UDP packet and waiting for a reply. If an ICMP “port unreachable” reply comes back, the rate limit hasn’t been reached. No reply means the rate limit has been met. This leaks one bit of information about the counter to the outside observer, which in the end is enough to reveal the supposedly secret information (whether the spoofed request got through or not).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4VZjJoJhfSuFB0QjVY74Xz/25462293f51df83350c36c5fe6090fa3/image2-7.png" />
            
            </figure><p>Diagram inspired by <a href="https://www.sigsac.org/ccs/CCS2020/conference-program.html">original paper</a>‌‌</p><p>Concretely, the attack works as follows: the attacker sends a bunch (large enough to trigger the rate limiting) of probe messages to the target, but with a forged source address of the victim. In the case where there are no open ports in the probed set, the target will send out the same amount of ICMP “port unreachable” responses back to the victim and trigger the rate limit on outgoing ICMP messages. The attacker can now send an additional verification message from its own address and observe whether an ICMP response comes back or not. If it does then there was at least one port open in the set and the attacker can divide the set and try again, or do a linear scan by inserting the suspected port number into a set of known closed ports. Using this approach, the attacker can narrow down to the open ports and try to guess the message ID until it is successful or gives up, similarly to the original Kaminsky attack.</p><p>In practice there are some hurdles to successfully mounting this attack.</p><ul><li><p>First, the target IP, or a set of target IPs must be discovered. This might be trivial in some cases - a single forwarder, or a fixed set of IPs that can be discovered by probing and observing attacker controlled zones, but more difficult if the target IPs are partitioned across zones as the attacker can’t see the resolver egress IP unless she can monitor the traffic for the victim domain.</p></li><li><p>The attack also requires a large enough ICMP outgoing rate limit in order to be able to scan with a reasonable speed. The scan speed is critical, as it must be completed while the query to the victim nameserver is still pending. As the scan speed is effectively fixed, the paper instead describes a method to potentially extend the window of opportunity by triggering the victim's <a href="https://kb.isc.org/docs/aa-01000">response rate limiting</a> (RRL), a technique to protect against floods of forged DNS queries. This may work if the victim implements RRL and the target resolver doesn’t implement a retry over TCP (<a href="https://casey.byu.edu/papers/2019_icnc_dns_rate_limit.pdf">A Quantitative Study of the Deployment of DNS Rate Limiting</a> shows about 16% of nameservers implement some sort of RRL).</p></li><li><p>Generally, busy resolvers will have ephemeral ports opening and closing, which introduces false positive open ports for the attacker, and ports open for different pending queries than the one being attacked.</p></li></ul><p>We’ve implemented an additional mitigation to 1.1.1.1 to prevent message ID guessing - if the resolver detects an ID enumeration attempt, it will stop accepting any more guesses and switches over to TCP. This reduces the number of attempts for the attacker even if it guesses the IP address and port correctly, similarly to how the number of password login attempts is limited.</p>
    <div>
      <h3>Outlook</h3>
      <a href="#outlook">
        
      </a>
    </div>
    <p>Ultimately these are just mitigations, and the attacker might be willing to play the long game. As long as the transport layer is insecure and DNSSEC is not widely deployed, there will be different methods of chipping away at these mitigations.</p><p>It should be noted that trying to hide source IPs or open port numbers is a form of security through obscurity. Without strong cryptographic authentication, it will always be possible to use spoofing to poison DNS resolvers. The silver lining here is that DNSSEC exists, and is designed to protect against this type of attack, and DNS servers are <a href="https://datatracker.ietf.org/doc/html/draft-ietf-dprive-phase2-requirements-02">moving to explore</a> cryptographically strong transports such as TLS for communicating between resolvers and authoritative servers.</p><p>At Cloudflare, we’ve been helping to reduce the friction of DNSSEC deployment, while also <a href="/encrypting-dns-end-to-end/">helping to improve transport security in the long run</a>. There is also an effort to increase entropy in DNS messages with <a href="https://tools.ietf.org/html/rfc7873">RFC 7873 - Domain Name System (DNS) Cookies</a>, and make DNS over TCP support mandatory <a href="https://tools.ietf.org/html/rfc7766">RFC 7766 - DNS Transport over TCP - Implementation Requirements</a>, with even more <a href="https://datatracker.ietf.org/doc/html/draft-wijngaards-dnsext-resolver-side-mitigation-01">documentation</a> around ways to mitigate this type of issue available in different places. All of these efforts are complementary, which is a good thing. The DNS ecosystem consists of many different parties and software with different requirements and opinions, as long as the operators support at least one of the preventive measures, these types of attacks will become more and more difficult.</p><p>If you are an operator of an DNS forwarder or recursive DNS resolver, you should consider taking the following steps to protect yourself from this attack:</p><ul><li><p>Upgrade your Linux Kernel with <a href="https://git.kernel.org/linus/b38e7819cae946e2edf869e604af1e65a5d241c5">https://git.kernel.org/linus/b38e7819cae946e2edf869e604af1e65a5d241c5</a> (included with v5.10), which uses unpredictable rate limits</p></li><li><p>Block the outgoing ICMP “port unreachable” messages with iptables or lower the ICMP rate limit on Linux</p></li><li><p>Keep your DNS software up to date</p></li></ul><p>We’d like to thank the researchers for responsibly disclosing this attack and look forward to working with them in the future on efforts to strengthen the DNS.</p> ]]></content:encoded>
            <category><![CDATA[DNS]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Vulnerabilities]]></category>
            <guid isPermaLink="false">2OIMCvAglmZug8ev7RgC92</guid>
            <dc:creator>Marek Vavruša</dc:creator>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Going Keyless Everywhere]]></title>
            <link>https://blog.cloudflare.com/going-keyless-everywhere/</link>
            <pubDate>Fri, 01 Nov 2019 13:01:00 GMT</pubDate>
            <description><![CDATA[ Time flies. The Heartbleed vulnerability was discovered just over five and a half years ago. Heartbleed became a household name not only because it was one of the first bugs with its own web page and logo, but because of what it revealed about the fragility of the Internet as a whole. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Time flies. The <a href="/tag/heartbleed/">Heartbleed</a> vulnerability was discovered just over five and a half years ago. Heartbleed became a household name not only because it was one of the first bugs with its own <a href="http://heartbleed.com/">web page</a> and <a href="http://heartbleed.com/heartbleed.png">logo</a>, but because of what it revealed about the fragility of the Internet as a whole. With Heartbleed, one tiny bug in a cryptography library exposed the personal data of the users of almost every website online.</p><p>Heartbleed is an example of an underappreciated class of bugs: remote memory disclosure vulnerabilities. High profile examples other than <a href="/tag/heartbleed/">Heartbleed</a> include <a href="/incident-report-on-memory-leak-caused-by-cloudflare-parser-bug/">Cloudbleed</a> and most recently <a href="https://arxiv.org/abs/1807.10535">NetSpectre</a>. These vulnerabilities allow attackers to extract secrets from servers by simply sending them specially-crafted packets. Cloudflare recently completed a multi-year project to make our platform more resilient against this category of bug.</p><p>For the last five years, the industry has been dealing with the consequences of the design that led to Heartbleed being so impactful. In this blog post we’ll dig into memory safety, and how we re-designed Cloudflare’s main product to protect private keys from the next Heartbleed.</p>
    <div>
      <h2>Memory Disclosure</h2>
      <a href="#memory-disclosure">
        
      </a>
    </div>
    <p>Perfect security is not possible for businesses with an online component. History has shown us that no matter how robust their security program, an unexpected exploit can leave a company exposed. One of the more famous recent incidents of this sort is Heartbleed, a vulnerability in a commonly used cryptography library called OpenSSL that exposed the inner details of millions of web servers to anyone with a connection to the Internet. Heartbleed made international news, caused millions of dollars of damage, and <a href="https://blog.malwarebytes.com/exploits-and-vulnerabilities/2019/09/everything-you-need-to-know-about-the-heartbleed-vulnerability/">still hasn’t been fully resolved</a>.</p><p>Typical web services only return data via well-defined public-facing interfaces called APIs. Clients don’t typically get to see what’s going on under the hood inside the server, that would be a huge privacy and security risk. Heartbleed broke that paradigm: it enabled anyone on the Internet to get access to take a peek at the operating memory used by web servers, revealing privileged data usually not exposed via the API. Heartbleed could be used to extract the result of previous data sent to the server, including passwords and credit cards. It could also reveal the inner workings and cryptographic secrets used inside the server, including TLS <a href="/the-results-of-the-cloudflare-challenge/">certificate private keys</a>.</p><p>Heartbleed let attackers peek behind the curtain, but not too far. Sensitive data could be extracted, but not everything on the server was at risk. For example, Heartbleed did not enable attackers to steal the content of databases held on the server. You may ask: why was some data at risk but not others? The reason has to do with how modern operating systems are built.</p>
    <div>
      <h2>A simplified view of process isolation</h2>
      <a href="#a-simplified-view-of-process-isolation">
        
      </a>
    </div>
    <p>Most modern operating systems are split into multiple layers. These layers are analogous to security clearance levels. So-called user-space applications (like your browser) typically live in a low-security layer called user space. They only have access to computing resources (memory, CPU, networking) if the lower, more credentialed layers let them.</p><p>User-space applications need resources to function. For example, they need memory to store their code and working memory to do computations. However, it would be risky to give an application direct access to the physical RAM of the computer they’re running on. Instead, the raw computing elements are restricted to a lower layer called the operating system kernel. The kernel only runs specially-designed applications designed to safely manage these resources and mediate access to them for user-space applications.</p><p>When a new user space application process is launched, the kernel gives it a virtual memory space. This virtual memory space acts like real memory to the application but is actually a safely guarded translation layer the kernel uses to protect the real memory. Each application’s virtual memory space is like a parallel universe dedicated to that application. This makes it impossible for one process to view or modify another’s, the other applications are simply not addressable.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/46WR5JrLwEtc94VDZ7YZJK/8dd78b2efd297c87c430362e7883b4d3/image9-3.png" />
            
            </figure>
    <div>
      <h2>Heartbleed, Cloudbleed and the process boundary</h2>
      <a href="#heartbleed-cloudbleed-and-the-process-boundary">
        
      </a>
    </div>
    <p>Heartbleed was a vulnerability in the OpenSSL library, which was part of many web server applications. These web servers run in user space, like any common applications. This vulnerability caused the web server to return up to 2 kilobytes of its memory in response to a specially-crafted inbound request.</p><p>Cloudbleed was also a memory disclosure bug, albeit one specific to Cloudflare, that got its name because it was so similar to Heartbleed. With Cloudbleed, the vulnerability was not in OpenSSL, but instead in a secondary web server application used for HTML parsing. When this code parsed a certain sequence of HTML, it ended up inserting some process memory into the web page it was serving.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7qlhsxgqsCJwmzNREBXRYx/05a1c85bf7a8109890bf8f621f61bc55/image2.png" />
            
            </figure><p>It’s important to note that both of these bugs occurred in applications running in user space, not kernel space. This means that the memory exposed by the bug was necessarily part of the virtual memory of the application. Even if the bug were to expose megabytes of data, it would only expose data specific to that application, not other applications on the system.</p><p>In order for a web server to serve traffic over the encrypted HTTPS protocol, it needs access to the certificate’s private key, which is typically kept in the application’s memory. These keys were exposed to the Internet by Heartbleed. The Cloudbleed vulnerability affected a different process, the HTML parser, which doesn’t do HTTPS and therefore doesn’t keep the private key in memory. This meant that HTTPS keys were safe, even if other data in the HTML parser’s memory space wasn’t.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6B3QATkOKQfQndbFuDifgd/6b77a1e6fc06fdfa386158113aac5369/image4.png" />
            
            </figure><p>The fact that the HTML parser and the web server were different applications saved us from having to revoke and re-issue our customers’ <a href="https://www.cloudflare.com/application-services/products/ssl/">TLS certificates</a>. However, if another memory disclosure vulnerability is discovered in the web server, these keys are again at risk.</p>
    <div>
      <h2>Moving keys out of Internet-facing processes</h2>
      <a href="#moving-keys-out-of-internet-facing-processes">
        
      </a>
    </div>
    <p>Not all web servers keep private keys in memory. In some deployments, private keys are held in a separate machine called a Hardware Security Module (HSM). HSMs are built to withstand physical intrusion and tampering and are often built to comply with stringent compliance requirements. They can often be bulky and expensive. Web servers designed to take advantage of keys in an HSM connect to them over a physical cable and communicate with a specialized protocol called PKCS#11. This allows the web server to serve encrypted content while being physically separated from the private key.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1GBuW8GyHUgvg2VI7YKZpC/b5ca62effb7f36c3b7f3f8d80cc04f9e/image8-1.png" />
            
            </figure><p>At Cloudflare, we built our own way to separate a web server from a private key: <a href="/keyless-ssl-the-nitty-gritty-technical-details/">Keyless SSL</a>. Rather than keeping the keys in a separate physical machine connected to the server with a cable, the keys are kept in a key server operated by the customer in their own infrastructure (this can also be backed by an HSM).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/73zinlbc5lRdAJuhY7q2Jl/2ac31d4a9220ed6ca468b553f105a1d2/image10-4.png" />
            
            </figure><p>More recently, we launched <a href="/introducing-cloudflare-geo-key-manager/">Geo Key Manager</a>, a service that allows users to store private keys in only select Cloudflare locations. Connections to locations that do not have access to the private key use Keyless SSL with a key server hosted in a datacenter that does have access.</p><p>In both Keyless SSL and Geo Key Manager, private keys are not only not part of the web server’s memory space, they’re often not even in the same country! This extreme degree of separation is not necessary to protect against the next Heartbleed. All that is needed is for the web server and the key server to not be part of the same application. So that’s what we did. We call this Keyless Everywhere.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/jFMg99U9Aiq8yNh43fx1l/d61671a3bb94f6fc415ad5aef8b4f808/image7-2.png" />
            
            </figure>
    <div>
      <h2>Keyless SSL is coming from inside the house</h2>
      <a href="#keyless-ssl-is-coming-from-inside-the-house">
        
      </a>
    </div>
    <p>Repurposing Keyless SSL for Cloudflare-held private keys was easy to conceptualize, but the path from ideation to live in production wasn't so straightforward. The core functionality of Keyless SSL comes from the open source <a href="https://github.com/cloudflare/gokeyless">gokeyless</a> which customers run on their infrastructure, but internally we use it as a library and have replaced the main package with an implementation suited to our requirements (we've creatively dubbed it gokeyless-internal).</p><p>As with all major architecture changes, it’s prudent to start with testing out the model with something new and low risk. In our case, the test bed was our experimental <a href="/introducing-tls-1-3/">TLS 1.3</a> implementation. In order to quickly iterate through draft versions of the TLS specification and push releases without affecting the majority of Cloudflare customers, we <a href="/introducing-tls-1-3/">re-wrote our custom nginx web server in Go</a> and deployed it in parallel to our existing infrastructure. This server was designed to never hold private keys from the start and only leverage gokeyless-internal. At this time there was only a small amount of TLS 1.3 traffic and it was all coming from the beta versions of browsers, which allowed us to work through the initial kinks of gokeyless-internal without exposing the majority of visitors to security risks or outages due to gokeyless-internal.</p><p>The first step towards making TLS 1.3 fully keyless was identifying and implementing the new functionality we needed to add to gokeyless-internal. Keyless SSL was designed to run on customer infrastructure, with the expectation of supporting only a handful of private keys. But our edge must simultaneously support millions of private keys, so we implemented the same <a href="/universal-ssl-how-it-scales/">lazy loading</a> logic we use in our web server, nginx. Furthermore, a typical customer deployment would put key servers behind a network load balancer, so they could be taken out of service for upgrades or other maintenance. Contrast this with our edge, where it’s important to maximize our resources by serving traffic during software upgrades. This problem is solved by the excellent <a href="/graceful-upgrades-in-go/">tableflip package</a> we use elsewhere at Cloudflare.</p><p>The next project to go Keyless was <a href="https://www.cloudflare.com/products/cloudflare-spectrum/">Spectrum</a>, which launched with default support for gokeyless-internal. With these small victories in hand, we had the confidence necessary to attempt the big challenge, which was porting our existing nginx infrastructure to a fully keyless model. After implementing the new functionality, and being satisfied with our integration tests, all that’s left is to turn this on in production and call it a day, right? Anyone with experience with large distributed systems knows how far "working in dev" is from "done," and this story is no different. Thankfully we were anticipating problems, and built a fallback into nginx to complete the handshake itself if any problems were encountered with the gokeyless-internal path. This allowed us to expose gokeyless-internal to production traffic without risking downtime in the event that our reimplementation of the nginx logic was not 100% bug-free.</p>
    <div>
      <h2>When rolling back the code doesn’t roll back the problem</h2>
      <a href="#when-rolling-back-the-code-doesnt-roll-back-the-problem">
        
      </a>
    </div>
    <p>Our deployment plan was to enable Keyless Everywhere, find the most common causes of fallbacks, and then fix them. We could then repeat this process until all sources of fallbacks had been eliminated, after which we could remove access to private keys (and therefore the fallback) from nginx. One of the early causes of fallbacks was gokeyless-internal returning ErrKeyNotFound, indicating that it couldn’t find the requested private key in storage. This should not have been possible, since nginx only makes a request to gokeyless-internal after first finding the certificate and key pair in storage, and we always write the private key and certificate together. It turned out that in addition to returning the error for the intended case of the key truly not found, we were also returning it when transient errors like timeouts were encountered. To resolve this, we updated those transient error conditions to return ErrInternal, and deployed to our <a href="https://en.wikipedia.org/wiki/Sentinel_species">canary datacenters</a>. Strangely, we found that a handful of instances in a single datacenter started encountering high rates of fallbacks, and the logs from nginx indicated it was due to a timeout between nginx and gokeyless-internal. The timeouts didn’t occur right away, but once a system started logging some timeouts it never stopped. Even after we rolled back the release, the fallbacks continued with the old version of the software! Furthermore, while nginx was complaining about timeouts, gokeyless-internal seemed perfectly healthy and was reporting reasonable performance metrics (sub-millisecond median request latency).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5xlp86WlHoUaRjiXcdifcP/c06dad2ff1f58ff555470d8809d6bba8/image1-1.png" />
            
            </figure><p>To debug the issue, we added detailed logging to both nginx and gokeyless, and followed the chain of events backwards once timeouts were encountered.</p>
            <pre><code>➜ ~ grep 'timed out' nginx.log | grep Keyless | head -5
2018-07-25T05:30:49.000 29m41 2018/07/25 05:30:49 [error] 4525#0: *1015157 Keyless SSL request/response timed out while reading Keyless SSL response, keyserver: 127.0.0.1
2018-07-25T05:30:49.000 29m41 2018/07/25 05:30:49 [error] 4525#0: *1015231 Keyless SSL request/response timed out while waiting for Keyless SSL response, keyserver: 127.0.0.1
2018-07-25T05:30:49.000 29m41 2018/07/25 05:30:49 [error] 4525#0: *1015271 Keyless SSL request/response timed out while waiting for Keyless SSL response, keyserver: 127.0.0.1
2018-07-25T05:30:49.000 29m41 2018/07/25 05:30:49 [error] 4525#0: *1015280 Keyless SSL request/response timed out while waiting for Keyless SSL response, keyserver: 127.0.0.1
2018-07-25T05:30:50.000 29m41 2018/07/25 05:30:50 [error] 4525#0: *1015289 Keyless SSL request/response timed out while waiting for Keyless SSL response, keyserver: 127.0.0.1</code></pre>
            <p>You can see the first request to log a timeout had id 1015157. Also interesting that the first log line was "timed out while reading," but all the others are "timed out while waiting," and this latter message is the one that continues forever. Here is the matching request in the gokeyless log:</p>
            <pre><code>➜ ~ grep 'id=1015157 ' gokeyless.log | head -1
2018-07-25T05:30:39.000 29m41 2018/07/25 05:30:39 [DEBUG] connection 127.0.0.1:30520: worker=ecdsa-29 opcode=OpECDSASignSHA256 id=1015157 sni=announce.php?info_hash=%a8%9e%9dc%cc%3b1%c8%23%e4%93%21r%0f%92mc%0c%15%89&amp;peer_id=-ut353s-%ce%ad%5e%b1%99%06%24e%d5d%9a%08&amp;port=42596&amp;uploaded=65536&amp;downloaded=0&amp;left=0&amp;corrupt=0&amp;key=04a184b7&amp;event=started&amp;numwant=200&amp;compact=1&amp;no_peer_id=1 ip=104.20.33.147</code></pre>
            <p>Aha! That SNI value is clearly invalid (SNIs are like Host headers, i.e. they are domains, not URL paths), and it’s also quite long. Our storage system indexes certificates based on two indices: which SNI they correspond to, and which IP addresses they correspond to (for older clients that don’t support SNI). Our storage interface uses the memcached protocol, and the client library that gokeyless-internal uses rejects requests for keys longer than 250 characters (memcached’s maximum key length), whereas the nginx logic is to simply ignore the invalid SNI and treat the request as if only had an IP. The change in our new release had shifted this condition from <code>ErrKeyNotFound</code> to <code>ErrInternal</code>, which triggered cascading problems in nginx. The “timeouts” it encountered were actually a result of throwing away all in-flight requests multiplexed on a connection which happened to return <code>ErrInternal</code>for a single request. These requests were retried, but once this condition triggered, nginx became overloaded by the number of retried requests plus the continuous stream of new requests coming in with bad SNI, and was unable to recover. This explains why rolling back gokeyless-internal didn’t fix the problem.</p><p>This discovery finally brought our attention to nginx, which thus far had escaped blame since it had been working reliably with customer key servers for years. However, communicating over localhost to a multitenant key server is fundamentally different than reaching out over the public Internet to communicate with a customer’s key server, and we had to make the following changes:</p><ul><li><p>Instead of a long connection timeout and a relatively short response timeout for customer key servers, extremely short connection timeouts and longer request timeouts are appropriate for a localhost key server.</p></li><li><p>Similarly, it’s reasonable to retry (with backoff) if we timeout waiting on a customer key server response, since we can’t trust the network. But over localhost, a timeout would only occur if gokeyless-internal were overloaded and the request were still queued for processing. In this case a retry would only lead to more total work being requested of gokeyless-internal, making the situation worse.</p></li><li><p>Most significantly, nginx must not throw away all requests multiplexed on a connection if any single one of them encounters an error, since a single connection no longer represents a single customer.</p></li></ul>
    <div>
      <h2>Implementations matter</h2>
      <a href="#implementations-matter">
        
      </a>
    </div>
    <p>CPU at the edge is one of our most precious assets, and it’s closely guarded by our performance team (aka CPU police). Soon after turning on Keyless Everywhere in one of our canary datacenters, they noticed gokeyless using ~50% of a core per instance. We were shifting the sign operations from nginx to gokeyless, so of course it would be using more CPU now. But nginx should have seen a commensurate reduction in CPU usage, right?</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5UKCYIeE5MqU3j7jG8GFiy/38fbb7e9842218b75153a512d908ae31/image5.png" />
            
            </figure><p>Wrong. Elliptic curve operations are very fast in Go, but it’s known that <a href="https://github.com/golang/go/issues/21525">RSA operations are much slower than their BoringSSL counterparts</a>.</p><p>Although Go 1.11 includes optimizations for RSA math operations, we needed more speed. Well-tuned assembly code is required to match the performance of BoringSSL, so Armando Faz from our Crypto team helped claw back some of the lost CPU by reimplementing parts of the <a href="https://golang.org/pkg/math/big/">math/big</a> package with platform-dependent assembly in an internal fork of Go. The recent <a href="https://github.com/golang/go/wiki/AssemblyPolicy">assembly policy</a> of Go prefers the use of Go portable code instead of assembly, so these optimizations were not upstreamed. There is still room for more optimizations, and for that reason we’re still evaluating moving to cgo + BoringSSL for sign operations, despite <a href="https://dave.cheney.net/2016/01/18/cgo-is-not-go">cgo’s many downsides</a>.</p>
    <div>
      <h2>Changing our tooling</h2>
      <a href="#changing-our-tooling">
        
      </a>
    </div>
    <p>Process isolation is a powerful tool for protecting secrets in memory. Our move to Keyless Everywhere demonstrates that this is not a simple tool to leverage. Re-architecting an existing system such as nginx to use process isolation to protect secrets was time-consuming and difficult. Another approach to memory safety is to use a memory-safe language such as Rust.</p><p>Rust was originally developed by Mozilla but is starting <a href="https://www.infoq.com/articles/programming-language-trends-2019/">to be used much more widely</a>. The main advantage that Rust has over C/C++ is that it has memory safety features without a garbage collector.</p><p>Re-writing an existing application in a new language such as Rust is a daunting task. That said, many new Cloudflare features, from the powerful <a href="/announcing-firewall-rules/">Firewall Rules</a> feature to our <a href="/announcing-warp-plus/">1.1.1.1 with WARP</a> app, have been written in Rust to take advantage of its powerful memory-safety properties. We’re really happy with Rust so far and plan on using it even more in the future.</p>
    <div>
      <h2>Conclusion</h2>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>The harrowing aftermath of Heartbleed taught the industry a lesson that should have been obvious in retrospect: keeping important secrets in applications that can be accessed remotely via the Internet is a risky security practice. In the following years, with a lot of work, we leveraged process separation and Keyless SSL to ensure that the next Heartbleed wouldn’t put customer keys at risk.</p><p>However, this is not the end of the road. Recently memory disclosure vulnerabilities such as <a href="https://arxiv.org/abs/1807.10535">NetSpectre</a> have been discovered which are able to bypass application process boundaries, so we continue to actively explore new ways to keep keys secure.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/41IkUo52ZjxvkXCjUsoKGE/280a2f7580e8d374abffe61b61615bff/image3.png" />
            
            </figure><p></p> ]]></content:encoded>
            <category><![CDATA[Crypto Week]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Keyless SSL]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">4l12BK6lPNLLMUIUI3kNN</guid>
            <dc:creator>Nick Sullivan</dc:creator>
            <dc:creator>Chris Broglie</dc:creator>
        </item>
        <item>
            <title><![CDATA[Delegated Credentials for TLS]]></title>
            <link>https://blog.cloudflare.com/keyless-delegation/</link>
            <pubDate>Fri, 01 Nov 2019 13:00:00 GMT</pubDate>
            <description><![CDATA[ Announcing support for a new cryptographic protocol making it possible to deploy encrypted services while still maintaining performance and control of private keys: Delegated Credentials for TLS.  ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Today we’re happy to announce support for a new cryptographic protocol that helps make it possible to deploy encrypted services in a global network while still maintaining fast performance and tight control of private keys: Delegated Credentials for TLS. We have been working with partners from Facebook, Mozilla, and the broader IETF community to define this emerging standard. We’re excited to share the gory details today in this blog post.</p><p>Also, be sure to check out the blog posts on the topic by our friends at <a href="https://engineering.fb.com/security/delegated-credentials-improving-the-security-of-tls-certificates/">Facebook</a> and <a href="https://blog.mozilla.org/security/2019/11/01/validating-delegated-credentials-for-tls-in-firefox/">Mozilla</a>!</p>
    <div>
      <h2>Deploying TLS globally</h2>
      <a href="#deploying-tls-globally">
        
      </a>
    </div>
    <p>Many of the technical problems we face at Cloudflare are widely shared problems across the Internet industry. As gratifying as it can be to solve a problem for ourselves and our customers, it can be even more gratifying to solve a problem for the entire Internet. For the past three years, we have been working with peers in the industry to solve a specific shared problem in the TLS infrastructure space: How do you terminate TLS connections while storing keys remotely and maintaining performance and availability? Today we’re announcing that Cloudflare now supports Delegated Credentials, the result of this work.</p><p>Cloudflare’s TLS/SSL features are among the top reasons customers use our service. Configuring TLS is hard to do without internal expertise. By automating TLS, web site and web service operators gain the latest TLS features and the most secure configurations by default. It also reduces the risk of outages or bad press due to misconfigured or insecure encryption settings. Customers also gain early access to unique features like <a href="/introducing-tls-1-3/">TLS 1.3</a>, <a href="/towards-post-quantum-cryptography-in-tls/">post-quantum cryptography</a>, and <a href="/high-reliability-ocsp-stapling/">OCSP stapling</a> as they become available.</p><p>Unfortunately, for web services to authorize a service to terminate TLS for them, they have to trust the service with their private keys, which demands a high level of trust. For services with a global footprint, there is an additional level of nuance. They may operate multiple data centers located in places with varying levels of physical security, and each of these needs to be trusted to terminate TLS.</p><p>To tackle these problems of trust, Cloudflare has invested in two technologies: <a href="/announcing-keyless-ssl-all-the-benefits-of-cloudflare-without-having-to-turn-over-your-private-ssl-keys/">Keyless SSL</a>, which allows customers to use Cloudflare without sharing their private key with Cloudflare; and <a href="/introducing-cloudflare-geo-key-manager/">Geo Key Manager</a>, which allows customers to choose the geographical locations in which Cloudflare should keep their keys. Both of these technologies are able to be deployed without any changes to browsers or other clients. They also come with some downsides in the form of availability and performance degradation.</p><p>Keyless SSL introduces extra latency at the start of a connection. In order for a server without access to a private key to establish a connection with a client, that servers needs to reach out to a key server, or a remote point of presence, and ask them to do a private key operation. This not only adds additional latency to the connection, causing the content to load slower, but it also introduces some troublesome operational constraints on the customer. Specifically, the server with access to the key needs to be highly available or the connection can fail. Sites often use Cloudflare to improve their site’s availability, so having to run a high-availability key server is an unwelcome requirement.</p>
    <div>
      <h2>Turning a pull into a push</h2>
      <a href="#turning-a-pull-into-a-push">
        
      </a>
    </div>
    <p>The reason services like Keyless SSL that rely on remote keys are so brittle is their architecture: they are pull-based rather than push-based. Every time a client attempts a handshake with a server that doesn’t have the key, it needs to pull the authorization from the key server. An alternative way to build this sort of system is to periodically push a short-lived authorization key to the server and use that for handshakes. Switching from a pull-based model to a push-based model eliminates the additional latency, but it comes with additional requirements, including the need to change the client.</p><p>Enter the new TLS feature of <a href="https://tools.ietf.org/html/draft-ietf-tls-subcerts-04">Delegated Credentials</a> (DCs). A delegated credential is a short-lasting key that the certificate’s owner has delegated for use in TLS. They work like a power of attorney: your server authorizes our server to terminate TLS for a limited time. When a browser that supports this protocol connects to our edge servers we can show it this “power of attorney”, instead of needing to reach back to a customer’s server to get it to authorize the TLS connection. This reduces latency and improves performance and reliability.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1wNKw1iaNaUHBESq06OXIK/fbbba3ca4614c398480a03e7ce00fc1b/pull-diagram-1.jpg" />
            
            </figure><p>The pull model</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/qfW3dQvRSnHowxNEW2lSf/d457a3d0b7c52f9c3523c7f2d73cd94a/push-diagram.jpg" />
            
            </figure><p>The push model</p><p>A fresh delegated credential can be created and pushed out to TLS servers long before the previous credential expires. Momentary blips in availability will not lead to broken handshakes for clients that support delegated credentials. Furthermore, a Delegated Credentials-enabled TLS connection is just as fast as a standard TLS connection: there’s no need to connect to the key server for every handshake. This removes the main drawback of Keyless SSL for DC-enabled clients.</p><p>Delegated credentials are intended to be an Internet Standard RFC that anyone can implement and use, not a replacement for Keyless SSL. Since browsers will need to be updated to support the standard, proprietary mechanisms like Keyless SSL and Geo Key Manager will continue to be useful. Delegated credentials aren’t just useful in our context, which is why we’ve developed it openly and with contributions from across industry and academia. Facebook has integrated them into their own TLS implementation, and you can read more about how they view the security benefits <a href="https://engineering.fb.com/security/delegated-credentials/">here.</a>  When it comes to improving the security of the Internet, we’re all on the same team.</p><p><i>"We believe delegated credentials provide an effective way to boost security by reducing certificate lifetimes without sacrificing reliability. This will soon become an Internet standard and we hope others in the industry adopt delegated credentials to help make the Internet ecosystem more secure."</i></p><p></p><p>— <b>Subodh Iyengar</b>, software engineer at Facebook</p>
    <div>
      <h2>Extensibility beyond the PKI</h2>
      <a href="#extensibility-beyond-the-pki">
        
      </a>
    </div>
    <p>At Cloudflare, we’re interested in pushing the state of the art forward by experimenting with new algorithms. In TLS, there are three main areas of experimentation: ciphers, key exchange algorithms, and authentication algorithms. Ciphers and key exchange algorithms are only dependent on two parties: the client and the server. This freedom allows us to deploy exciting new choices like <a href="/do-the-chacha-better-mobile-performance-with-cryptography/">ChaCha20-Poly1305</a> or <a href="/towards-post-quantum-cryptography-in-tls/">post-quantum key agreement</a> in lockstep with browsers. On the other hand, the authentication algorithms used in TLS are dependent on certificates, which introduces certificate authorities and the entire public key infrastructure into the mix.</p><p>Unfortunately, the public key infrastructure is very conservative in its choice of algorithms, making it harder to adopt newer cryptography for authentication algorithms in TLS. For instance, <a href="https://en.wikipedia.org/wiki/EdDSA">EdDSA</a>, a highly-regarded signature scheme, is not supported by certificate authorities, and <a href="https://www.mozilla.org/en-US/about/governance/policies/security-group/certs/policy/">root programs limit the certificates that will be signed.</a> With the emergence of quantum computing, experimenting with new algorithms is essential to determine which solutions are deployable and functional on the Internet.</p><p>Since delegated credentials introduce the ability to use new authentication key types without requiring changes to certificates themselves, this opens up a new area of experimentation. Delegated credentials can be used to provide a level of flexibility in the transition to post-quantum cryptography, by enabling new algorithms and modes of operation to coexist with the existing PKI infrastructure. It also enables tiny victories, like the ability to use smaller, faster Ed25519 signatures in TLS.</p>
    <div>
      <h2>Inside DCs</h2>
      <a href="#inside-dcs">
        
      </a>
    </div>
    <p>A delegated credential contains a public key and an expiry time. This bundle is then signed by a certificate along with the certificate itself, binding the delegated credential to the certificate for which it is acting as “power of attorney”. A supporting client indicates its support for delegated credentials by including an extension in its Client Hello.</p><p>A server that supports delegated credentials composes the TLS Certificate Verify and Certificate messages as usual, but instead of signing with the certificate’s private key, it includes the certificate along with the DC, and signs with the DC’s private key. Therefore, the private key of the certificate only needs to be used for the signing of the DC.</p><p>Certificates used for signing delegated credentials require a special X.509 certificate extension (currently only available at <a href="https://docs.digicert.com/manage-certificates/certificate-profile-options/">DigiCert</a>). This requirement exists to avoid breaking assumptions people may have about the impact of temporary access to their keys on security, particularly in cases involving HSMs and the still unfixed <a href="/rfc-8446-aka-tls-1-3/">Bleichenbacher oracles</a> in older TLS versions.  Temporary access to a key can enable signing lots of delegated credentials which start far in the future, and as a result support was made opt-in. Early versions of QUIC had <a href="https://www.nds.ruhr-uni-bochum.de/media/nds/veroeffentlichungen/2015/08/21/Tls13QuicAttacks.pdf">similar issues</a>, and ended up adopting TLS to fix them. Protocol evolution on the Internet requires working well with already existing protocols and their flaws.</p>
    <div>
      <h2>Delegated Credentials at Cloudflare and Beyond</h2>
      <a href="#delegated-credentials-at-cloudflare-and-beyond">
        
      </a>
    </div>
    <p>Currently we use delegated credentials as a performance optimization for Geo Key Manager and Keyless SSL. Customers can update their certificates to include the special extension for delegated credentials, and we will automatically create delegated credentials and distribute them to the edge through the Keyless SSL or Geo Key Manager. For more information, see the <a href="https://developers.cloudflare.com/ssl/keyless-ssl/dc/">documentation.</a> It also enables us to be more conservative about where we keep keys for customers, improving our security posture.</p><p>Delegated Credentials would be useless if it wasn’t also supported by browsers and other HTTP clients. Christopher Patton, a former intern at Cloudflare, implemented support in Firefox and its underlying NSS security library. <a href="https://blog.mozilla.org/security/2019/11/01/validating-delegated-credentials-for-tls-in-firefox/">This feature is now in the Nightly versions of Firefox</a>. You can turn it on by activating the configuration option security.tls.enable_delegated_credentials at about:config. Studies are ongoing on how effective this will be in a wider deployment. There also is support for Delegated Credentials in BoringSSL.</p><p><i>"At Mozilla we welcome ideas that help to make the Web PKI more robust. The Delegated Credentials feature can help to provide secure and performant TLS connections for our users, and we're happy to work with Cloudflare to help validate this feature."</i></p><p></p><p>— <b>Thyla van der Merwe</b>, Cryptography Engineering Manager at Mozilla</p><p>One open issue is the question of client clock accuracy. Until we have a wide-scale study we won’t know how many connections using delegated credentials will break because of the 24 hour time limit that is imposed.  Some clients, in particular mobile clients, may have inaccurately set clocks, the root cause of one third of all <a href="https://www.cloudflare.com/learning/ssl/common-errors/">certificate errors</a> in Chrome. Part of the way that we’re aiming to solve this problem is through standardizing and improving <a href="/roughtime/">Roughtime</a>, so web browsers and other services that need to validate certificates can do so independent of the client clock.</p><p>Cloudflare’s global scale means that we see connections from every corner of the world, and from many different kinds of connection and device. That reach enables us to find rare problems with the deployability of protocols. For example, our <a href="/why-tls-1-3-isnt-in-browsers-yet/">early deployment</a> helped inform the development of the TLS 1.3 standard. As we enable developing protocols like delegated credentials, we learn about obstacles that inform and affect their future development.</p>
    <div>
      <h2>Conclusion</h2>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>As new protocols emerge, we'll continue to play a role in their development and bring their benefits to our customers. Today’s announcement of a technology that overcomes some limitations of Keyless SSL is just one example of how Cloudflare takes part in improving the Internet not just for our customers, but for everyone. During the standardization process of turning the draft into an RFC, we’ll continue to maintain our implementation and come up with new ways to apply delegated credentials.</p> ]]></content:encoded>
            <category><![CDATA[Crypto Week]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Keyless SSL]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">21MHSnISq1AaWWdB5lruxJ</guid>
            <dc:creator>Nick Sullivan</dc:creator>
            <dc:creator>Watson Ladd</dc:creator>
        </item>
        <item>
            <title><![CDATA[Tales from the Crypt(o team)]]></title>
            <link>https://blog.cloudflare.com/tales-from-the-crypt-o-team/</link>
            <pubDate>Sun, 27 Oct 2019 23:00:00 GMT</pubDate>
            <description><![CDATA[ Halloween season is upon us. This week we’re sharing a series of blog posts about work being done at Cloudflare involving cryptography, one of the spookiest technologies around. ]]></description>
            <content:encoded><![CDATA[ <figure><img /></figure>

<p>Halloween season is upon us. This week we’re sharing a series of blog posts about work being done at Cloudflare involving cryptography, one of the spookiest technologies around. So subscribe to this blog and come back every day for tricks, treats, and deep technical content.</p>
    <div>
      <h2>A long-term mission</h2>
      <a href="#a-long-term-mission">
        
      </a>
    </div>
    <p>Cryptography is one of the most powerful technological tools we have, and Cloudflare has been at the forefront of using cryptography to help build a better Internet. Of course, we haven’t been alone on this journey. Making meaningful changes to the way the Internet works requires time, effort, experimentation, momentum, and willing partners. Cloudflare has been involved with several multi-year efforts to leverage cryptography to help make the Internet better.</p><p>Here are some highlights to expect this week:</p><ul><li><p>We’re renewing Cloudflare’s commitment to privacy-enhancing technologies by sharing some of the recent work being done on <a href="/cloudflare-supports-privacy-pass/">Privacy Pass</a>: <a href="/supporting-the-latest-version-of-the-privacy-pass-protocol/">Supporting the latest version of the Privacy Pass Protocol</a></p></li><li><p>We’re helping forge a path to a quantum-safe Internet by sharing some of the results of the <a href="/towards-post-quantum-cryptography-in-tls/">Post-quantum Cryptography</a> experiment: <a href="/the-tls-post-quantum-experiment/">The TLS Post-Quantum Experiment</a></p></li><li><p>We’re sharing the rust-based software we use to power <a href="/secure-time/">time.cloudflare.com</a>: <a href="/announcing-cfnts/">Announcing cfnts: Cloudflare's implementation of NTS in Rust</a></p></li><li><p>We’re doing a deep dive into the technical details of <a href="https://developers.cloudflare.com/1.1.1.1/dns-over-https/">Encrypted DNS</a>: <a href="/dns-encryption-explained/">DNS Encryption Explained</a></p></li><li><p>We’re announcing support for a new technique we developed with industry partners to help keep TLS private keys more secure: <a href="/keyless-delegation/">Delegated Credentials for TLS</a>, and how we're keeping keys safe from memory disclosure attacks: <a href="/going-keyless-everywhere/">Going Keyless Everywhere</a></p></li></ul><p>The milestones we’re sharing this week would not be possible without partnerships with companies, universities, and individuals working in good faith to help build a better Internet together. Hopefully, this week provides a fun peek into the future of the Internet.</p> ]]></content:encoded>
            <category><![CDATA[Crypto Week]]></category>
            <category><![CDATA[Cryptography]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">5Bgs7HuC6VeCOjcHUOVF0o</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare’s Approach to Research]]></title>
            <link>https://blog.cloudflare.com/cloudflares-approach-to-research/</link>
            <pubDate>Wed, 18 Sep 2019 14:03:38 GMT</pubDate>
            <description><![CDATA[ Cloudflare’s mission is to help build a better Internet. One of the tools used in pursuit of this goal is computer science research. We’ve learned that some of the difficult problems to solve are best approached through research ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Cloudflare’s mission is to help build a better Internet. One of the tools used in pursuit of this goal is computer science research. We’ve learned that some of the difficult problems to solve are best approached through research and experimentation to understand the solution before engineering it at scale. This research-focused approach to solving the big problems of the Internet is exemplified by the work of the Cryptography Research team, which leverages research to help build a safer, more secure and more performant Internet. Over the years, the team has worked on more than just cryptography, so <b>we’re taking the model we’ve developed and expanding the scope of the team to include more areas of computer science research</b>. Cryptography Research at Cloudflare is now Cloudflare Research. I am excited to share some of the insights we’ve learned over the years in this blog post.</p>
    <div>
      <h2>Cloudflare’s research model</h2>
      <a href="#cloudflares-research-model">
        
      </a>
    </div>
    <p>Principle</p><p>Description</p><p>Team structure</p><p><b>Hybrid approach.</b> We have a program that allows research engineers to be embedded into product and operations teams for temporary assignments. This gives people direct exposure to practical problems.</p><p>Problem philosophy</p><p><b>Impact-focused.</b> We use our expertise and the expertise of partners in industry and academia to select projects that have the potential to make a big impact, and for which existing solutions are insufficient or not yet popularized.</p><p>Promoting solutions</p><p><b>Open collaboration.</b> Popularizing winning ideas through public outreach, working with industry partners to promote standardization, and implementing ideas at scale to show they’re effective.</p>
    <div>
      <h2>The hybrid approach to research</h2>
      <a href="#the-hybrid-approach-to-research">
        
      </a>
    </div>
    <p><i>“Super-ambitious goals tend to be unifying and energizing to people; but only if they believe there's a chance of success.” - Peter Diamandis</i></p><p>Given the scale and reach of Cloudflare, research problems (and opportunities) present themselves all the time. Our approach to research is a practical one. We choose to tackle <b>projects that have the potential to make a big impact, and for which existing solutions are insufficient</b>. <b>This stems from a belief that the interconnected systems that make up the Internet can be changed and improved in a fundamental way</b>. While some research problems are solvable in a few months, some may take years. We don’t shy away from long-term projects, but the Internet moves fast, so it’s important to break down long-term projects into smaller, independently-valuable pieces in order to continually provide value while pursuing a bigger vision.</p><p>Successful technological innovation is not purely about technical accomplishments. New creations need the social and political scaffolding to support it while being built, and the momentum and support to gain popularity. We are better able to innovate if grounded in a deep understanding of the current day-to-day. To stay grounded, our research team members spend part of their time solving practical problems that affect Cloudflare and our customers right now.</p><p>Cloudflare employs a hybrid research model similar to the model <a href="https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/38149.pdf">pioneered by Google</a>. Innovation can come from everywhere in a company, so teams are encouraged to find the right balance between research and engineering activities. The research team works with the same tools, systems, and constraints as the rest of the engineering organization.</p><p>Research engineers are expected to write production-quality code and contribute to engineering activities. This enables researchers to leverage the rich data provided by Cloudflare’s production environment for experiments. To further break down silos, we have a program that allows research engineers to be embedded into product and operations teams for temporary assignments. This gives people direct exposure to practical problems.</p>
    <div>
      <h2>Continuing a successful tradition (our tradition)</h2>
      <a href="#continuing-a-successful-tradition-our-tradition">
        
      </a>
    </div>
    <p><i>“Skate to where the puck is going, not where it has been.” - Wayne Gretzky</i></p><p>The output of the research team is both new knowledge and technology that can lead to innovative products. Research works hand-in-hand with both product and engineering to help drive long-term positive outcomes for both Cloudflare and the Internet at large.</p><p><b>An example of a long-term project that requires both research and engineering is helping the Internet migrate from insecure to secure network protocols</b>. To tackle the problem, we pursued several smaller projects with discrete and measurable outcomes. This included:</p><ul><li><p>Building designs and <a href="/ecdsa-the-digital-signature-algorithm-of-a-better-internet/">supporting</a> <a href="/tls-session-resumption-full-speed-and-secure/">systems</a> to enable <a href="/introducing-universal-ssl/">Cloudflare SSL certificates to scale to all free customers</a></p></li><li><p><a href="/introducing-cfssl/">Open sourcing software</a> that helped Let’s Encrypt do the same</p></li><li><p><a href="/monsters-in-the-middleboxes/">Measuring the prevalence of middleboxes</a> harmful to security</p></li><li><p>Helping <a href="/rfc-8446-aka-tls-1-3/">design</a> and <a href="/introducing-0-rtt/">deploy TLS 1.3</a></p></li><li><p>Supporting accountability in the PKI with <a href="/introducing-certificate-transparency-and-nimbus/">Certificate Transparency</a></p></li><li><p>Promoting secure time synchronization via <a href="https://www.cloudflare.com/time/">NTS and Roughtime</a></p></li><li><p>Encrypting DNS with <a href="https://developers.cloudflare.com/1.1.1.1/dns-over-https/">DoH and DoT</a></p></li></ul><p>and many other smaller projects. Each step along the way contributed something concrete to help make the Internet more secure.</p><p>This year’s <a href="/welcome-to-crypto-week-2019/">Crypto Week</a> is a great example of the type of impact an effective hybrid research organization can make. Every day that week, a new announcement was made that helped take research results and realize their practical impact. From the League of Entropy, which is based on fundamental work by <a href="https://github.com/dedis/drand/">researchers at EPFL</a>, to Cloudflare Time Services, which helps address time security issues raised in papers by former Cloudflare intern <a href="https://scholar.google.com/citations?hl=en&amp;user=WVff3wsAAAAJ">Aanchal Malhotra</a>, to our own (currently running) <a href="/towards-post-quantum-cryptography-in-tls/">post-quantum experiment</a> with Google Chrome, <b>engineers at Cloudflare combined research with building large-scale production systems to help solve some unsolved problems on the Internet</b>.</p>
    <div>
      <h2>Open collaboration, open standards, and open source</h2>
      <a href="#open-collaboration-open-standards-and-open-source">
        
      </a>
    </div>
    <p><i>“We reject kings, presidents and voting. We believe in rough consensus and running code.” - Dave Clark</i></p><p>Effective research requires:</p><ul><li><p>Choosing interesting problems to solve</p></li><li><p>Popularizing the ideas discovered while studying the solution space</p></li><li><p>Implementing the ideas at scale to show they’re effective</p></li></ul><p>Cloudflare’s massive popularity puts us in a very privileged position. We can research, implement and deploy experiments at a scale that simply can’t be done by most organizations. This makes Cloudflare an attractive research partner for universities and other research institutions who have domain knowledge but not data. We rely on our own expertise along with that of peers in both academia and industry to decide which problems to tackle in order to achieve common goals and make new scientific progress. Our <a href="/monsters-in-the-middleboxes/">middlebox detection project</a>, proposed by researchers at the University of Michigan, is an example of such a problem.</p><p>We’re not purists who are only interested in pursuing our own ideas. Some interesting problems have already been solved, but the solution isn’t widely known or implemented. In this situation, we contribute our efforts to help elevate the best ideas and make them available to the public in an accessible way. Our early work popularizing <a href="/a-relatively-easy-to-understand-primer-on-elliptic-curve-cryptography/">elliptic curves</a> on <a href="/ecdsa-the-digital-signature-algorithm-of-a-better-internet/">the Internet</a> is such an example.</p><p>Popularizing an idea and implementing the idea at scale are two different things. Along with popularizing winning ideas, we want to ensure these ideas stick and provide benefits to Internet users. To promote the widespread deployment of useful ideas, we work on standards and deploy newly emerging standards early on. Doing so helps the industry easily adopt innovations and supports interoperability. For example, the work done for Crypto Week 2019 has helped the development of international technical standards. Aspects of the League of Entropy are <a href="https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature-00">now being standardized</a> at the <a href="https://irtf.org/cfrg">CFRG</a>, Roughtime is now <a href="https://tools.ietf.org/html/draft-roughtime-aanchal-03">being considered for adoption</a> as an IETF standard, and we are presenting our post-quantum results as part of NIST’s <a href="https://csrc.nist.gov/Projects/Post-Quantum-Cryptography/Post-Quantum-Cryptography-Standardization">post-quantum cryptography standardization effort</a>.</p><p>Open source software is another key aspect of scaling the implementation of an idea. We <a href="https://github.com/cloudflare/circl">open source</a> associated code whenever possible. The research team collaborates with the wider research world as well as internally with other teams at Cloudflare.</p>
    <div>
      <h2>Focus areas going forward</h2>
      <a href="#focus-areas-going-forward">
        
      </a>
    </div>
    <p>Doing research, sharing it in an accessible way, working with top experts to validate it, and working on standardization has several benefits. It provides an opportunity to educate the public, further scientific understanding, and improve the state of the art; but it’s also a great way to attract candidates. Great engineers want to work on interesting projects and great researchers want to see their work have an impact. This hybrid research approach is attractive to both types of candidates.</p><p>Computer science is a vast arena, so the areas we’re currently focusing on are:</p><ul><li><p>Security and privacy</p></li><li><p>Cryptography</p></li><li><p>Internet measurement</p></li><li><p>Low-level networking and operating systems</p></li><li><p>Emerging networking paradigms</p></li></ul><p>Here are some highlights of publications we’ve co-authored over the last few years in these areas. We’ll be building on this tradition going forward.</p><ul><li><p><a href="https://dl.acm.org/citation.cfm?id=2995314">Attacking White-Box AES Constructions</a>. Created during investigations into protecting keys in untrusted locations.</p></li><li><p><a href="https://www.petsymposium.org/2018/files/papers/issue3/popets-2018-0026.pdf">Privacy Pass</a>. Arose from <a href="/cloudflare-supports-privacy-pass/">discussions</a> around reducing CAPTCHA friction without reducing site protection.</p></li><li><p><a href="https://dl.acm.org/citation.cfm?id=3278543">Is the Web Ready for OCSP Must-Staple?</a> Arose during the development of <a href="/high-reliability-ocsp-stapling/">high-availability OCSP stapling</a>.</p></li><li><p><a href="https://arxiv.org/abs/1905.13737">Protocols for Checking Compromised Credentials</a>. Work that came out of collaborations with <a href="https://haveibeenpwned.com/">Have I Been Pwned</a>.</p></li><li><p><a href="https://jhalderm.com/pub/papers/interception-ndss17.pdf">The Security Impact of HTTPS Interception</a>. Came about when exploring the end-to-end security of customer connections and discussing with researchers interested in the same topic. Resulted in <a href="/monsters-in-the-middleboxes/">MALCOLM</a>.</p></li><li><p><a href="https://ieeexplore.ieee.org/abstract/document/8406612/">In search of CurveSwap: Measuring elliptic curve implementations in the wild</a>. New attack devised when analyzing TLS 1.2 vulnerabilities.</p></li><li><p><a href="https://ai.google/research/pubs/pub47551">Does Certificate Transparency Break the Web? Measuring Adoption and Error Rate</a>. Partly motivated by the difficulty of running <a href="/introducing-certificate-transparency-and-nimbus/">Nimbus</a>.</p></li></ul><p>And by the way, we’re hiring!</p><p><a href="https://boards.greenhouse.io/cloudflare/jobs/1744503"><b>Product Management</b></a>Help the research team explore the future of peer-to-peer systems by building and managing projects like the <a href="https://developers.cloudflare.com/distributed-web/">Distributed Web Gateway</a>.</p><p><a href="https://www.cloudflare.com/careers/jobs/?department=Engineering"><b>Engineering</b></a>Engineering Manager (<a href="https://boards.greenhouse.io/cloudflare/jobs/1861694">San Francisco</a>, <a href="https://boards.greenhouse.io/cloudflare/jobs/1346216">London</a>)Systems Engineer - Cryptography Research (<a href="https://boards.greenhouse.io/cloudflare/jobs/634967">San Francisco</a>)Cryptography Research Engineer Internship (<a href="https://boards.greenhouse.io/cloudflare/jobs/608495">San Francisco</a>, <a href="https://boards.greenhouse.io/cloudflare/jobs/1025810">London</a>)</p><p>If none of these fit you perfectly, but you still want to reach out, send us an email at: <a href="/cloudflares-approach-to-research/research@cloudflare.com">ask-research@cloudflare.com</a>.</p> ]]></content:encoded>
            <category><![CDATA[Cryptography]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Research]]></category>
            <guid isPermaLink="false">4iB150QzhKAoKOvXt91ON7</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[How Cloudflare and Wall Street Are Helping Encrypt the Internet Today]]></title>
            <link>https://blog.cloudflare.com/how-cloudflare-and-wall-street-are-helping-encrypt-the-internet-today/</link>
            <pubDate>Fri, 13 Sep 2019 23:00:00 GMT</pubDate>
            <description><![CDATA[ Today has been a big day for Cloudflare, as we became a public company on the New York Stock Exchange (NYSE: NET). To mark the occasion, we decided to bring our favorite entropy machines to the floor of the NYSE. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Today has been a big day for Cloudflare, as we became a public company on the New York Stock Exchange (NYSE: NET). To mark the occasion, we decided to bring our favorite entropy machines to the floor of the NYSE. Footage of these lava lamps is being used as an additional seed to our <a href="/randomness-101-lavarand-in-production/"><b>entropy-generation system LavaRand</b></a> — bolstering Internet encryption for over 20 million Internet properties worldwide.</p><p><i>(This is mostly for fun. But when’s the last time you saw a lava lamp on the trading floor of the New York Stock Exchange?)</i></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2g2vH1hZmjN2EcjCIV8wfi/94702da9614d3dd97ddae35c5f8eeff8/NYSE-Lava-Lamps-Cropped.jpg" />
            
            </figure><p>A little context: generating truly random numbers using computers is impossible, because code is inherently deterministic (i.e. predictable). To compensate for this, engineers draw from pools of randomness created by entropy generators, which is a fancy term for "things that are truly unpredictable".</p><p>It turns out that lava lamps are fantastic sources of entropy, as was first shown by Silicon Graphics in the 1990s. It’s a torch we’ve been proud to carry forward: today, Cloudflare uses lava lamps to generate entropy that helps make millions of Internet properties more secure.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/ah3LRVUaM1zY6dND64ghZ/18ce5b07b000d6d951d97cc5753abe81/LavaRand1.png" />
            
            </figure><p>Housed in our San Francisco headquarters is a wall filled with dozens of lava lamps, undulating with mesmerizing randomness. We capture these lava lamps on video via a camera mounted across the room, and feed the resulting footage into an algorithm — called <a href="/lavarand-in-production-the-nitty-gritty-technical-details/"><b>LavaRand</b></a> — that amplifies the pure randomness of these lava lamps to dizzying extremes (computers can't create seeds of pure randomness, but they can massively amplify them).</p><p>Shortly before we rang the opening bell this morning, we recorded footage of our lava lamps in operation on the trading room floor of the New York Stock Exchange, and we're ingesting the footage into our LavaRand system. The resulting entropy is mixed with the myriad additional sources of entropy that we leverage every day, creating a cryptographically-secure source of randomness — fortified by Wall Street.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2i4n94z75iXaoZZFgXxg7y/f8cb4be9c50b4b4ff48b3f3aff354ff7/League-Of-Entropy.png" />
            
            </figure><p>We recently took our enthusiasm for randomness a step further by facilitating the <a href="/league-of-entropy/"><b>League of Entropy</b></a>, a consortium of global organizations and individual contributors, generating verifiable randomness via a globally distributed network. As one of the founding members of the League, LavaRand (pictured above) plays a key role in empowering developers worldwide with a pool of randomness with extreme entropy and high reliability.</p><p>And today, she’s enjoying the view from the podium!</p><hr /><p><i>One caveat: the lava lamps we run in our San Francisco headquarters are recorded in real-time, 24/7, giving us an ongoing stream of entropy. For reasons that are understandable, the NYSE doesn't allow for live video feeds from the exchange floor while it is in operation. But this morning they did let us record footage of the lava lamps operating shortly before the opening bell. The video was recorded and we're ingesting it into our LavaRand system (alongside many other entropy generators, including the lava lamps back in San Francisco).</i></p> ]]></content:encoded>
            <category><![CDATA[LavaRand]]></category>
            <category><![CDATA[Entropy]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Encryption]]></category>
            <guid isPermaLink="false">5cmkZ6Tia2iUD2yBBnQAOb</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Welcome to Crypto Week 2019]]></title>
            <link>https://blog.cloudflare.com/welcome-to-crypto-week-2019/</link>
            <pubDate>Sun, 16 Jun 2019 17:07:57 GMT</pubDate>
            <description><![CDATA[ The Internet is an extraordinarily complex and evolving ecosystem. Its constituent protocols range from the ancient and archaic (hello FTP) to the modern and sleek (meet WireGuard), with a fair bit of everything in between.  ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/15NFCZdp2cpRHNfys7tpAq/15487537909975789f358f467d314eb0/image21.png" />
            
            </figure><p>The Internet is an extraordinarily complex and evolving ecosystem. Its constituent protocols range from the ancient and archaic (hello <a href="https://developers.cloudflare.com/spectrum/getting-started/ftp/">FTP</a>) to the modern and sleek (meet <a href="/boringtun-userspace-wireguard-rust/">WireGuard</a>), with a fair bit of everything in between. This evolution is ongoing, and as one of the <a href="https://bgp.he.net/report/exchanges#_participants">most connected</a> networks on the Internet, Cloudflare has a duty to be a good steward of this ecosystem. We take this responsibility to heart: Cloudflare’s mission is to help build a better Internet. In this spirit, we are very proud to announce Crypto Week 2019.</p><p>Every day this week we’ll announce a new project or service that uses modern cryptography to build a more secure, trustworthy Internet. Everything we release this week will be free and immediately useful. This blog is a fun exploration of the themes of the week.</p><ul><li><p>Monday: <a href="/league-of-entropy/"><b>The League of Entropy</b></a><b>, </b><a href="/inside-the-entropy/"><b>Inside the Entropy</b></a></p></li><li><p>Tuesday: <a href="/secure-certificate-issuance/"><b>Securing Certificate Issuance using Multipath Domain Control Validation</b></a></p></li><li><p>Wednesday: <a href="/cloudflare-ethereum-gateway/"><b>Cloudflare's Ethereum Gateway</b></a><b>, </b><a href="/continuing-to-improve-our-ipfs-gateway/"><b>Continuing to Improve our IPFS Gateway</b></a></p></li><li><p>Thursday: <a href="/the-quantum-menace/"><b>The Quantum Menace</b></a>, <a href="/towards-post-quantum-cryptography-in-tls/"><b>Towards Post-Quantum Cryptography in TLS</b></a>, <a href="/introducing-circl/"><b>Introducing CIRCL: An Advanced Cryptographic Library</b></a></p></li><li><p>Friday: <a href="/secure-time/"><b>Introducing time.cloudflare.com</b></a></p></li></ul>
    <div>
      <h3>The Internet of the Future</h3>
      <a href="#the-internet-of-the-future">
        
      </a>
    </div>
    <p>Many pieces of the Internet in use today were designed in a different era with different assumptions. The Internet’s success is based on strong foundations that support constant reassessment and improvement. Sometimes these improvements require deploying new protocols.</p><p>Performing an upgrade on a system as large and decentralized as the Internet can’t be done by decree;</p><ul><li><p>There are too many economic, cultural, political, and technological factors at play.</p></li><li><p>Changes must be compatible with existing systems and protocols to even be considered for adoption.</p></li><li><p>To gain traction, new protocols must provide tangible improvements for users. Nobody wants to install an update that doesn’t improve their experience!</p></li></ul><p><b>The last time the Internet had a complete reboot and upgrade</b> was during <a href="https://www.internetsociety.org/blog/2016/09/final-report-on-tcpip-migration-in-1983/">TCP/IP flag day</a> <b>in 1983</b>. Back then, the Internet (called ARPANET) had fewer than ten thousand hosts! To have an Internet-wide flag day today to switch over to a core new protocol is inconceivable; the scale and diversity of the components involved is way too massive. Too much would break. It’s challenging enough to deprecate <a href="https://dnsflagday.net/2019/">outmoded functionality</a>. In some ways, the open Internet is a victim of its own success. The bigger a system grows and the longer it stays the same, the <a href="/why-tls-1-3-isnt-in-browsers-yet/">harder it is to change</a>. The Internet is like a massive barge: it takes forever to steer in a different direction and it’s carrying a lot of garbage.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5qyclW7jXghND7AAOoygOv/483e2764aa861229b7487235355208b0/image16.jpg" />
            
            </figure><p>ARPANET, 1983 (<a href="https://www.computerhistory.org/internethistory/1980s/">Computer History Museum</a>)</p><p>As you would expect, many of the warts of the early Internet still remain. Both academic security researchers and real-life adversaries are still finding and exploiting vulnerabilities in the system. Many vulnerabilities are due to the fact that most of the protocols in use on the Internet have a weak notion of trust inherited from the early days. With 50 hosts online, it’s relatively easy to trust everyone, but in a world-scale system, that trust breaks down in fascinating ways. The primary tool to scale trust is cryptography, which helps provide some measure of accountability, though it has its own complexities.</p><p>In an ideal world, the Internet would provide a trustworthy substrate for human communication and commerce. Some people naïvely assume that this is the natural direction the evolution of the Internet will follow. However, constant improvement is not a given. <b>It’s possible that the Internet of the future will actually be</b> <b><i>worse</i></b> <b>than the Internet today: less open, less secure, less private, less</b> <b><i>trustworthy</i></b><b>.</b> There are strong incentives to weaken the Internet on a fundamental level by <a href="https://www.ispreview.co.uk/index.php/2019/04/google-uk-isps-and-gov-battle-over-encrypted-dns-and-censorship.html">Governments</a>, by businesses <a href="https://www.theatlantic.com/technology/archive/2017/03/encryption-wont-stop-your-internet-provider-from-spying-on-you/521208/">such as ISPs</a>, and even by the <a href="https://www.cyberscoop.com/tls-1-3-weakness-financial-industry-ietf/">financial institutions</a> entrusted with our personal data.</p><p>In a system with as many stakeholders as the Internet, <b>real change requires principled commitment from all invested parties.</b> At Cloudflare, we believe everyone is entitled to an Internet built on a solid foundation of trust. <b>Crypto Week</b> is our way of helping nudge the Internet’s evolution in a more trust-oriented direction. Each announcement this week helps bring the Internet of the future to the present in a tangible way.</p>
    <div>
      <h3>Ongoing Internet Upgrades</h3>
      <a href="#ongoing-internet-upgrades">
        
      </a>
    </div>
    <p>Before we explore the Internet of the future, let’s explore some of the previous and ongoing attempts to upgrade the Internet’s fundamental protocols.</p>
    <div>
      <h4>Routing Security</h4>
      <a href="#routing-security">
        
      </a>
    </div>
    <p>As we highlighted in <a href="/crypto-week-2018/">last year’s Crypto Week</a> <b>one of the weak links on the Internet is routing</b>. Not all networks are directly connected.</p><p>To send data from one place to another, <b>you might have to rely on intermediary networks to pass your data along.</b> A packet sent from one host to another <b>may have to be passed through up to a dozen of these intermediary networks.</b> <i>No single network knows the full path the data will have to take to get to its destination, it only knows which network to pass it to next.</i>  <b>The protocol that determines how packets are routed is called the</b> <a href="https://www.cloudflare.com/learning/security/glossary/what-is-bgp/"><b>Border Gateway Protocol (BGP.)</b></a> Generally speaking, networks use BGP to announce to each other which addresses they know how to route packets for and (dependent on a set of complex rules) these networks share what they learn with their neighbors.</p><p>Unfortunately, <b>BGP is completely insecure:</b></p><ul><li><p><b>Any network can announce any set of addresses to any other network,</b> even addresses they don’t control. This leads to a phenomenon called <i>BGP hijacking</i>, where networks are tricked into sending data to the wrong network.</p></li><li><p><b>A BGP hijack</b> is most often caused by accidental misconfiguration, but <b>can also be the result of malice on the network operator’s part</b>.</p></li><li><p><b>During a BGP hijack, a network inappropriately announces a set of addresses to other networks</b>, which results in packets destined for the announced addresses to be routed through the illegitimate network.</p></li></ul>
    <div>
      <h4>Understanding the risk</h4>
      <a href="#understanding-the-risk">
        
      </a>
    </div>
    <p>If the packets represent unencrypted data, this can be a big problem as it <b>allows the hijacker to read or even change the data:</b></p><ul><li><p>In 2018, a rogue network <a href="/bgp-leaks-and-crypto-currencies/">hijacked the addresses of a service called MyEtherWallet</a>, financial transactions were routed through the attacker network, which the attacker modified, <b>resulting in the theft of over a hundred thousand dollars of cryptocurrency.</b></p></li></ul>
    <div>
      <h4>Mitigating the risk</h4>
      <a href="#mitigating-the-risk">
        
      </a>
    </div>
    <p>The <a href="/tag/rpki/">Resource Public Key Infrastructure (RPKI)</a> system helps bring some trust to BGP by <b>enabling networks to utilize cryptography to digitally sign network routes with certificates, making BGP hijacking much more difficult.</b></p><ul><li><p>This enables participants of the network to gain assurances about the authenticity of route advertisements. <a href="/introducing-certificate-transparency-and-nimbus/">Certificate Transparency</a> (CT) is a tool that enables additional trust for certificate-based systems. Cloudflare operates the <a href="https://ct.cloudflare.com/logs/cirrus">Cirrus CT log</a> to support RPKI.</p></li></ul><p>Since we announced our support of RPKI last year, routing security has made big strides. More routes are signed, more networks validate RPKI, and the <a href="https://github.com/cloudflare/cfrpki">software ecosystem has matured</a>, but this work is not complete. Most networks are still vulnerable to BGP hijacking. For example, <a href="https://www.cnet.com/news/how-pakistan-knocked-youtube-offline-and-how-to-make-sure-it-never-happens-again/">Pakistan knocked YouTube offline with a BGP hijack</a> back in 2008, and could likely do the same today. Adoption here is driven less by providing a benefit to users, but rather by reducing systemic risk, which is not the strongest motivating factor for adopting a complex new technology. Full routing security on the Internet could take decades.</p>
    <div>
      <h3>DNS Security</h3>
      <a href="#dns-security">
        
      </a>
    </div>
    <p>The <a href="https://www.cloudflare.com/learning/dns/what-is-dns/">Domain Name System (DNS)</a> is the phone book of the Internet. Or, for anyone under 25 who doesn’t remember phone books, it’s the system that takes hostnames (like cloudflare.com or facebook.com) and returns the Internet address where that host can be found. For example, as of this publication, <a href="http://www.cloudflare.com">www.cloudflare.com</a> is 104.17.209.9 and 104.17.210.9 (IPv4) and 2606:4700::c629:d7a2, 2606:4700::c629:d6a2 (IPv6). Like BGP, <b>DNS is completely insecure. Queries and responses sent unencrypted over the Internet are modifiable by anyone on the path.</b></p><p>There are many ongoing attempts to add security to DNS, such as:</p><ul><li><p><a href="https://www.cloudflare.com/learning/dns/dnssec/ecdsa-and-dnssec/">DNSSEC</a> that <b>adds a chain of digital signatures to DNS responses</b></p></li><li><p>DoT/DoH that <b>wraps DNS queries in the TLS encryption protocol</b> (more on that later)</p></li></ul><p>Both technologies are slowly gaining adoption, but have a long way to go.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1dE9CBbFXOXM7eXg22tDnr/d5aac38c166f0b58eccaddaf77cf0c8d/DNSSEC-adoption-over-time-1.png" />
            
            </figure><p>DNSSEC-signed responses served by Cloudflare</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/186wxeg2yS6VN7fRqMeBS6/cd8261cbee791770fdbdde5b8e856974/DoT_DoH.png" />
            
            </figure><p>Cloudflare’s 1.1.1.1 resolver queries are already over 5% DoT/DoH</p><p>Just like RPKI, <b>securing DNS comes with a performance cost,</b> making it less attractive to users. However,</p><ul><li><p><b>Services like 1.1.1.1 provide</b> <a href="https://www.dnsperf.com/dns-provider/cloudflare"><b>extremely fast DNS</b></a>, which means that for many users, <a href="https://blog.mozilla.org/futurereleases/2019/04/02/dns-over-https-doh-update-recent-testing-results-and-next-steps/">encrypted DNS is faster than the unencrypted DNS</a> from their ISP.</p></li><li><p>This <b>performance improvement makes it appealing for customers</b> of privacy-conscious applications, like Firefox and Cloudflare’s 1.1.1.1 app, to adopt secure DNS.</p></li></ul>
    <div>
      <h3>The Web</h3>
      <a href="#the-web">
        
      </a>
    </div>
    <p><b>Transport Layer Security (TLS)</b> is a cryptographic protocol that gives two parties the ability to communicate over an encrypted and authenticated channel**.** <b>TLS protects communications from eavesdroppers even in the event of a BGP hijack.</b> TLS is what puts the “S” in <b>HTTPS</b>. TLS protects web browsing against multiple types of network adversaries.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6SY5pZINknbDszMPvOf77c/84fb41510e25717243e5ff06d631eeb3/past-connection-1.png" />
            
            </figure><p>Requests hop from network to network over the Internet</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2SrnXAdMqSONKHaYJVarm7/5b3a59fd2159f3d19704cf267dc30cc0/MITM-past-copy-2.png" />
            
            </figure><p>For unauthenticated protocols, an attacker on the path can impersonate the server</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/H8ticQEIC5ebrX7WXsmPW/23e71675bd585233362bd62d9f6840e4/BGP-hijack-past-1.png" />
            
            </figure><p>Attackers can use BGP hijacking to change the path so that communication can be intercepted</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4gg6sYN8sqXSKeTPETI4b0/347ddfea0a9de130aa69726f1dd870da/PKI-validated-connectio-1.png" />
            
            </figure><p>Authenticated protocols are protected from interception attacks</p><p>The adoption of TLS on the web is partially driven by the fact that:</p><ul><li><p><b>It’s easy and free for websites to get an authentication certificate</b> (via <a href="https://letsencrypt.org/">Let’s Encrypt</a>, <a href="/introducing-universal-ssl/">Universal SSL</a>, etc.)</p></li><li><p>Browsers make TLS adoption appealing to website operators by <b>only supporting new web features such as HTTP/2 over HTTPS.</b></p></li></ul><p>This has led to the rapid adoption of HTTPS over the last five years.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/78UVeYpDvOgQp0CQIyb20R/97d29db95d234771da008b5f83dfc7dc/image12.jpg" />
            
            </figure><p>HTTPS adoption curve (<a href="https://transparencyreport.google.com/https/overview">from Google Chrome</a>)‌‌</p><p>To further that adoption, TLS recently got an upgrade in TLS 1.3, <b>making it faster </b><i><b>and</b></i><b> more secure (a combination we love)</b>. It’s taking over the Internet!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1NFORFUn1FFn10RTJ5HUCS/a21ff9ea0eaa41916107fa9522b13f38/tls.13-adoption-1.png" />
            
            </figure><p>TLS 1.3 adoption over the last 12 months (from Cloudflare's perspective)</p><p>Despite this fantastic progress in the adoption of security for routing, DNS, and the web, <b>there are still gaps in the trust model of the Internet.</b> There are other things needed to help build the Internet of the future. To find and identify these gaps, we lean on research experts.</p>
    <div>
      <h3>Research Farm to Table</h3>
      <a href="#research-farm-to-table">
        
      </a>
    </div>
    <p>Cryptographic security on the Internet is a hot topic and there have been many flaws and issues recently pointed out in academic journals. Researchers often <b>study the vulnerabilities of the past and ask:</b></p><ul><li><p>What other critical components of the Internet have the same flaws?</p></li><li><p>What underlying assumptions can subvert trust in these existing systems?</p></li></ul><p>The answers to these questions help us decide what to tackle next. Some recent research  topics we’ve learned about include:</p><ul><li><p>Quantum Computing</p></li><li><p>Attacks on Time Synchronization</p></li><li><p>DNS attacks affecting Certificate issuance</p></li><li><p>Scaling distributed trust</p></li></ul><p>Cloudflare keeps abreast of these developments and we do what we can to bring these new ideas to the Internet at large. In this respect, we’re truly standing on the shoulders of giants.</p>
    <div>
      <h3>Future-proofing Internet Cryptography</h3>
      <a href="#future-proofing-internet-cryptography">
        
      </a>
    </div>
    <p>The new protocols we are currently deploying (RPKI, DNSSEC, DoT/DoH, TLS 1.3) use relatively modern cryptographic algorithms published in the 1970s and 1980s.</p><ul><li><p>The security of these algorithms is based on hard mathematical problems in the field of number theory, such as <a href="https://en.wikipedia.org/wiki/RSA_(cryptosystem)">factoring</a> and the <a href="/a-relatively-easy-to-understand-primer-on-elliptic-curve-cryptography/">elliptic curve discrete logarithm</a> problem.</p></li><li><p>If you can solve the hard problem, you can crack the code. <b>Using a bigger key makes the problem harder,</b> making it more difficult to break, <b>but also slows performance.</b></p></li></ul><p>Modern Internet protocols typically pick keys large enough to make it infeasible to break with <a href="https://whatis.techtarget.com/definition/classical-computing">classical computers</a>, but no larger. <b>The sweet spot is around 128-bits of security;</b> <b>meaning a computer has to do approximately 2</b>¹²⁸ <b>operations to break it.</b></p><p><a href="https://eprint.iacr.org/2013/635.pdf">Arjen Lenstra and others</a> created a useful measure of security levels by <b>comparing the amount of energy it takes to break a key to the amount of water you can boil</b> using that much energy. You can think of this as the electric bill you’d get if you run a computer long enough to crack the key.</p><ul><li><p><b>35-bit security</b> <b>is “Teaspoon security”</b> -- It takes about the same amount of energy to break a 35-bit key as it does to boil a teaspoon of water (pretty easy).</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2iNGrNB4yH2iwZY14nQyWB/7bdf9a8e1874fe0444f532823e22fcd3/image20.png" />
            
            </figure><ul><li><p><b>65 bits gets you up to “Pool security” –</b> The energy needed to boil the average amount of water in a swimming pool.</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1xzgnzDf3dwHcNWdTfAyeC/de62077e9a936e937a78c2dbc4874ece/image8.png" />
            
            </figure><ul><li><p><b>105 bits is “Sea Security”</b> – The energy needed to boil the Mediterranean Sea.</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5CYdmr4aGJ67Wq0j9t3iXR/2df460cc061c0c747ab66be9a866beed/8reIkbszxaKMxOsDDEzOB4ljqnVtQdJBQsYEz-uL-AZnNL0jUKSd4CbSAz-yS9tvpi_ki1JoYZ_-ZktMSbqRtDSVFMjHvsyBtgmc2rPuiDr9b-Fj6DvEJvLF7tWP.png" />
            
            </figure><ul><li><p><b>114-bits is “Global Security” –</b>  The energy needed to boil all water on Earth.</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/58XtfEmY4rpTkx7Y71AnDW/b1b31eaf34b318cc83bdcad3c20d85ff/image14.png" />
            
            </figure><ul><li><p><b>128-bit security is safely beyond that</b> <b>of Global Security</b> – Anything larger is excessive.</p></li><li><p><b>256-bit security corresponds to “Universal Security”</b> – The estimated mass-energy of the observable universe. So, if you ever hear someone suggest 256-bit AES, you know they mean business.</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5oWF3OLLr5WVWIga7mMGf8/d21426fe5df41b9c85bc6b8eca2e4331/image18.png" />
            
            </figure>
    <div>
      <h3>Post-Quantum of Solace</h3>
      <a href="#post-quantum-of-solace">
        
      </a>
    </div>
    <p>As far as we know, <b>the algorithms we use for cryptography are functionally uncrackable</b> with all known algorithms that classical computers can run. <b>Quantum computers change this calculus.</b> Instead of transistors and bits, a quantum computer uses the effects of <a href="https://en.wikipedia.org/wiki/Quantum_entanglement">quantum mechanics</a> to perform calculations that just aren’t possible with classical computers. As you can imagine, quantum computers are very difficult to build. However, despite large-scale quantum computers not existing quite yet, computer scientists have already developed algorithms that can only run efficiently on quantum computers. Surprisingly, it turns out that <b>with a sufficiently powerful quantum computer, most of the hard mathematical problems we rely on for Internet security become easy!</b></p><p>Although there are still <a href="https://www.quantamagazine.org/gil-kalais-argument-against-quantum-computers-20180207/">quantum-skeptics</a> out there, <a href="http://fortune.com/2018/12/15/quantum-computer-security-encryption/">some experts</a> <b>estimate that within 15-30 years these large quantum computers will exist, which poses a risk to every security protocol online.</b> Progress is moving quickly; every few months a more powerful quantum computer <a href="https://en.wikipedia.org/wiki/Timeline_of_quantum_computing">is announced</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/281v5SkqTn89jPkEnFjkPE/587423b66380be1051c67f2f17263e69/image1-2.png" />
            
            </figure><p>Luckily, there are cryptography algorithms that rely on different hard math problems that seem to be resistant to attack from quantum computers. These math problems form the basis of so-called <i>quantum-resistant</i> (or <i>post-quantum</i>) cryptography algorithms that can run on classical computers. These algorithms can be used as substitutes for most of our current quantum-vulnerable algorithms.</p><ul><li><p>Some quantum-resistant algorithms (such as <a href="https://en.wikipedia.org/wiki/McEliece_cryptosystem">McEliece</a> and <a href="https://en.wikipedia.org/wiki/Lamport_signature">Lamport Signatures</a>) were invented decades ago, but there’s a reason they aren’t in common use: they <b>lack some of the nice properties of the algorithms we’re currently using, such as key size and efficiency.</b></p></li><li><p>Some quantum-resistant algorithms <b>require much larger keys to provide 128-bit security</b></p></li><li><p>Some are very <b>CPU intensive</b>,</p></li><li><p>And some just <b>haven’t been studied enough to know if they’re secure.</b></p></li></ul><p>It is possible to swap our current set of quantum-vulnerable algorithms with new quantum-resistant algorithms, but it’s a daunting engineering task. With widely deployed <a href="https://en.wikipedia.org/wiki/IPsec">protocols</a>, it is hard to make the transition from something fast and small to something slower, bigger or more complicated without providing concrete user benefits. <b>When exploring new quantum-resistant algorithms, minimizing user impact is of utmost importance</b> to encourage adoption. This is a big deal, because almost all the protocols we use to protect the Internet are vulnerable to quantum computers.</p><p>Cryptography-breaking quantum computing is still in the distant future, but we must start the transition to ensure that today’s secure communications are safe from tomorrow’s quantum-powered onlookers; however, that’s not the most <i>timely</i> problem with the Internet. We haven’t addressed that...yet.</p>
    <div>
      <h3>Attacking time</h3>
      <a href="#attacking-time">
        
      </a>
    </div>
    <p>Just like DNS, BGP, and HTTP, <b>the Network Time Protocol (NTP) is fundamental to how the Internet works</b>. And like these other protocols, it is <b>completely insecure</b>.</p><ul><li><p>Last year, <b>Cloudflare introduced</b> <a href="/roughtime/"><b>Roughtime</b></a> support as a mechanism for computers to access the current time from a trusted server in an authenticated way.</p></li><li><p>Roughtime is powerful because it <b>provides a way to distribute trust among multiple time servers</b> so that if one server attempts to lie about the time, it will be caught.</p></li></ul><p>However, Roughtime is not exactly a secure drop-in replacement for NTP.</p><ul><li><p><b>Roughtime lacks the complex mechanisms of NTP</b> that allow it to compensate for network latency and yet maintain precise time, especially if the time servers are remote. This leads to <b>imprecise time</b>.</p></li><li><p>Roughtime also <b>involves expensive cryptography that can further reduce precision</b>. This lack of precision makes Roughtime useful for browsers and other systems that need coarse time to validate certificates (most certificates are valid for 3 months or more), but some systems (such as those used for financial trading) require precision to the millisecond or below.</p></li></ul><p>With Roughtime we supported the time protocol of the future, but there are things we can do to help improve the health of security online <i>today</i>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/76dqfHQzRcGyA09D55f46W/35be1f73c91f7d4e128b9582638b80ab/image2-3.png" />
            
            </figure><p>Some academic researchers, including Aanchal Malhotra of Boston University, have <a href="https://www.cs.bu.edu/~goldbe/NTPattack.html">demonstrated</a> a variety of attacks against NTP, including <b>BGP hijacking and off-path User Datagram Protocol (UDP) attacks.</b></p><ul><li><p>Some of these attacks can be avoided by connecting to an NTP server that is close to you on the Internet.</p></li><li><p>However, to bring cryptographic trust to time while maintaining precision, we need something in between NTP and Roughtime.</p></li><li><p>To solve this, it’s natural to turn to the same system of trust that enabled us to patch HTTP and DNS: Web PKI.</p></li></ul>
    <div>
      <h3>Attacking the Web PKI</h3>
      <a href="#attacking-the-web-pki">
        
      </a>
    </div>
    <p>The Web PKI is similar to the RPKI, but is more widely visible since it relates to websites rather than routing tables.</p><ul><li><p>If you’ve ever clicked the lock icon on your browser’s address bar, you’ve interacted with it.</p></li><li><p>The PKI relies on a set of trusted organizations called Certificate Authorities (CAs) to issue certificates to websites and web services.</p></li><li><p>Websites use these certificates to authenticate themselves to clients as <a href="https://www.cloudflare.com/learning/ssl/transport-layer-security-tls/">part of the TLS protocol</a> in HTTPS.</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/wzqfOvaCcj0TCr3ezbOY3/f87fc64402bee2de14b4c4ba5d0b93bb/pki-validated.png" />
            
            </figure><p>TLS provides encryption and integrity from the client to the server with the help of a digital certificate </p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1bOHTpPBXfi0VeYoJikyfD/cbc3e67f2294e322436a5b542bb3644e/attack-against-PKI-validated-connectio-2.png" />
            
            </figure><p>TLS connections are safe against MITM, because the client doesn’t trust the attacker’s certificate</p><p>While we were all patting ourselves on the back for moving the web to HTTPS, <a href="https://dl.acm.org/citation.cfm?id=3243790">some</a> <a href="https://www.princeton.edu/~pmittal/publications/bgp-tls-usenix18.pdf">researchers</a> managed to find and exploit <b>a weakness in the system: the process for getting HTTPS certificates.</b></p><p>Certificate Authorities (CAs) use a process called <b>domain control validation (DCV) to ensure that they only issue certificates to websites owners who legitimately request them.</b></p><ul><li><p>Some CAs do this validation manually, which is secure, but <b>can’t scale to the total number of websites deployed today.</b></p></li><li><p>More progressive CAs have <b>automated this validation process, but rely on insecure methods</b> (HTTP and DNS) to validate domain ownership.</p></li></ul><p>Without ubiquitous cryptography in place (DNSSEC may never reach 100% deployment), there is <b>no completely secure way to bootstrap this system</b>. So, let’s look at how to distribute trust using other methods.</p><p><b>One tool at our disposal is the distributed nature of the Cloudflare network.</b></p><p>Cloudflare is global. We have locations all over the world connected to dozens of networks. That means we have different <i>vantage points</i>, resulting in different ways to traverse networks. This diversity can prove an advantage when dealing with BGP hijacking, since <b>an attacker would have to hijack multiple routes from multiple locations to affect all the traffic between Cloudflare and other distributed parts of the Internet.</b> The natural diversity of the network raises the cost of the attacks.</p><p>A distributed set of connections to the Internet and using them as a quorum is a mighty paradigm to distribute trust, with or without cryptography.</p>
    <div>
      <h3>Distributed Trust</h3>
      <a href="#distributed-trust">
        
      </a>
    </div>
    <p>This idea of distributing the source of trust is powerful. Last year we announced the <b>Distributed Web Gateway</b> that</p><ul><li><p>Enables users to access content on the InterPlanetary File System (IPFS), a network structured to <b>reduce the trust placed in any single party.</b></p></li><li><p>Even if a participant of the network is compromised, <b>it can’t be used to distribute compromised content</b> because the network is content-addressed.</p></li><li><p>However, using content-based addressing is <b>not the only way to distribute trust between multiple independent parties.</b></p></li></ul><p>Another way to distribute trust is to literally <b>split authority between multiple independent parties</b>. <a href="/red-october-cloudflares-open-source-implementation-of-the-two-man-rule/">We’ve explored this topic before.</a> In the context of Internet services, this means ensuring that no single server can authenticate itself to a client on its own. For example,</p><ul><li><p>In HTTPS the server’s private key is the lynchpin of its security. Compromising the owner of the private key (by <a href="https://www.theguardian.com/world/2013/oct/03/lavabit-ladar-levison-fbi-encryption-keys-snowden">hook</a> or by <a href="https://www.symantec.com/connect/blogs/how-attackers-steal-private-keys-digital-certificates">crook</a>) <b>gives an attacker the ability to impersonate (spoof) that service</b>. This single point of failure <b>puts services at risk.</b> You can mitigate this risk by distributing the authority to authenticate the service between multiple independently-operated services.</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3wuX22HpjVAbiwcwEDojxB/df21a1462febcf64f1a613ab075a104a/TLS-server-compromise-1.png" />
            
            </figure><p>TLS doesn’t protect against server compromise</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/34nZukSMSjU2QDwNr5zkhf/dd5a6024a01c4dc0c6c6153e0205d91c/future-distributed-trust-copy-2-1.png" />
            
            </figure><p>With distributed trust, multiple parties combine to protect the connection</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/29B6lr8FV35nqA8Bw9TgtL/34fb894d8d74dc083424398f1e65e80f/future-distributed-trust.png" />
            
            </figure><p>An attacker that has compromised one of the servers cannot break the security of the system‌‌</p><p>The Internet barge is old and slow, and we’ve only been able to improve it through the meticulous process of patching it piece by piece. Another option is to build new secure systems on top of this insecure foundation. IPFS is doing this, and IPFS is not alone in its design. <b>There has been more research into secure systems with decentralized trust in the last ten years than ever before</b>.</p><p>The result is radical new protocols and designs that use exotic new algorithms. These protocols do not supplant those at the core of the Internet (like TCP/IP), but instead, they sit on top of the existing Internet infrastructure, enabling new applications, much like HTTP did for the web.</p>
    <div>
      <h3>Gaining Traction</h3>
      <a href="#gaining-traction">
        
      </a>
    </div>
    <p>Some of the most innovative technical projects were considered failures because <b>they couldn’t attract users.</b> New technology has to bring tangible benefits to users to sustain it: useful functionality, content, and a decent user experience. Distributed projects, such as IPFS and others, are gaining popularity, but have not found mass adoption. This is a chicken-and-egg problem. New protocols have a high barrier to entry**—<b>users have to install new software</b>—**and because of the small audience, there is less incentive to create compelling content. <b>Decentralization and distributed trust are nice security features to have, but they are not products</b>. Users still need to get some benefit out of using the platform.</p><p>An example of a system to break this cycle is the web. In 1992 the web was hardly a cornucopia of awesomeness. <b>What helped drive the dominance of the web was its users.</b></p><ul><li><p>The growth of the user base meant <b>more incentive for people to build services</b>, and the availability of more services attracted more users. It was a virtuous cycle.</p></li><li><p>It’s hard for a platform to gain momentum, but once the cycle starts, a flywheel effect kicks in to help the platform grow.</p></li></ul><p>The <a href="https://www.cloudflare.com/distributed-web-gateway/">Distributed Web Gateway</a> project Cloudflare launched last year in Crypto Week is our way of exploring what happens if we try to kickstart that flywheel. By providing a secure, reliable, and fast interface from the classic web with its two billion users to the content on the distributed web, we give the fledgling ecosystem an audience.</p><ul><li><p><b>If the advantages provided by building on the distributed web are appealing to users, then the larger audience will help these services grow in popularity</b>.</p></li><li><p>This is somewhat reminiscent of how IPv6 gained adoption. It started as a niche technology only accessible using IPv4-to-IPv6 translation services.</p></li><li><p>IPv6 adoption has now <a href="https://www.internetsociety.org/resources/2018/state-of-ipv6-deployment-2018/">grown so much</a> that it is becoming a requirement for new services. For example, <b>Apple is</b> <a href="https://developer.apple.com/support/ipv6/"><b>requiring</b></a> <b>that all apps work in IPv6-only contexts.</b></p></li></ul><p>Eventually, as user-side implementations of distributed web technologies improve, people may move to using the distributed web natively rather than through an HTTP gateway. Or they may not! By leveraging Cloudflare’s global network to <b>give users access to new technologies based on distributed trust, we give these technologies a better chance at gaining adoption.</b></p>
    <div>
      <h3>Happy Crypto Week</h3>
      <a href="#happy-crypto-week">
        
      </a>
    </div>
    <p>At Cloudflare, we always support new technologies that help make the Internet better. Part of helping make a better Internet is scaling the systems of trust that underpin web browsing and protect them from attack. We provide the tools to create better systems of assurance with fewer points of vulnerability. We work with academic researchers of security to get a vision of the future and engineer away vulnerabilities before they can become widespread. It’s a constant journey.</p><p>Cloudflare knows that none of this is possible without the work of researchers. From award-winning researcher publishing papers in top journals to the blog posts of clever hobbyists, dedicated and curious people are moving the state of knowledge of the world forward. However, the push to publish new and novel research sometimes holds researchers back from committing enough time and resources to fully realize their ideas. Great research can be powerful on its own, but it can have an even broader impact when combined with practical applications. We relish the opportunity to stand on the shoulders of these giants and use our engineering know-how and global reach to expand on their work to help build a better Internet.</p><p>So, to all of you dedicated researchers, <b>thank you for your work!</b> Crypto Week is yours as much as ours. If you’re working on something interesting and you want help to bring the results of your research to the broader Internet, please contact us at <a>ask-research@cloudflare.com</a>. We want to help you realize your dream of making the Internet safe and trustworthy.</p><p>If you're a research-oriented <a href="https://boards.greenhouse.io/cloudflare/jobs/1346216">engineering manager</a> or student, we're also hiring in <a href="https://boards.greenhouse.io/cloudflare/jobs/1025810">London</a> and <a href="https://boards.greenhouse.io/cloudflare/jobs/608495">San Francisco</a>!</p> ]]></content:encoded>
            <category><![CDATA[Crypto Week]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[BGP]]></category>
            <category><![CDATA[Cryptography]]></category>
            <category><![CDATA[RPKI]]></category>
            <category><![CDATA[DNS]]></category>
            <category><![CDATA[HTTPS]]></category>
            <guid isPermaLink="false">2Cs84t1yRSnIXcoIIszCGj</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Welcome to Crypto Week]]></title>
            <link>https://blog.cloudflare.com/crypto-week-2018/</link>
            <pubDate>Mon, 17 Sep 2018 13:00:00 GMT</pubDate>
            <description><![CDATA[ The Internet isn’t perfect. It was put together piecemeal through publicly funded research, private investment, and organic growth that has left us with an imperfect tapestry. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>The Internet is an amazing invention. We marvel at how it connects people, connects ideas, and makes the world smaller. But the Internet isn’t perfect. It was put together piecemeal through publicly funded research, private investment, and organic growth that has left us with an imperfect tapestry. It’s also evolving. People are constantly developing creative applications and finding new uses for existing Internet technology. Issues like privacy and security that were afterthoughts in the early days of the Internet are now supremely important. People are being tracked and monetized, websites and web services are being attacked in interesting new ways, and the fundamental system of trust the Internet is built on is showing signs of age. The Internet needs an upgrade, and one of the tools that can make things better is cryptography.</p><p>Every day this week, Cloudflare will be announcing support for a new technology that uses cryptography to make the Internet better (hint: <a href="/subscribe/">subscribe to the blog</a> to make sure you don't miss any of the news). Everything we are announcing this week is free to use and provides a meaningful step towards supporting a new capability or structural reinforcement. So why are we doing this? Because it’s good for the users and good for the Internet. Welcome to Crypto Week!</p>
    <div>
      <h3>Day 1: Distributed Web Gateway</h3>
      <a href="#day-1-distributed-web-gateway">
        
      </a>
    </div>
    <ul><li><p><a href="/distributed-web-gateway/">Cloudflare goes InterPlanetary - Introducing Cloudflare’s IPFS Gateway</a></p></li><li><p><a href="/e2e-integrity/">End-to-End Integrity with IPFS</a></p></li></ul>
    <div>
      <h3>Day 2: DNSSEC</h3>
      <a href="#day-2-dnssec">
        
      </a>
    </div>
    <ul><li><p><a href="/automatically-provision-and-maintain-dnssec/">Expanding DNSSEC Adoption</a></p></li></ul>
    <div>
      <h3>Day 3: RPKI</h3>
      <a href="#day-3-rpki">
        
      </a>
    </div>
    <ul><li><p><a href="/rpki/">RPKI - The required cryptographic upgrade to BGP routing</a></p></li><li><p><a href="/rpki-details/">RPKI and BGP: our path to securing Internet Routing</a></p></li></ul>
    <div>
      <h3>Day 4: Onion Routing</h3>
      <a href="#day-4-onion-routing">
        
      </a>
    </div>
    <ul><li><p><a href="/cloudflare-onion-service/">Introducing the Cloudflare Onion Service</a></p></li></ul>
    <div>
      <h3>Day 5: Roughtime</h3>
      <a href="#day-5-roughtime">
        
      </a>
    </div>
    <ul><li><p><a href="/roughtime/">Roughtime: Securing Time with Digital Signatures</a></p></li></ul>
    <div>
      <h2>A more trustworthy Internet</h2>
      <a href="#a-more-trustworthy-internet">
        
      </a>
    </div>
    <p>Everything we do online depends on a relationship between users, services, and networks that is supported by some sort of trust mechanism. These relationships can be physical (I plug my router into yours), contractual (I paid a <a href="https://www.cloudflare.com/learning/dns/glossary/what-is-a-domain-name-registrar/">registrar</a> for this <a href="https://www.cloudflare.com/learning/dns/glossary/what-is-a-domain-name/">domain name</a>), or reliant on a trusted third party (I sent a message to my friend on iMessage via Apple). The simple act of visiting a website involves hundreds of trust relationships, some explicit and some implicit. The sheer size of the Internet and number of parties involved make trust online incredibly complex. Cryptography is a tool that can be used to encode and enforce, and most importantly scale these trust relationships.</p><p>To illustrate this, let’s break down what happens when you visit a website. But before we can do this, we need to know the jargon.</p><ul><li><p><b>Autonomous Systems (100 thousand or so active)</b>: An AS corresponds to a network provider connected to the Internet. Each has a unique Autonomous System Number (ASN).</p></li><li><p><b>IP ranges (1 million or so)</b>: Each AS is assigned a set of numbers called IP addresses. Each of these IP addresses can be used by the AS to identify a computer on its network when connecting to other networks on the Internet. These addresses are assigned by the Regional Internet Registries (RIR), of which there are 5. Data sent from one IP address to another hops from one AS to another based on a “route” that is determined by a protocol called BGP.</p></li><li><p><b>Domain names (&gt;1 billion)</b>: Domain names are the human-readable names that correspond to Internet services (like “cloudflare.com” or “mail.google.com”). These Internet services are accessed via the Internet by connecting to their IP address, which can be obtained from their domain name via the <a href="https://www.cloudflare.com/learning/dns/what-is-dns/">Domain Name System (DNS)</a>.</p></li><li><p><b>Content (infinite)</b>: The main use case of the Internet is to enable the transfer of specific pieces of data from one point on the network to another. This data can be of any form or type.</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7wDRty2HT3gbpxOlTNAgm5/98e8e5b4168678a79bb091946813a845/name-to-asn-_3.5x.png" />
            
            </figure><p>When you type a website such as blog.cloudflare.com into your browser, a number of things happen. First, a (recursive) DNS service is contacted to get the IP address of the site. This DNS server configured by your ISP when you connect to the Internet, or it can be a public service such as 1.1.1.1 or 8.8.8.8. A query to the DNS service travels from network to network along a path determined by BGP announcements. If the recursive DNS server does not know the answer to the query, then it contacts the appropriate authoritative DNS services, starting with a root DNS server, down to a top level domain server (such as com or org), down to the DNS server that is authoritative for the domain. Once the DNS query has been answered, the browser sends an HTTP request to its IP address (traversing a sequence of networks), and in response, the server sends the content of the website.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2JHDdXKcnw2lce7hUVVvjP/a76212811897165d5e081bdc56be32a4/colorful-crypto-overview--copy-3_3.5x.png" />
            
            </figure><p>So what’s the problem with this picture? For one, every DNS query and every network hop needs to be trusted in order to trust the content of the site. Any DNS query could be modified, a network could advertise an IP that belongs to another network, and any machine along the path could modify the content. When the Internet was small, there were mechanisms to combat this sort of subterfuge. Network operators had a personal relationship with each other and could punish bad behavior, but given the number of networks in existence <a href="https://www.cidr-report.org/as2.0/autnums.html">almost 400,000 as of this week</a> this is becoming difficult to scale.</p><p>Cryptography is a tool that can encode these trust relationships and make the whole system reliant on hard math rather than physical handshakes and hopes.</p>
    <div>
      <h3>Building a taller tower of turtles</h3>
      <a href="#building-a-taller-tower-of-turtles">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4thrwRrwuZ1ctzlstdLLqv/4e0c8c5b89d4faa9f8ff3c5d76251f01/turtles.jpg" />
            
            </figure><p><a href="https://www.flickr.com/photos/wwarby/2499825928">Attribution 2.0 Generic (CC BY 2.0)</a></p><p>The two main tools that cryptography provides to help solve this problem are cryptographic hashes and digital signatures.</p><p>A hash function is a way to take any piece of data and transform it into a fixed-length string of data, called a digest or hash. A hash function is considered cryptographically strong if it is computationally infeasible (read: very hard) to find two inputs that result in the same digest, and that changing even one bit of the input results in a completely different digest. The most popular hash function that is considered secure is SHA-256, which has 256-bit outputs. For example, the SHA-256 hash of the word “crypto” is</p><p><code>DA2F073E06F78938166F247273729DFE465BF7E46105C13CE7CC651047BF0CA4</code></p><p>And the SHA-256 hash of “crypt0” is</p><p><code>7BA359D3742595F38347A0409331FF3C8F3C91FF855CA277CB8F1A3A0C0829C4</code></p><p>The other main tool is digital signatures. A digital signature is a value that can only be computed by someone with a private key, but can be verified by anyone with the corresponding public key. Digital signatures are way for a private key holder to “sign,” or attest to the authenticity of a specific message in a way that anyone can validate it.</p><p>These two tools can be combined to solidify the trust relationships on the Internet. By giving private keys to the trusted parties who are responsible for defining the relationships between ASs, IPs, domain names and content, you can create chains of trust that can be publicly verified. Rather than hope and pray, these relationships can be validated in real time at scale.</p><p>Let’s take our webpage loading example and see where digital signatures can be applied.</p><p><b>Routing</b>. Time-bound delegation of trust is defined through a system called the RPKI. RPKI defines an object called a Resource Certificate, an attestation that states that a given IP range belongs to a specific ASN for this period of time, digitally signed by the RIR responsible for assigning the IP range. Networks share routes via BGP, and if a route is advertised for an IP that does not conform the the Resource Certificate, the network can choose not to accept it.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2GgcQBjG2ecuqivy9h7SCe/f6bea1c0abb365d2cab805c221d00ae6/roas_3x.png" />
            
            </figure><p><b>DNS.</b> Adding cryptographic assurance to routing is powerful, but if a network adversary can change the content of the data (such as the DNS responses), then the system is still at risk. DNSSEC is a system built to provide a trusted link between names and IP addresses. The root of trust in DNSSEC is the DNS root key, which is managed with an <a href="https://www.iana.org/dnssec/ceremonies">elaborate signing ceremony</a>.</p><p><b>HTTPS</b>. When you connect to a site, not only do you want it to be coming from the right host, you also want the content to be private. The Web PKI is a system that issues certificates to sites, allowing you to bind the domain name to a time-bounded private key. Because there are many CAs, additional accountability systems like <a href="/introducing-certificate-transparency-and-nimbus/">certificate transparency</a> need to be involved to help keep the system in check.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6oSYpHOMRKf2EtzXWvcTbE/5b1100ad17540b9946cdbf91604a72fc/connection-to-asn_3.5x.png" />
            
            </figure><p>This cryptographic scaffolding turns the Internet into an encoded system of trust. With these systems in place, Internet users no longer need to trust every network and party involved in this diagram, they only need to trust the RIRs, DNSSEC and the CAs (and know the correct time).</p><p>This week we’ll be making some announcements that help strengthen this system of accountability.</p>
    <div>
      <h2>Privacy and integrity with friends</h2>
      <a href="#privacy-and-integrity-with-friends">
        
      </a>
    </div>
    <p>The Internet is great because it connects us to each other, but the details of how it connects us are important. The technical choices made when Internet was designed come with some interesting human implications.</p><p>One implication is <b>trackability</b>. Your IP address is contained on every packet you send over the Internet. This acts as a unique identifier for anyone (corporations, governments, etc.) to track what you do online. Furthermore, if you connect to a server, that server’s identity is sent in plaintext on the request <b>even over HTTPS</b>, revealing your browsing patterns to any intermediary who cares to look.</p><p>Another implication is <b>malleability</b>. Resources on the Internet are defined by <i>where</i> they are, not <i>what</i> they are. If you want to go to CNN or BBC, then you connect to the server for cnn.com or bbc.co.uk and validate the certificate to make sure it’s the right site. But once you’ve made the connection, there’s no good way to know that the actual content is what you expect it to be. If the server is hacked, it could send you anything, including dangerous malicious code. HTTPS is a secure pipe, but there’s no inherent way to make sure what gets sent through the pipe is what you expect.</p><p>Trackability and malleability are not inherent features of interconnectedness. It is possible to design networks that don’t have these downsides. It is also possible to build new networks with better characteristic on top of the existing Internet. The key ingredient is cryptography.</p>
    <div>
      <h3>Tracking-resilient networking</h3>
      <a href="#tracking-resilient-networking">
        
      </a>
    </div>
    <p>One of the networks built on top of the Internet that provides good privacy properties is Tor. The Tor network is run by a group of users who allow their computers to be used to route traffic for other members of the network. Using cryptography, it is possible to route traffic from one place to another without points along the path knowing both the source and the destination at the same time. This is called <a href="https://en.wikipedia.org/wiki/Onion_routing">onion routing</a> because it involves multiple layers of encryption, like an onion. Traffic coming out of the Tor network is “anonymous” because it could have come from anyone connected to the network. Everyone just blends in, making it hard to track individuals.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/68kxhYzrB1vuZ1FogJ2MgK/e11e433e5f39a95cd6ef9ed4009b5c8b/Tor-Onion-Cloudflare.png" />
            
            </figure><p>Similarly, web services can use onion routing to serve content inside the Tor network without revealing their location to visitors. Instead of using a hostname to identify their network location, so-called onion services use a cryptographic public key as their address. There are hundreds of onion services in use, including the one <a href="/welcome-hidden-resolver/">we use for 1.1.1.1</a> or the one in <a href="https://en.wikipedia.org/wiki/Facebookcorewwwi.onion">use by Facebook</a>.</p><p>Troubles occur at the boundary between Tor network and the rest of the Internet. This is especially true for user is attempting to access services that rely on abuse prevention mechanisms based on reputation. Since Tor is used by both privacy-conscious users and malicious bots, connections from both get lumped together and as the expression goes, one bad apple ruins the bunch. This unfortunately exposes legitimate visitors to anti-abuse mechanisms like CAPTCHAs. Tools like <a href="/cloudflare-supports-privacy-pass/">Privacy Pass</a> help reduce this burden but don’t eliminate it completely. This week we’ll be announcing a new way to improve this situation.</p>
    <div>
      <h3>Bringing integrity to content delivery</h3>
      <a href="#bringing-integrity-to-content-delivery">
        
      </a>
    </div>
    <p>Let’s revisit the issue of malleability: the fact that you can’t always trust the other side of a connection to send you the content you expect. There are technologies that allow users to insure the integrity of content without trusting the server. One such technology is a feature of HTML called <a href="https://www.w3.org/TR/SRI/">Subresource Integrity (SRI)</a>. SRI allows a webpage with sub-resources (like a script or stylesheet) to embed a unique cryptographic hash into the page so that when the sub-resource is loaded, it is checked to see that is matches the expected value. This protects the site from loading unexpected scripts from third parties, <a href="/an-introduction-to-javascript-based-ddos/">a known attack vector</a>.</p><p>Another idea is to flip this on its head: what if instead of fetching a piece of content from a specific location on the network, you asked the network to find piece of content that matches a given hash? By assigning resources based on their actual content rather than by location it’s possible to create a network in which you can fetch content from anywhere on the network and still know it’s authentic. This idea is called <i>content addressing</i> and there are networks built on top of the Internet that use it. These content addressed networks, based on protocols such <a href="https://ipfs.io/">IPFS</a> and <a href="https://datproject.org/">DAT</a>, are blazing a trail new trend in Internet applications called the Distributed Web. With the Distributed Web applications, malleability is no longer an issue, opening up a new set of possibilities.</p>
    <div>
      <h3>Combining strengths</h3>
      <a href="#combining-strengths">
        
      </a>
    </div>
    <p>Networks based on cryptographic principles, like Tor and IPFS, have one major downside compared to networks based on names: usability. Humans are exceptionally bad at remembering or distinguishing between cryptographically-relevant numbers. Take, for instance, the New York Times’ onion address:</p><p><code>https://www.nytimes3xbfgragh.onion/</code></p><p>This is would easily confused with similar-looking onion addresses, such as</p><p><code>https://www.nytimes3xfkdbgfg.onion/</code></p><p>which may be controlled by a malicious actor.</p><p>Content addressed networks are even worse from the perspective of regular people. For example, there is a snapshot of the Turkish version of Wikipedia on IPFS with the hash:</p><p><code>QmT5NvUtoM5nWFfrQdVrFtvGfKFmG7AHE8P34isapyhCxX</code></p><p>Try typing this hash into your browser without making a mistake.</p><p>These naming issues are things Cloudflare is perfectly positioned to help solve.First, by putting the hash address of an IPFS site in the DNS (and adding DNSSEC for trust) you can give your site a traditional hostname while maintaining a chain of trust.</p><p>Second, by enabling browsers to use a traditional DNS name to access the web through onion services, you can provide safer access to your site for Tor user with the added benefit of being better able to distinguish between bots and humans.With Cloudflare as the glue, is is possible to connect both standard internet and tor users to web sites and services on both the traditional web with the distributed web.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/rzDTSMsIy1c5frGel8Eff/ea82dba88874f5772d6f7bdc3cc54776/bowtie-diagram-crypto-week-2018-v02_medium-1.gif" />
            
            </figure><p>This is the promise of Crypto Week: using cryptographic guarantees to make a stronger, more trustworthy and more private internet without sacrificing usability.</p>
    <div>
      <h2>Happy Crypto Week</h2>
      <a href="#happy-crypto-week">
        
      </a>
    </div>
    <p>In conclusion, we’re working on many cutting-edge technologies based on cryptography and applying them to <a href="https://blog.cloudflare.com/50-years-of-the-internet-work-in-progress-to-a-better-internet/">make the Internet better</a>. The first announcement today is the launch of Cloudflare's <a href="/distributed-web-gateway/">Distributed Web Gateway</a> and <a href="/e2e-integrity/">browser extension</a>. Keep tabs on the Cloudflare blog for exciting updates as the week progresses.</p><p>I’m very proud of the team’s work on Crypto Week, which was made possible by the work of a dedicated team, including several brilliant interns. If this type of work is interesting to you, Cloudflare is hiring for the <a href="https://boards.greenhouse.io/cloudflare/jobs/634967?gh_jid=634967">crypto team</a> and <a href="https://www.cloudflare.com/careers/">others</a>!</p> ]]></content:encoded>
            <category><![CDATA[Crypto Week]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[IPFS]]></category>
            <category><![CDATA[HTTPS]]></category>
            <category><![CDATA[Tor]]></category>
            <category><![CDATA[DNS]]></category>
            <category><![CDATA[Reliability]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">2NzZFGM5fxcJ3xnCx2v7jD</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[A Detailed Look at RFC 8446 (a.k.a. TLS 1.3)]]></title>
            <link>https://blog.cloudflare.com/rfc-8446-aka-tls-1-3/</link>
            <pubDate>Fri, 10 Aug 2018 23:00:00 GMT</pubDate>
            <description><![CDATA[ TLS 1.3 (RFC 8446) was published today. This article provides a deep dive into the changes introduced in TLS 1.3 and its impact on the future of internet security. ]]></description>
            <content:encoded><![CDATA[ <p>For the last five years, the Internet Engineering Task Force (IETF), the standards body that defines internet protocols, has been working on standardizing the latest version of one of its most important security protocols: Transport Layer Security (TLS). TLS is used to secure the web (and much more!), providing encryption and ensuring the authenticity of every HTTPS website and API. The latest version of TLS, TLS 1.3 (<a href="https://www.rfc-editor.org/rfc/pdfrfc/rfc8446.txt.pdf">RFC 8446</a>) was published today. It is the first major overhaul of the protocol, bringing significant security and performance improvements. This article provides a deep dive into the changes introduced in TLS 1.3 and its impact on the future of internet security.</p>
    <div>
      <h3>An evolution</h3>
      <a href="#an-evolution">
        
      </a>
    </div>
    <p>One major way Cloudflare provides <a href="https://www.cloudflare.com/application-services/solutions/api-security/">security</a> is by supporting HTTPS for websites and web services such as APIs. With HTTPS (the “S” stands for secure) the communication between your browser and the server travels over an encrypted and authenticated channel. Serving your content over HTTPS instead of HTTP provides confidence to the visitor that the content they see is presented by the legitimate content owner and that the communication is safe from eavesdropping. This is a big deal in a world where online privacy is more important than ever.</p><p>The machinery under the hood that makes HTTPS secure is a protocol called TLS. It has its roots in a protocol called Secure Sockets Layer (SSL) developed in the mid-nineties at Netscape. By the end of the 1990s, Netscape handed SSL over to the IETF, who renamed it TLS and have been the stewards of the protocol ever since. Many people still refer to web encryption as SSL, even though the vast majority of services have switched over to supporting TLS only. The term SSL continues to have popular appeal and Cloudflare has kept the term alive through product names like <a href="/keyless-ssl-the-nitty-gritty-technical-details/">Keyless SSL</a> and <a href="/introducing-universal-ssl/">Universal SSL</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/59tFn3me3Oe6OcjT24CqYF/22a662ccc88b06adc516449b8e2be657/image5.png" />
            
            </figure><p>In the IETF, protocols are called RFCs. TLS 1.0 was RFC 2246, TLS 1.1 was RFC 4346, and TLS 1.2 was RFC 5246. Today, TLS 1.3 was published as RFC 8446. RFCs are generally published in order, keeping 46 as part of the RFC number is a nice touch.</p>
    <div>
      <h3>TLS 1.2 wears parachute pants and shoulder pads</h3>
      <a href="#tls-1-2-wears-parachute-pants-and-shoulder-pads">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5p8wOtJF3L8LEprZDoO0z7/c4742d6066b73c33e4f5e98afddb83ff/image11.jpg" />
            
            </figure><p><a href="https://memegenerator.net/Mc-Hammer-Pants">MC Hammer</a>, like SSL, was popular in the 90s</p><p>Over the last few years, TLS has seen its fair share of problems. First of all, there have been problems with the code that implements TLS, including <a href="/answering-the-critical-question-can-you-get-private-ssl-keys-using-heartbleed/">Heartbleed</a>, <a href="https://www.imperialviolet.org/2014/09/26/pkcs1.html">BERserk</a>, <a href="https://gotofail.com/">goto fail;</a>, and more. These issues are not fundamental to the protocol and mostly resulted from a lack of testing. Tools like <a href="https://github.com/RUB-NDS/TLS-Attacker">TLS Attacker</a> and <a href="https://security.googleblog.com/2016/12/project-wycheproof.html">Project Wycheproof</a> have helped improve the robustness of TLS implementation, but the more challenging problems faced by TLS have had to do with the protocol itself.</p><p>TLS was designed by engineers using tools from mathematicians. Many of the early design decisions from the days of SSL were made using heuristics and an incomplete understanding of how to design robust security protocols. That said, this isn’t the fault of the protocol designers (Paul Kocher, Phil Karlton, Alan Freier, Tim Dierks, Christopher Allen and others), as the entire industry was still learning how to do this properly. When TLS was designed, formal papers on the design of secure authentication protocols like Hugo Krawczyk’s landmark <a href="http://webee.technion.ac.il/~hugo/sigma-pdf.pdf">SIGMA</a> paper were still years away. TLS was 90s crypto: It meant well and seemed cool at the time, but the modern cryptographer’s design palette has moved on.</p><p>Many of the design flaws were discovered using <a href="https://en.wikipedia.org/wiki/Formal_verification">formal verification</a>. Academics attempted to prove certain security properties of TLS, but instead found counter-examples that were turned into real vulnerabilities. These weaknesses range from the purely theoretical (<a href="https://access.redhat.com/articles/2112261">SLOTH</a> and <a href="https://eprint.iacr.org/2018/298.pdf">CurveSwap</a>), to feasible for highly resourced attackers (<a href="https://weakdh.org/imperfect-forward-secrecy-ccs15.pdf">WeakDH</a>, <a href="/logjam-the-latest-tls-vulnerability-explained/">LogJam</a>, <a href="https://censys.io/blog/freak">FREAK</a>, <a href="https://nakedsecurity.sophos.com/2016/08/25/anatomy-of-a-cryptographic-collision-the-sweet32-attack/">SWEET32</a>), to practical and dangerous (<a href="https://en.wikipedia.org/wiki/POODLE">POODLE</a>, <a href="https://robotattack.org/">ROBOT</a>).</p>
    <div>
      <h3>TLS 1.2 is slow</h3>
      <a href="#tls-1-2-is-slow">
        
      </a>
    </div>
    <p>Encryption has always been important online, but historically it was only used for things like logging in or sending credit card information, leaving most other data exposed. There has been a major trend in the last few years towards using HTTPS for all traffic on the Internet. This has the positive effect of protecting more of what we do online from eavesdroppers and <a href="/an-introduction-to-javascript-based-ddos/">injection attacks</a>, but has the downside that new connections get a bit slower.</p><p>For a browser and web server to agree on a key, they need to exchange cryptographic data. The exchange, called the “handshake” in TLS, has remained largely unchanged since TLS was standardized in 1999. The handshake requires two additional round-trips between the browser and the server before encrypted data can be sent (or one when resuming a previous connection). The additional cost of the TLS handshake for HTTPS results in a noticeable hit to latency compared to an HTTP alone. This additional delay can negatively impact performance-focused applications.</p>
    <div>
      <h3>Defining TLS 1.3</h3>
      <a href="#defining-tls-1-3">
        
      </a>
    </div>
    <p>Unsatisfied with the outdated design of TLS 1.2 and two-round-trip overhead, the IETF set about defining a new version of TLS. In August 2013, Eric Rescorla laid out a wishlist of features for the new protocol:<a href="https://www.ietf.org/proceedings/87/slides/slides-87-tls-5.pdf">https://www.ietf.org/proceedings/87/slides/slides-87-tls-5.pdf</a></p><p>After <a href="https://www.ietf.org/mail-archive/web/tls/current/msg20938.html">some debate</a>, it was decided that this new version of TLS was to be called TLS 1.3. The main issues that drove the design of TLS 1.3 were mostly the same as those presented five years ago:</p><ul><li><p>reducing handshake latency</p></li><li><p>encrypting more of the handshake</p></li><li><p>improving resiliency to cross-protocol attacks</p></li><li><p>removing legacy features</p></li></ul><p>The specification was shaped by volunteers through an open design process, and after four years of diligent work and vigorous debate, TLS 1.3 is now in its final form: RFC 8446. As adoption increases, the new protocol will make the internet both faster and more secure.</p><p>In this blog post I will focus on the two main advantages TLS 1.3 has over previous versions: security and performance.</p>
    <div>
      <h3>Trimming the hedges</h3>
      <a href="#trimming-the-hedges">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/57PQK3ofbneOYgOmlwNm4Y/e5c3c319903504002330efec0fc06db2/image10.jpg" />
            
            </figure><p><a href="https://commons.wikimedia.org/wiki/File:Williton_Highbridge_Nursery_topiary_garden.jpg">Creative Commons Attribution-Share Alike 3.0</a></p><p>In the last two decades, we as a society have learned a lot about how to write secure cryptographic protocols. The parade of cleverly-named attacks from POODLE to Lucky13 to SLOTH to LogJam showed that even TLS 1.2 contains antiquated ideas from the early days of cryptographic design. One of the design goals of TLS 1.3 was to correct previous mistakes by removing potentially dangerous design elements.</p>
    <div>
      <h4>Fixing key exchange</h4>
      <a href="#fixing-key-exchange">
        
      </a>
    </div>
    <p>TLS is a so-called “hybrid” cryptosystem. This means it uses both symmetric key cryptography (encryption and decryption keys are the same) and public key cryptography (encryption and decryption keys are different). Hybrid schemes are the predominant form of encryption used on the Internet and are used in <a href="https://en.wikipedia.org/wiki/Secure_Shell">SSH</a>, <a href="https://en.wikipedia.org/wiki/IPsec">IPsec</a>, <a href="https://en.wikipedia.org/wiki/Signal_Protocol">Signal</a>, <a href="https://www.wireguard.com/">WireGuard</a> and other protocols. In hybrid cryptosystems, public key cryptography is used to establish a shared secret between both parties, and the shared secret is used to create symmetric keys that can be used to encrypt the data exchanged.</p><p>As a general rule, public key crypto is slow and expensive (microseconds to milliseconds per operation) and symmetric key crypto is fast and cheap (nanoseconds per operation). Hybrid encryption schemes let you send a lot of encrypted data with very little overhead by only doing the expensive part once. Much of the work in TLS 1.3 has been about improving the part of the handshake, where public keys are used to establish symmetric keys.</p>
    <div>
      <h4>RSA key exchange</h4>
      <a href="#rsa-key-exchange">
        
      </a>
    </div>
    <p>The public key portion of TLS is about establishing a shared secret. There are two main ways of doing this with public key cryptography. The simpler way is with public-key encryption: one party encrypts the shared secret with the other party’s public key and sends it along. The other party then uses its private key to decrypt the shared secret and ... voila! They both share the same secret. This technique was discovered in 1977 by Rivest, Shamir and Adelman and is called RSA key exchange. In TLS’s RSA key exchange, the shared secret is decided by the client, who then encrypts it to the server’s public key (extracted from the certificate) and sends it to the server.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6vFfpyW3dU5vLUnbrzOGk8/5b9c70ff88d0da6d3210fc37f13e8184/image4.png" />
            
            </figure><p>The other form of key exchange available in TLS is based on another form of public-key cryptography, invented by Diffie and Hellman in 1976, so-called Diffie-Hellman key agreement. In Diffie-Hellman, the client and server both start by creating a public-private key pair. They then send the public portion of their key share to the other party. When each party receives the public key share of the other, they combine it with their own private key and end up with the same value: the pre-main secret. The server then uses a digital signature to ensure the exchange hasn’t been tampered with. This key exchange is called “ephemeral” if the client and server both choose a new key pair for every exchange.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6tjgSGvMVdzh3LZvt1HZT1/98031ef05fdc4353af60d27062fdb67a/image3.png" />
            
            </figure><p>Both modes result in the client and server having a shared secret, but RSA mode has a serious downside: it’s not <a href="/staying-on-top-of-tls-attacks/">forward secret</a>. That means that if someone records the encrypted conversation and then gets ahold of the RSA private key of the server, they can decrypt the conversation. This even applies if the conversation was recorded and the key is obtained some time well into the future. In a world where national governments are recording encrypted conversations and using exploits like <a href="https://en.wikipedia.org/wiki/Heartbleed">Heartbleed</a> to steal private keys, this is a realistic threat.</p><p>RSA key exchange has been problematic for some time, and not just because it’s not forward-secret. It’s also notoriously difficult to do correctly. In 1998, Daniel Bleichenbacher discovered a vulnerability in the way RSA encryption was done in SSL and created what’s called the “million-message attack,” which allows an attacker to perform an RSA private key operation with a server’s private key by sending a million or so well-crafted messages and looking for differences in the error codes returned. The attack has been refined over the years and in some cases only requires thousands of messages, making it feasible to do from a laptop. It was recently discovered that major websites (including facebook.com) were also vulnerable to a variant of Bleichenbacher’s attack called the <a href="https://robotattack.org/">ROBOT attack</a> as recently as 2017.</p><p>To reduce the risks caused by non-forward secret connections and million-message attacks, RSA encryption was removed from TLS 1.3, leaving ephemeral Diffie-Hellman as the only key exchange mechanism. Removing RSA key exchange brings other advantages, as we will discuss in the performance section below.</p>
    <div>
      <h4>Diffie-Hellman named groups</h4>
      <a href="#diffie-hellman-named-groups">
        
      </a>
    </div>
    <p>When it comes to cryptography, giving too many options leads to the wrong option being chosen. This principle is most evident when it comes to choosing Diffie-Hellman parameters. In previous versions of TLS, the choice of the Diffie-Hellman parameters was up to the participants. This resulted in some implementations choosing incorrectly, resulting in vulnerable implementations being deployed. TLS 1.3 takes this choice away.</p><p>Diffie-Hellman is a powerful tool, but not all Diffie-Hellman parameters are “safe” to use. The security of Diffie-Hellman depends on the difficulty of a specific mathematical problem called the <a href="https://en.wikipedia.org/wiki/Discrete_logarithm">discrete logarithm problem</a>. If you can solve the discrete logarithm problem for a set of parameters, you can extract the private key and break the security of the protocol. Generally speaking, the bigger the numbers used, the harder it is to solve the discrete logarithm problem. So if you choose small DH parameters, you’re in trouble.</p><p>The LogJam and WeakDH attacks of 2015 showed that many TLS servers could be tricked into using small numbers for Diffie-Hellman, allowing an attacker to break the security of the protocol and decrypt conversations.</p><p>Diffie-Hellman also requires the parameters to have certain other mathematical properties. In 2016, Antonio Sanso found an <a href="http://arstechnica.com/security/2016/01/high-severity-bug-in-openssl-allows-attackers-to-decrypt-https-traffic/">issue in OpenSSL</a> where parameters were chosen that lacked the right mathematical properties, resulting in another vulnerability.</p><p>TLS 1.3 takes the opinionated route, restricting the Diffie-Hellman parameters to ones that are known to be secure. However, it still leaves several options; permitting only one option makes it difficult to update TLS in case these parameters are found to be insecure some time in the future.</p>
    <div>
      <h3>Fixing ciphers</h3>
      <a href="#fixing-ciphers">
        
      </a>
    </div>
    <p>The other half of a hybrid crypto scheme is the actual encryption of data. This is done by combining an authentication code and a symmetric cipher for which each party knows the key. As I’ll describe, there are many ways to encrypt data, most of which are wrong.</p>
    <div>
      <h4>CBC mode ciphers</h4>
      <a href="#cbc-mode-ciphers">
        
      </a>
    </div>
    <p>In the last section we described TLS as a hybrid encryption scheme, with a public key part and a symmetric key part. The public key part is not the only one that has caused trouble over the years. The symmetric key portion has also had its fair share of issues. In any secure communication scheme, you need both encryption (to keep things private) and integrity (to make sure people don’t modify, add, or delete pieces of the conversation). Symmetric key encryption is used to provide both encryption and integrity, but in TLS 1.2 and earlier, these two pieces were combined in the wrong way, leading to security vulnerabilities.</p><p>An algorithm that performs symmetric encryption and decryption is called a symmetric cipher. Symmetric ciphers usually come in two main forms: block ciphers and stream ciphers.</p><p>A stream cipher takes a fixed-size key and uses it to create a stream of pseudo-random data of arbitrary length, called a key stream. To encrypt with a stream cipher, you take your message and combine it with the key stream by XORing each bit of the key stream with the corresponding bit of your message.. To decrypt, you take the encrypted message and XOR it with the key stream. Examples of pure stream ciphers are RC4 and ChaCha20. Stream ciphers are popular because they’re simple to implement and fast in software.</p><p>A block cipher is different than a stream cipher because it only encrypts fixed-sized messages. If you want to encrypt a message that is shorter or longer than the block size, you have to do a bit of work. For shorter messages, you have to add some extra data to the end of the message. For longer messages, you can either split your message up into blocks the cipher can encrypt and then use a block cipher mode to combine the pieces together somehow. Alternatively, you can turn your block cipher into a stream cipher by encrypting a sequence of counters with a block cipher and using that as the stream. This is called “counter mode”. One popular way of encrypting arbitrary length data with a block cipher is a mode called cipher block chaining (CBC).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5hHGcSStKo5bHWDn64PXHq/4801697c668fc061eab0c0ab57c2fdd8/image9.png" />
            
            </figure><p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/510G6uPdPGbwTJHcsGqPSc/726945c085f0912e1307e18ef4393563/image7.png" />
            
            </figure><p>In order to prevent people from tampering with data, encryption is not enough. Data also needs to be integrity-protected. For CBC-mode ciphers, this is done using something called a message-authentication code (MAC), which is like a fancy checksum with a key. Cryptographically strong MACs have the property that finding a MAC value that matches an input is practically impossible unless you know the secret key. There are two ways to combine MACs and CBC-mode ciphers. Either you encrypt first and then MAC the ciphertext, or you MAC the plaintext first and then encrypt the whole thing. In TLS, they chose the latter, MAC-then-Encrypt, which turned out to be the wrong choice.</p><p>You can blame this choice for <a href="https://www.youtube.com/watch?v=-_8-2pDFvmg">BEAST</a>, as well as a slew of padding oracle vulnerabilities such as <a href="http://www.isg.rhul.ac.uk/tls/Lucky13.html">Lucky 13</a> and <a href="https://eprint.iacr.org/2015/1129">Lucky Microseconds</a>. Read my previous post on <a href="/padding-oracles-and-the-decline-of-cbc-mode-ciphersuites/">padding oracle attacks</a> for a comprehensive explanation of these flaws. The interaction between CBC mode and padding was also the cause of the widely publicized <a href="/sslv3-support-disabled-by-default-due-to-vulnerability/">POODLE vulnerability</a> in SSLv3 and some implementations of TLS.</p><p>RC4 is a classic stream cipher designed by Ron Rivest (the “R” of RSA) that was broadly supported since the early days of TLS. In 2013, it was found to have <a href="http://www.isg.rhul.ac.uk/tls/">measurable biases</a> that could be leveraged to allow attackers to decrypt messages.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7A6uMNALwNJtA0GSKOkxOL/5c9692baac1ab202e0e4d7f79e4ae8f2/image2.png" />
            
            </figure><p>AEAD Mode</p><p>In TLS 1.3, all the troublesome ciphers and cipher modes have been removed. You can no longer use CBC-mode ciphers or insecure stream ciphers such as RC4. The only type of symmetric crypto allowed in TLS 1.3 is a new construction called <a href="/it-takes-two-to-chacha-poly/">AEAD (authenticated encryption with additional data)</a>, which combines encryption and integrity into one seamless operation.</p>
    <div>
      <h3>Fixing digital signatures</h3>
      <a href="#fixing-digital-signatures">
        
      </a>
    </div>
    <p>Another important part of TLS is authentication. In every connection, the server authenticates itself to the client using a digital certificate, which has a public key. In RSA-encryption mode, the server proves its ownership of the private key by decrypting the pre-main secret and computing a MAC over the transcript of the conversation. In Diffie-Hellman mode, the server proves ownership of the private key using a digital signature. If you’ve been following this blog post so far, it should be easy to guess that this was done incorrectly too.</p>
    <div>
      <h4>PKCS#1v1.5</h4>
      <a href="#pkcs-1v1-5">
        
      </a>
    </div>
    <p>Daniel Bleichenbacher has made a living identifying problems with RSA in TLS. In 2006, he devised a pen-and-paper attack against RSA signatures as used in TLS. It was later discovered that major TLS implemenations including those of NSS and OpenSSL <a href="https://www.ietf.org/mail-archive/web/openpgp/current/msg00999.html">were vulnerable to this attack</a>. This issue again had to do with how difficult it is to implement padding correctly, in this case, the PKCS#1 v1.5 padding used in RSA signatures. In TLS 1.3, PKCS#1 v1.5 is removed in favor of the newer design <a href="https://en.wikipedia.org/wiki/Probabilistic_signature_scheme">RSA-PSS</a>.</p>
    <div>
      <h4>Signing the entire transcript</h4>
      <a href="#signing-the-entire-transcript">
        
      </a>
    </div>
    <p>We described earlier how the server uses a digital signature to prove that the key exchange hasn’t been tampered with. In TLS 1.2 and earlier, the server’s signature only covers part of the handshake. The other parts of the handshake, specifically the parts that are used to negotiate which symmetric cipher to use, are not signed by the private key. Instead, a symmetric MAC is used to ensure that the handshake was not tampered with. This oversight resulted in a number of high-profile vulnerabilities (FREAK, LogJam, etc.). In TLS 1.3 these are prevented because the server signs the entire handshake transcript.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2gJewngm3kPtCgXDvl7O4q/340d28439e4eaac4cd176359dfa19900/image1.png" />
            
            </figure><p>The FREAK, LogJam and CurveSwap attacks took advantage of two things:</p><ol><li><p>the fact that intentionally weak ciphers from the 1990s (called export ciphers) were still supported in many browsers and servers, and</p></li><li><p>the fact that the part of the handshake used to negotiate which cipher was used was not digitally signed.</p></li></ol><p>The on-path attacker can swap out the supported ciphers (or supported groups, or supported curves) from the client with an easily crackable choice that the server supports. They then break the key and forge two finished messages to make both parties think they’ve agreed on a transcript.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6PHIoZN6sxu78eUdoLWcbz/4f4a1fbbff72785aa2be24c5c9872e8f/image13.png" />
            
            </figure><p>These attacks are called downgrade attacks, and they allow attackers to force two participants to use the weakest cipher supported by both parties, even if more secure ciphers are supported. In this style of attack, the perpetrator sits in the middle of the handshake and changes the list of supported ciphers advertised from the client to the server to only include weak export ciphers. The server then chooses one of the weak ciphers, and the attacker figures out the key with a brute-force attack, allowing the attacker to forge the MACs on the handshake. In TLS 1.3, this type of downgrade attack is impossible because the server now signs the entire handshake, including the cipher negotiation.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/P4S0oZBnuJvkG23ljrAmN/a658f4a88dddcf2019fa22567e150a53/image14.png" />
            
            </figure>
    <div>
      <h3>Better living through simplification</h3>
      <a href="#better-living-through-simplification">
        
      </a>
    </div>
    <p>TLS 1.3 is a much more elegant and secure protocol with the removal of the insecure features listed above. This hedge-trimming allowed the protocol to be simplified in ways that make it easier to understand, and faster.</p>
    <div>
      <h4>No more take-out menu</h4>
      <a href="#no-more-take-out-menu">
        
      </a>
    </div>
    <p>In previous versions of TLS, the main negotiation mechanism was the ciphersuite. A ciphersuite encompassed almost everything that could be negotiated about a connection:</p><ul><li><p>type of certificates supported</p></li><li><p>hash function used for deriving keys (e.g., SHA1, SHA256, ...)</p></li><li><p>MAC function (e.g., HMAC with SHA1, SHA256, …)</p></li><li><p>key exchange algorithm (e.g., RSA, ECDHE, …)</p></li><li><p>cipher (e.g., AES, RC4, ...)</p></li><li><p>cipher mode, if applicable (e.g., CBC)</p></li></ul><p>Ciphersuites in previous versions of TLS had grown into monstrously large alphabet soups. Examples of commonly used cipher suites are: DHE-RC4-MD5 or ECDHE-ECDSA-AES-GCM-SHA256. Each ciphersuite was represented by a code point in a table maintained by an organization called the Internet Assigned Numbers Authority (IANA). Every time a new cipher was introduced, a new set of combinations needed to be added to the list. This resulted in a combinatorial explosion of code points representing every valid choice of these parameters. It had become a bit of a mess.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2W8o2jcAOgb3EUcGitVN8b/59d24160803d908ed4417494d57ea288/image8.png" />
            
            </figure><p>TLS 1.2</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/171emSynzRJ1MSpJv08jc1/18c165eb9c379b48418a5f25a47131e1/image16.png" />
            
            </figure><p></p><p>TLS 1.3</p><p>TLS 1.3 removes many of these legacy features, allowing for a clean split between three orthogonal negotiations:</p><ul><li><p>Cipher + HKDF Hash</p></li><li><p>Key Exchange</p></li><li><p>Signature Algorithm</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5eHObkLXwOPPw9MEbaxSsc/8e20132ec65ebb83b1e43528711fe05d/image6.png" />
            
            </figure><p>This simplified cipher suite negotiation and radically reduced set of negotiation parameters opens up a new possibility. This possibility enables the TLS 1.3 handshake latency to drop from two round-trips to only one round-trip, providing the performance boost that will ensure that TLS 1.3 will be popular and widely adopted.</p>
    <div>
      <h3>Performance</h3>
      <a href="#performance">
        
      </a>
    </div>
    <p>When establishing a new connection to a server that you haven’t seen before, it takes two <a href="https://www.cloudflare.com/learning/cdn/glossary/round-trip-time-rtt/">round-trips</a> before data can be sent on the connection. This is not particularly noticeable in locations where the server and client are geographically close to each other, but it can make a big difference on mobile networks where latency can be as high as 200ms, an amount that is noticeable for humans.</p>
    <div>
      <h3>1-RTT mode</h3>
      <a href="#1-rtt-mode">
        
      </a>
    </div>
    <p>TLS 1.3 now has a radically simpler cipher negotiation model and a reduced set of key agreement options (no RSA, no user-defined DH parameters). This means that every connection will use a DH-based key agreement and the parameters supported by the server are likely easy to guess (ECDHE with X25519 or P-256). Because of this limited set of choices, the client can simply choose to send DH key shares in the first message instead of waiting until the server has confirmed which key shares it is willing to support. That way, the server can learn the shared secret and send encrypted data one round trip earlier. Chrome’s implementation of TLS 1.3, for example, sends an X25519 keyshare in the first message to the server.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3E3tuAB7cL1jf7HXHLegge/461301a79e282e3034a6acc1bb537e49/image3.png" />
            
            </figure><p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5xa8AA1zO4jZ4yjPcIukcM/a29464a13527710055cd6031cae54c92/image15.png" />
            
            </figure><p>In the rare situation that the server does not support one of the key shares sent by the client, the server can send a new message, the HelloRetryRequest, to let the client know which groups it supports. Because the list has been trimmed down so much, this is not expected to be a common occurrence.</p>
    <div>
      <h3>0-RTT resumption</h3>
      <a href="#0-rtt-resumption">
        
      </a>
    </div>
    <p>A further optimization was inspired by the <a href="https://docs.google.com/document/u/1/d/1g5nIXAIkN_Y-7XJW5K45IblHd_L2f5LTaDUDwvZ5L6g/edit">QUIC protocol</a>. It lets clients send encrypted data in their first message to the server, resulting in no additional latency cost compared to unencrypted HTTP. This is a big deal, and once TLS 1.3 is widely deployed, the encrypted web is sure to feel much snappier than before.</p><p>In TLS 1.2, there are two ways to resume a connection, <a href="/tls-session-resumption-full-speed-and-secure/">session ids and session tickets</a>. In TLS 1.3 these are combined to form a new mode called PSK (pre-shared key) resumption. The idea is that after a session is established, the client and server can derive a shared secret called the “resumption main secret”. This can either be stored on the server with an id (session id style) or encrypted by a key known only to the server (session ticket style). This session ticket is sent to the client and redeemed when resuming a connection.</p><p>For resumed connections, both parties share a resumption main secret so key exchange is not necessary except for providing forward secrecy. The next time the client connects to the server, it can take the secret from the previous session and use it to encrypt application data to send to the server, along with the session ticket. Something as amazing as sending encrypted data on the first flight does come with its downfalls.</p>
    <div>
      <h3>Replayability</h3>
      <a href="#replayability">
        
      </a>
    </div>
    <p>There is no interactivity in 0-RTT data. It’s sent by the client, and consumed by the server without any interactions. This is great for performance, but comes at a cost: replayability. If an attacker captures a 0-RTT packet that was sent to server, they can replay it and there’s a chance that the server will accept it as valid. This can have interesting negative consequences.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4aI0oRVRPjH8lmqKPfo2Uu/66828a933209d66d8f8ac0db0d77d54d/0-rtt-attack-_2x.png" />
            
            </figure><p>An example of dangerous replayed data is anything that changes state on the server. If you increment a counter, perform a database transaction, or do anything that has a permanent effect, it’s risky to put it in 0-RTT data.</p><p>As a client, you can try to protect against this by only putting “safe” requests into the 0-RTT data. In this context, “safe” means that the request won’t change server state. In HTTP, different methods are supposed to have different semantics. HTTP GET requests are supposed to be safe, so a browser can usually protect HTTPS servers against replay attacks by only sending GET requests in 0-RTT. Since most page loads start with a GET of “/” this results in faster page load time.</p><p>Problems start to happen when data sent in 0-RTT are used for state-changing requests. To help prevent against this failure case, TLS 1.3 also includes the time elapsed value in the session ticket. If this diverges too much, the client is either approaching the speed of light, or the value has been replayed. In either case, it’s prudent for the server to reject the 0-RTT data.</p><p>For more details about <a href="/introducing-0-rtt/">0-RTT, and the improvements to session resumption</a> in TLS 1.3, check out this previous blog post.</p>
    <div>
      <h3>Deployability</h3>
      <a href="#deployability">
        
      </a>
    </div>
    <p>TLS 1.3 was a radical departure from TLS 1.2 and earlier, but in order to be deployed widely, it has to be backwards compatible with existing software. One of the reasons TLS 1.3 has taken so long to go from draft to final publication was the fact that some existing software (namely middleboxes) wasn’t playing nicely with the new changes. Even minor changes to the TLS 1.3 protocol that were visible on the wire (such as eliminating the redundant ChangeCipherSpec message, bumping the version from 0x0303 to 0x0304) ended up causing connection issues for some people.</p><p>Despite the fact that future flexibility was built into the TLS spec, some implementations made incorrect assumptions about how to handle future TLS versions. The phenomenon responsible for this change is called <i>ossification</i> and I explore it more fully in the context of TLS in my previous post about <a href="/why-tls-1-3-isnt-in-browsers-yet/">why TLS 1.3 isn’t deployed yet</a>. To accommodate these changes, TLS 1.3 was modified to look a lot like TLS 1.2 session resumption (at least on the wire). This resulted in a much more functional, but less aesthetically pleasing protocol. This is the price you pay for upgrading one of the most widely deployed protocols online.</p>
    <div>
      <h3>Conclusions</h3>
      <a href="#conclusions">
        
      </a>
    </div>
    <p>TLS 1.3 is a modern security protocol built with modern tools like <a href="http://tls13tamarin.github.io/TLS13Tamarin/">formal</a> <a href="https://eprint.iacr.org/2016/081">analysis</a> that retains its backwards compatibility. It has been tested widely and iterated upon using real world deployment data. It’s a cleaner, faster, and more secure protocol ready to become the de facto two-party encryption protocol online. Draft 28 of TLS 1.3 is enabled by default for <a href="/you-get-tls-1-3-you-get-tls-1-3-everyone-gets-tls-1-3/">all Cloudflare customers</a>, and we will be rolling out the final version soon.</p><p>Publishing TLS 1.3 is a huge accomplishment. It is one the best recent examples of how it is possible to take 20 years of deployed legacy code and change it on the fly, resulting in a better internet for everyone. TLS 1.3 has been debated and analyzed for the last three years and it’s now ready for prime time. Welcome, RFC 8446.</p> ]]></content:encoded>
            <category><![CDATA[Encryption]]></category>
            <category><![CDATA[TLS]]></category>
            <category><![CDATA[TLS 1.3]]></category>
            <category><![CDATA[HTTPS]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">2sBEBduE1Y7lYRV2e70E5m</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Introducing Certificate Transparency and Nimbus]]></title>
            <link>https://blog.cloudflare.com/introducing-certificate-transparency-and-nimbus/</link>
            <pubDate>Fri, 23 Mar 2018 14:45:00 GMT</pubDate>
            <description><![CDATA[ Certificate Transparency (CT) is an ambitious project to help improve security online by bringing accountability to the system that protects HTTPS.  ]]></description>
            <content:encoded><![CDATA[ <p>Certificate Transparency (CT) is an ambitious project to help improve security online by bringing accountability to the system that protects HTTPS. Cloudflare is announcing support for this project by introducing two new public-good services:</p><ul><li><p><i>Nimbus</i>: A free and open certificate transparency log</p></li><li><p><a href="https://ct.cloudflare.com"><i>Merkle Town</i></a>: A dashboard for exploring the certificate transparency ecosystem</p></li></ul><p>In this blog post we’ll explain what Certificate Transparency is and how it will become a critical tool for ensuring user safety online. It’s important for website operators and certificate authorities to learn about CT as soon as possible, because participating in CT becomes mandatory in Chrome for all certificates issued after April 2018. We’ll also explain how Nimbus works and how CT uses a structure called a Merkle tree to scale to the point of supporting all trusted certificates on the Internet. For more about Merkle Town, read the <a href="/a-tour-through-merkle-town-cloudflares-ct-ecosystem-dashboard/">follow up post</a> by my colleague Patrick Donahue.</p>
    <div>
      <h3>Trust and Accountability</h3>
      <a href="#trust-and-accountability">
        
      </a>
    </div>
    <p>Everything we do online requires a baseline level of trust. When you use a browser to visit your bank’s website or your favorite social media site, you expect that the server on the other side of the connection is operated by the organization indicated in the address bar. This expectation is based on trust, and this trust is supported by a system called the web <a href="https://en.wikipedia.org/wiki/Public_key_infrastructure">Public Key Infrastructure</a> (web PKI).</p><p>From a high level, a PKI is similar to a system of notaries who can grant servers the authority to serve websites by giving them a signed object called a digital certificate. This certificate contains the name of the website, the name of the organization that requested the certificate, how long it’s valid for, and a public key. For each public key, there is an associated private key. In order to serve an HTTPS site with a given certificate, the server needs to prove ownership of the associated private key.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/17ArZT2zzy50umQZFOznIA/d0315e3b412ce3c9376ed234f45c1cd0/image8.png" />
            
            </figure><p>Sites obtain digital certificates from trusted third parties called Certificate Authorities (CAs). CAs validate the operator’s ownership of a domain before issuing them a certificate. If the issuing CA for a certificate is trusted by the browser, then that certificate can be used to serve content over HTTPS to visitors of the site. All this happens under the hood of the browser and is only surfaced to user by the little green lock in your address bar, or a nasty error message if things go wrong.</p><p>The Web’s PKI is an elaborate and complicated system. There are dozens of organizations that operate the certificate authorities trusted by popular browsers. Different browsers manage their own “root programs” in which they choose which certificate authorities are trusted. Becoming a trusted CA often requires passing an audit (<a href="https://cabforum.org/webtrust-for-cas/">WebTrust for CAs</a>) and promising to follow a set of rules called the <a href="https://cabforum.org/baseline-requirements-documents/">Baseline Requirements</a>. These rules are set by a standards body called the CA/Browser forum, which consists of browsers and CAs. Each root program has their own application process and program-specific guidelines.</p><p>This system works great, until it doesn’t. As a system of trust, there are many ways for the PKI to fail. One of the risks inherent in the web PKI is that any certificate authority can issue any certificate for any website. That means that the <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=408949">Hong Kong Post Office</a> can issue a certificate valid for gmail.com or facebook.com, and every browser will trust it. This forces users to put a lot of faith in certificate authorities and hope they don’t misbehave by issuing a certificate to the wrong person. Even worse, if a CA gets hacked, then an attacker could issue any certificate without the CA knowing, putting users at an even greater risk.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2DTDhhiLOKMayPifq2JmYH/105d45d24b3aa0fd696b87463792c9b8/image11.png" />
            
            </figure><p>If someone manages to get a certificate for a site that isn’t theirs, they can impersonate that site to its visitors and steal their information. To get a sense of how many CAs are trusted by popular browsers, <a href="https://ccadb-public.secure.force.com/mozilla/IncludedCACertificateReport">here’s the list</a> of the 160 trusted CAs in Firefox. Microsoft and Apple maintain their own lists, which are comparably long (Cloudflare keeps track of these lists in our <a href="https://github.com/cloudflare/cfssl_trust">cfssl_trust</a> repository). By trusting all of these organizations implicitly when you browse the internet, users bear the risk of certificate authority misbehavior.</p><p>What’s missing from the PKI is accountability. If a mis-issued certificate is used to target an individual, there is no feedback mechanism to let anyone know that the CA misbehaved.</p><p>This is not a theoretical situation. In 2011, DigiNotar, a Dutch CA, <a href="https://threatpost.com/final-report-diginotar-hack-shows-total-compromise-ca-servers-103112/77170/">was hacked</a>. The hacker used their access to the CA to issue a certificate for *.google.com. They then attempted to use this certificate to impersonate Gmail and targeted users in Iran in an attempt to compromise their personal information.</p><p>The attack was detected by Google using a technique called public key pinning. Key pinning is a <a href="https://blog.qualys.com/ssllabs/2016/09/06/is-http-public-key-pinning-dead">risky technique</a> and only viable for very technically savvy organizations. The value provided by key pinning is usually overshadowed by the operational risk it introduces. It’s often considered the canonical example of a “foot gun” mechanism. Key pinning is being <a href="https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/he9tr7p3rZ8">deprecated by browsers</a>.</p><p>If key pinning is not the solution, what can be done to detect CA malfeasance? This is where Certificate Transparency comes in. The goal of CT is to make all certificates public so that mis-issued certificates can be detected and appropriate action taken. This helps bring accountability to balance the trust we collectively place in the fragile web PKI.</p>
    <div>
      <h3>Shining a light</h3>
      <a href="#shining-a-light">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2MQoZ8uEfBJZJbMWHSii9u/cd91d06e5206737c49a9ee6b7f2922ef/image12.jpg" />
            
            </figure><p><a href="https://www.pexels.com/@angele-j-35172">Creative Commons Zero (CC0) - angele-j</a></p><p>If all certificates are public, then so are mis-issued certificates. Certificate Transparency brings accountability to the web PKI using a technology called a blockchain an append-only public ledger, an ordered list. It puts trusted certificates into a list and makes that list available to anyone. That sounds easy, but given the decentralized nature of the internet, there are many challenges in making this a reliable bedrock for accountability.</p><p>The CT ecosystem is an extension of the PKI that introduces additional participants and roles. Along with browsers and CAs, new parties are introduced to play a role in the overall health of the system. These parties are:</p><ul><li><p>Log operators</p></li><li><p>Auditors</p></li><li><p>Monitors</p></li></ul><p>At a high level, a <i>log operator</i> is someone who manages the list of certificates than can only be added to. If someone submits a browser-trusted certificate to a log, it must be incorporated into the list within a pre-set grace period called a maximum merge delay (MMD), which is usually 24 hours. The log gives the submitter back a receipt, called a Signed Certificate Timestamp (SCT). An SCT is a promise to include the certificate in the log within the grace period. You can interact with a CT log via the CT API (defined in <a href="https://tools.ietf.org/html/rfc6962">RFC 6962</a>).</p><p>An <i>auditor</i> is a third party that keeps log operators honest. They query logs from various vantage points on the internet and <a href="https://tools.ietf.org/html/draft-ietf-trans-gossip-05">gossip</a> with each other about what order certificates are in. They’re like the paparazzi of the PKI. They also keep track of whether an SCT has been honored or not by measuring the time it took between the SCT’s timestamp and the corresponding certificate showing up in the log. Along with being a dashboard, the Merkle Town backend is also an auditor; it has even <a href="https://groups.google.com/a/chromium.org/forum/#!msg/ct-policy/92HIh2vG6GA/hBEHxcpoCgAJ">detected issues in other logs</a>.</p><p>A <i>monitor</i> is a service that helps alert websites of mis-issuance. It crawls logs for new certificates and alerts website owners if a new certificate is found for their domain. Popular monitors include SSLMate’s <a href="https://sslmate.com/certspotter/">CertSpotter</a> and Facebook’s <a href="https://developers.facebook.com/tools/ct/">Certificate Transparency Monitoring</a>. Cloudflare is planning on offering a free log monitoring service integrated into the Cloudflare dashboard for customers by the end of the year.</p>
    <div>
      <h4>Letting browsers know that certificates are logged</h4>
      <a href="#letting-browsers-know-that-certificates-are-logged">
        
      </a>
    </div>
    <p>One way to push the web to adopt CT is for browsers to start requiring website certificates to be logged. Validating that a certificate is logged by querying logs directly when a connection is made is a potential privacy issue (exposing browser history to a third party), and adds latency. Instead, a better way to ensure that a certificate is logged is to require the server to present SCTs, the inclusion receipts described in the last section.</p><p>There are multiple ways that an SCT can be presented to the client. The most popular way to is to embed the SCTs into the certificate when it’s issued. This involves the CA submitting a pre-certificate, a precursor to a certificate, to various CT logs to obtain SCTs before finalizing the certificate.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1X2MjNCxQqpKMNkwYvVcAh/e9db15c08ddff2447b7132ba98055464/image10.png" />
            
            </figure><p>For certificates that don’t have SCTs embedded, a server has other mechanisms to transmit SCTs to the client. SCTs can be included in the connection as a <a href="https://medium.com/@davetempleton/enabling-a-certificate-transparency-tls-extension-in-nginx-489b3b804f89">TLS extension</a>, or in a <a href="https://en.wikipedia.org/wiki/OCSP_stapling">stapled OCSP response</a>. These mechanisms are more difficult to do reliably, but they allow any certificate to be included in CT.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7a7iZnEIv9yKOif6dS8E79/436ad5a8386f5c8a9f0f471e3e117033/image14.png" />
            
            </figure><p>A certificate with embedded SCTs</p>
    <div>
      <h4>Browser CT requirements</h4>
      <a href="#browser-ct-requirements">
        
      </a>
    </div>
    <p>Not all logs are created equally. A malicious CA could collude with a set of logs to create a certificate and a set of SCTs and not ever incorporate the certificate into the logs. This certificate could then be used to attack users. To protect the ecosystem from collusion risks, the browsers that support CT have chosen to only accept SCTs from a list of vetted logs that are actively audited. There are also diversity requirements: logs should be managed by different entities on different infrastructures to avoid collusion and shared outages. Connections are said to be “CT Qualified” if they provide the client with enough SCTs from vetted logs to suit the risk profile of the certificate.</p><p>In order for a connection to be CT qualified in Chrome, it has to follow Chrome’s <a href="https://github.com/chromium/ct-policy/blob/master/ct_policy.md">CT Policy</a>. For most certificates, this means an SCT needs to be presented for at least one Google and one non-Google log trusted by Chrome. Long-lived certificates more than two SCTs.</p><p>In order to become trusted by Chrome, a CT log must submit itself for inclusion and pass a 90 day monitoring period in which it must pass some stringent requirements including the following:</p><ul><li><p>Have no outage that exceeds an MMD (maximum merge delay) of more than 24 hours</p></li><li><p>Have 99% uptime, with no outage lasting longer than the MMD (as measured by Google)</p></li><li><p>Incorporate a certificate for which an SCT has been issued by the Log within the MMD</p></li><li><p>Maintain the append-only property of the of the Log by providing consistent views of the Merkle Tree at all times and to all parties</p></li></ul><p>The full policy is <a href="https://github.com/chromium/ct-policy/blob/master/log_policy.md">here</a>. The complete list of vetted logs is available <a href="https://www.gstatic.com/ct/log_list/log_list.json">here</a>. Nimbus, Cloudflare’s family of CT logs, was included in Chrome 65, which is the current stable version of the Browser.</p>
    <div>
      <h4>All or nothing</h4>
      <a href="#all-or-nothing">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2gbUWaez8iOEBmGrTpRLtu/f087b62d12e5a27f8f30e178fc621d1f/image2.jpg" />
            
            </figure><p><a href="https://commons.wikimedia.org/wiki/File:CISV_trust_game.JPG">Creative Commons Attribution-Share Alike 3.0 - Gorskiya</a></p><p>CT only protects users if all certificates are logged. If a CA issues a certificate that is not logged in CT and will be trusted by browsers, then users can still be subject to targeted attacks.</p><p>For the last few years, Chrome has <a href="https://www.certificate-transparency.org/ev-ct-plan">required all Extended Validation (EV) certificates</a> to be CT qualified. Cloudflare has been making sure all that connections to Cloudflare are CT Qualified for Chrome and have been since May 2017. This is done using an automatic submission service related to our recent OCSP <a href="/high-reliability-ocsp-stapling/">stapling project</a> and the SCT TLS extension. We monitor whether or not the set of SCTs we provide is conformant with browser policies using the <a href="https://tools.ietf.org/html/draft-ietf-httpbis-expect-ct-03">Expect-CT header</a>, which reports client errors back to our servers. Expect CT is included in every HTTPS response Cloudflare serves.</p><p>This isn’t enough. As long as there are certificates that are trusted by browsers that are not required to be CT Qualified, then users are at risk. This is why the Chrome team announced that they will require Certificate Transparency for all newly issued, publicly trusted certificates starting in <a href="https://groups.google.com/a/chromium.org/forum/#!topic/ct-policy/sz_3W_xKBNY">April 2018</a>.</p>
    <div>
      <h4>Changes for Certificate Authorities</h4>
      <a href="#changes-for-certificate-authorities">
        
      </a>
    </div>
    <p>The safest way to make sure a certificate is always CT qualified when shown to a browser is to embed enough SCTs from vetted logs to conform to the browser’s policy. This is a big operational change for some CAs, because</p><ul><li><p>It adds the additional step of having to understand which SCTs are required for different browsers’ CT policies and keeping up to date with policy changes</p></li><li><p>It adds a step in the issuance process where pre-certificates are to different logs before the certificate is issued</p></li><li><p>Some CT logs may have outages or be slow to respond, so fallback strategies may be required to not delay issuance</p></li></ul><p>If you’re a CA operator and are struggling to implement this or worried about the additional delay caused by submitting pre-certificates to logs, Cloudflare can help. We’re offering an experimental API for CAs that takes pre-certificates and returns a valid set of SCTs for a given certificate. This API handles sorting out the browser policies and leverages <a href="https://www.cloudflare.com/argo/">Argo Smart Routing</a> to return SCTs with as little delay as possible. Please contact our CT team at <a>ct-logs@cloudflare.com</a> if you have any interest in this offering.</p>
    <div>
      <h3>Building a verifiable globally consistent log</h3>
      <a href="#building-a-verifiable-globally-consistent-log">
        
      </a>
    </div>
    <p>The PKI is huge. The <a href="/https-or-bust-chromes-plan-to-label-sites-as-not-secure/">industry-wide push for HTTPS</a> has introduced millions of new certificates into the web PKI. There are over a quarter-billion(!) certificates logged in CT, and this number is growing by almost a million per day. This number is sure to grow as we approach Chrome’s April deadline. Managing a high availability database of this size that you can only add to (a property called append-only) is a substantial engineering challenge.</p><p>The naïve data structure to use for an append-only database is a hash chain. In a hash chain, elements are aligned in order and combined using a <a href="https://simple.wikipedia.org/wiki/Cryptographic_hash_function">one-way hash function</a> like SHA-256. The diagram below describes how a hash chain is created from a list of values d1 to d8. Start with the first element, d1, which is hashed to a value a, which then becomes the head of the chain. Every time an element is added to the chain, a hash function is computed over two inputs: the current chain head and the new element. This hash value become the new chain head. Because one-way hash functions can’t be reversed, it’s computationally infeasible to change a value without it changing the entire chain that has been computed from it. This makes a hash chain’s history very difficult to modify maliciously.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2v25fx7zDjnAqEUvNdLnVU/65bc5aa6933a36cbd7e85d69bcf19a41/image7.gif" />
            
            </figure><p>A hash chain is the optimal data structure for inserting new elements: only one hash needs to be computed for each element added. However, it is not an efficient data structure for validating whether an element is correctly included in a chain given a chain head. In the example below, there are six additional elements (b, d4-d8) needed to validate that d3 is correct on a chain of 8 values. You need approximately n/2 elements to verify an average element in a chain of length n. In computer science terms, this is called “linear scaling.”</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5fq19rbF5uMj1Xb2BRomJj/b4b54a16ca7cb6205b2d1b278a1c9258/image4.gif" />
            
            </figure><p>When building a system, it’s best to try to reduce complexity for the participants involved. For CT, the main participants we care about are the log operator and the auditor. If we were to choose a hash chain as our data structure, the job of the log operator would be easy but that of the auditor would be very hard. We can do better.</p><p>When you ask a computer scientist how to optimize an algorithm, nine out of ten times, the solution they will suggest is to use a tree (the other 1/10 times, they’ll suggest a <a href="https://en.wikipedia.org/wiki/Bloom_filter">Bloom filter</a>). That’s exactly what we can do here. Specifically, we can use a data structure called a Merkle Tree. It’s like a hash chain, but rather than hashing elements in a line, you hash them in pairs.</p><p>For each new element, instead of hashing it into a running total, you arrange the elements into a <a href="https://en.wikipedia.org/wiki/Binary_tree">balanced binary tree</a> and compute the hash of the element with its sibling. This gives you half as many hashes as elements. These hashes are then arranged in pairs and hashed together to create the next level of the tree. This continues until you have one element, the top of the tree; this is called the tree head. Adding a new value to a Merkle tree requires the modification of at most one hash per level in the tree, following the path from the element up to the tree head.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/255yicnSkcbR6yUYKDh3s6/5658e680fd0a965f991bf8e0000e49db/image11.gif" />
            
            </figure><p>The depth of a binary tree is <a href="https://en.wikipedia.org/wiki/Logarithmic_scale">logarithmic</a> with respect to the number of elements. Roughly speaking, if the tree size is 8 = 2^3, then the depth is 4 (= 3+1), if it’s 1024 = 2^10 then the tree depth is 11 (= 10+1), for 1048576 = 2^20 the tree size is 21 (= 20+1). The cost of insertion is at most log_2(size), which is worse than in a hash chain, but generally not too bad.</p><p>What makes the Merkle tree so useful is the efficiency of element validation. Instead of having to compute n/2 hashes like in a hash chain, you only need the elements in the tree that lead you to the root. This is called the co-path. In the diagram below, the co-path is computed for d3.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3LUFI4MfjCHSojuxEyyaPC/11cf7ab9c28fa92fbd799e2e3cdbfeb3/image5.gif" />
            
            </figure><p>The copath consists of one value per level of the tree. The computation necessary to prove that an element is correct (an inclusion proof) is therefore logarithmic, not linear as in the case of a hash tree. Both insertion and validation are cheap relative to the size of the tree, making a Merkle tree the ideal data structure for CT.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2FpSweNBiv0xNDaXT6xZQ2/9e7f2c61b8bce51926a9a6f6346b89fa/image6.png" />
            
            </figure><p>A certificate transparency log is a Merkle tree where the leaf elements are certificates. Each log has a private key that it uses to sign the current tree head at regular intervals. Some CT logs are huge with over a hundred million entries, but because of the efficiency of Merkle trees, inclusion proofs only require around 30 hashes. This structure provides a good balance between the cost to the log operator of adding certificates and the cost to the auditor of validating its consistency.</p>
    <div>
      <h3>Nimbus</h3>
      <a href="#nimbus">
        
      </a>
    </div>
    <p>Our own addition to the log ecosystem is Nimbus. Nimbus is a family of Certificate Transparency logs with an open acceptance policy. Nimbus accepts any certificate that is signed by a CA from our <a href="https://github.com/cloudflare/cfssl_trust">cfssl_trust</a> root store. The logs are organized by year, e.g. Nimbus 2018, Nimbus 2019, etc. with each log only accepting certificates that expire in that year.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2yxv4DH2K2TDPjxlI6DUbG/6292fc800aa8db6382ab4427eecd15ef/image8-1.png" />
            
            </figure><p>Nimbus is built with <a href="https://github.com/google/trillian">Trillian</a>, a Go-based implementation of a scalable Merkle tree. The data backend is custom, re-using components from Cloudflare’s high <a href="/how-cloudflare-analyzes-1m-dns-queries-per-second/">capacity logging infrastructure</a>, which runs entirely on Cloudflare’s bare metal infrastructure. Having a high-reliability and completely open log that is not dependent on shared cloud infrastructure adds insurance in case of outages. Nimbus is intended to bring diversity and stability to the CT ecosystem, and in the end, make the internet safer for everyone.</p> ]]></content:encoded>
            <category><![CDATA[Certificate Authority]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[HTTPS]]></category>
            <category><![CDATA[SSL]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Cryptography]]></category>
            <category><![CDATA[Certificate Transparency]]></category>
            <guid isPermaLink="false">6R7Ib63o9iMkS1CgcMXOr1</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Why TLS 1.3 isn't in browsers yet]]></title>
            <link>https://blog.cloudflare.com/why-tls-1-3-isnt-in-browsers-yet/</link>
            <pubDate>Tue, 26 Dec 2017 20:30:00 GMT</pubDate>
            <description><![CDATA[ Upgrading a security protocol in an ecosystem as complex as the Internet is difficult. You need to update clients and servers and make sure everything in between continues to work correctly. The Internet is in the middle of such an upgrade right now.  ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4X5RY5RIBFMtAApEoeXPqO/accd858973a81426156cbde6907b0b09/split-1.jpg" />
            
            </figure><p>Upgrading a security protocol in an ecosystem as complex as the Internet is difficult. You need to update clients and servers and make sure everything in between continues to work correctly. The Internet is in the middle of such an upgrade right now. Transport Layer Security (TLS), the protocol that keeps web browsing confidential (and many people persist in calling SSL), is getting its first major overhaul with the introduction of TLS 1.3. Last year, Cloudflare was the first major provider to support <a href="/introducing-tls-1-3/">TLS 1.3</a> by default on the server side. We expected the client side would follow suit and be enabled in all major browsers soon thereafter. It has been over a year since Cloudflare’s TLS 1.3 launch and still, none of the major browsers have enabled TLS 1.3 by default.</p><p>The reductive answer to why TLS 1.3 hasn’t been deployed yet is <i>middleboxes</i>: network appliances designed to monitor and sometimes intercept HTTPS traffic inside corporate environments and mobile networks. Some of these middleboxes implemented TLS 1.2 incorrectly and now that’s blocking browsers from releasing TLS 1.3. However, simply blaming network appliance vendors would be disingenuous. The deeper truth of the story is that TLS 1.3, as it was originally designed, was incompatible with the way the Internet has evolved over time. How and why this happened is the multifaceted question I will be exploring in this blog post.</p><p>To help support this discussion with data, we built a tool to help check if your network is compatible with TLS 1.3:<a href="https://tls13.mitm.watch/">https://tls13.mitm.watch/</a></p>
    <div>
      <h3>How version negotiation used to work in TLS</h3>
      <a href="#how-version-negotiation-used-to-work-in-tls">
        
      </a>
    </div>
    <p>The Transport Layer Security protocol, TLS, is the workhorse that enables secure web browsing with HTTPS. The TLS protocol was adapted from an earlier protocol, Secure Sockets Layer (SSL), in the late 1990s. TLS currently has three versions: 1.0, 1.1 and 1.2. The protocol is very flexible and can evolve over time in different ways. Minor changes can be incorporated as <a href="https://blog.susanka.eu/what-are-tls-extensions/">“extensions”</a> (such as OCSP and Certificate Transparency) while larger and more fundamental changes often require a new version. TLS 1.3 is by far the largest change to the protocol in its history, completely revamping the cryptography and introducing features like <a href="/introducing-0-rtt/">0-RTT</a>.</p><p>Not every client and server support the same version of TLS—that would make it impossible to upgrade the protocol—so most support multiple versions simultaneously. In order to agree on a common version for a connection, clients and servers negotiate. TLS version negotiation is very simple. The client tells the server the <i>newest</i> version of the protocol that it supports and the server replies back with the newest version of the protocol that they both support.</p><p>Versions in TLS are represented as two-byte values. Since TLS was adapted from SSLv3, the literal version numbers used in the protocol were just increments of the minor version:SSLv3 is 3.0TLS 1.0 is 3.1TLS 1.1 is 3.2TLS 1.2 is 3.3, etc.</p><p>When connecting to a server with TLS, the client sends its highest supported version at the beginning of the connection:</p>
            <pre><code>(3, 3) → server</code></pre>
            <p>A server that understands the same version can reply back with a message starting with the same version bytes.</p>
            <pre><code>(3, 3) → server
client ← (3, 3)</code></pre>
            <p>Or, if the server only knows an older version of the protocol, it can reply with an older version. For example, if the server only speaks TLS 1.0, it can reply with:</p>
            <pre><code>(3, 3) → server
client ← (3, 1)</code></pre>
            <p>If the client supports the version returned by the server then they continue using that version of TLS and establish a secure connection. If the client and server don’t share a common version, the connection fails.</p><p>This negotiation was designed to be future-compatible. If a client sends higher version than the server supports, the server should still be able to reply with whatever version the server supports. For example, if a client sends (3, 8) to a modern-day TLS 1.2-capable server, it should just reply back with (3,3) and the handshake will continue as TLS 1.2.</p><p>Pretty simple, right? As it turns out, some servers didn’t implement this correctly and this led to a chain of events that exposed web users to a serious security vulnerability.</p>
    <div>
      <h3>POODLE and the downgrade dance</h3>
      <a href="#poodle-and-the-downgrade-dance">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4fK2Yxs4OrlHhnpuqcLms4/b04f3af721d9c19fb5f19f40a31f4360/poodle-6102_960_720.jpg" />
            
            </figure><p><a href="https://pixabay.com/en/poodle-metal-iron-silhouette-6102/">CC0 Creative Commons</a></p><p>The last major upgrade to TLS was the introduction of TLS 1.2. During the roll-out of TLS 1.2 in browsers, it was found that some TLS 1.0 servers did not implement version negotiation correctly. When a client connected with a TLS connection advertising support for TLS 1.2, the faulty servers would disconnect instead of negotiating a version of TLS that they understood (like TLS 1.0).</p><p>Browsers had three options to deal with this situation</p><ol><li><p>enable TLS 1.2 and a percentage of websites would stop working</p></li><li><p>delay the deployment of TLS 1.2 until these servers are fixed</p></li><li><p>retry with an older version of TLS if the connection fails</p></li></ol><p>One expectation that people have about their browsers is that when they are updated, websites keep working. The number of misbehaving servers was far too numerous to just break with an update, eliminating option 1). By this point, TLS 1.2 had been around for a year, and still, servers were still broken waiting longer wasn’t going to solve the situation, eliminating option 2). This left option 3) as the only viable choice.</p><p>To both enable TLS 1.2 and keep their users happy, most browsers implemented what’s called an “insecure downgrade”. When faced with a connection failure when connecting to a site, they would try again with TLS 1.1, then with TLS 1.0, then if that failed, SSLv3. This downgrade logic “fixed” these broken servers... at the cost of a slow connection establishment. ?</p><p>However, insecure downgrades are called <i>insecure</i> for a reason. Client downgrades are triggered by a specific type of network failure, one that can be easily spoofed. From the client’s perspective, there’s no way to tell if this failure was caused by a faulty server or by an attacker who happens to be on the path of the connection network. This means that network attackers can inject fake network failures and trick a client into connecting to a server with SSLv3, even if both support a newer protocol. At this point, there were no severe publicly-known vulnerabilities in SSLv3, so this didn’t seem like a big problem. Then POODLE happened.</p><p>In October 2014, Bodo Möller published <a href="https://security.googleblog.com/2014/10/this-poodle-bites-exploiting-ssl-30.html">POODLE</a>, a serious vulnerability in the SSLv3 protocol that allows an in-network attacker to reveal encrypted information with minimal effort. Because TLS 1.0 was so widely deployed on both clients and servers, very few connections on the web used SSLv3, which should have kept them safe. However, the insecure downgrade feature made it possible for attackers to downgrade any connection to SSLv3 if both parties supported it (which most of them did). The availability of this “downgrade dance” vector turned the risk posed by POODLE from a curiosity into a serious issue affecting most of the web.</p>
    <div>
      <h3>Fixing POODLE and removing insecure downgrade</h3>
      <a href="#fixing-poodle-and-removing-insecure-downgrade">
        
      </a>
    </div>
    <p>The fixes for POODLE were:</p><ol><li><p>disable SSLv3 on the client or the server</p></li><li><p>enable a new TLS feature called <a href="https://tools.ietf.org/html/rfc7507">SCSV</a>.</p></li></ol><p>SCSV was conveniently proposed by Bodo Möller and Adam Langley a few months before POODLE. Simply put, with SCSV the client adds an indicator, called a <i>downgrade canary</i>, into its client hello message if it is retrying due to a network error. If the server supports a newer version than the one advertised in the client hello and sees this canary, it can assume a downgrade attack is happening and close the connection. This is a nice feature, but it is optional and requires both clients and servers to update, leaving many web users exposed.</p><p>Browsers immediately removed support for SSLv3, with very little impact other than breaking some SSLv3-only websites. Users with older browsers had to depend on web servers disabling SSLv3. Cloudflare <a href="/sslv3-support-disabled-by-default-due-to-vulnerability/">did this immediately</a> for its customers, and so did most sites, but even in late 2017 <a href="https://www.ssllabs.com/ssl-pulse/">over 10% of sites measured by SSL Pulse still support SSLv3</a>.</p><p>Turning off SSLv3 was a feasible solution to POODLE because SSLv3 was not critical to the Internet. This raises the question: what happens if there’s a serious vulnerability in TLS 1.0? TLS 1.0 is still very widely used and depended on, turning it off in the browser would lock out around 10% of users. Also, despite SCSV being a nice solution to insecure downgrades, <a href="https://www.ssllabs.com/ssl-pulse/">many servers don’t support it</a>. The only option to ensure the safety of users against a future issue in TLS 1.0 is to disable insecure fallback.</p><p>After several years of bad performance due to the client having to reconnect multiple times, the majority of the websites that did not implement version negotiation correctly fixed their servers. This made it possible for some browsers to remove this insecure fallback:<a href="https://www.mozilla.org/en-US/firefox/37.0/releasenotes/">Firefox in 2015</a>, and <a href="https://developers.google.com/web/updates/2016/03/chrome-50-deprecations#remove_insecure_tls_version_fallback">Chrome in 2016</a>. Because of this, Chrome and Firefox users are now in a safer position in the event of a new TLS 1.0 vulnerability.</p>
    <div>
      <h3>Introducing a new version (again)</h3>
      <a href="#introducing-a-new-version-again">
        
      </a>
    </div>
    <p>Designing a protocol for future compatibility is hard, it’s easy to make mistakes if there isn’t a feedback mechanism. This is the case of TLS version negotiation: nothing breaks if you implement it wrong, just hypothetical future versions. There is no signal to developers that an implementation is flawed, and so mistakes can happen without being noticed. That is, until a new version of the protocol is deployed and your implementation fails, but by then the code is deployed and it could take years for everyone to upgrade. The fact that some server implementations failed to handle a “future” version of TLS correctly should have been expected.</p><p>TLS version negotiation, though simple to explain, is actually an example of a protocol design antipattern. It demonstrates a phenomenon in protocol design called <i>ossification</i>. If a protocol is designed with a flexible structure, but that flexibility is never used in practice, some implementation is going to assume it is constant. Adam Langley <a href="https://www.imperialviolet.org/2014/02/27/tlssymmetriccrypto.html">compares the phenomenon to rust</a>. If you rarely open a door, its hinge is more likely to rust shut. Protocol negotiation in TLS is such a hinge.</p><p>Around the time of TLS 1.2’s deployment, the discussions around designing an ambitious new version of TLS were beginning. It was going to be called TLS 1.3, and the version number was naturally chosen as 3.4 (or (3, 4)). By mid-2016, the TLS 1.3 draft had been through 15 iterations, and the version number and negotiation were basically set. At this point, browsers had removed the insecure fallback. It was assumed that servers that weren’t able to do TLS version negotiation correctly had already learned the lessons of POODLE and finally implemented version negotiation correctly. This turned out to not be the case. Again.</p><p>When presented with a client hello with version 3.4, a large percentage of TLS 1.2-capable servers would disconnect instead of replying with 3.3. Internet scans by Hanno Böck, David Benjamin, SSL Labs, and others confirmed that the failure rate for TLS 1.3 was very high, over 3% in many measurements. This was the exact same situation faced during the upgrade to TLS 1.2. History was repeating itself.</p><p>This unexpected setback caused a crisis of sorts for the people involved in the protocol’s design. Browsers did not want to re-enable the insecure downgrade and fight the uphill battle of oiling the protocol negotiation joint again for the next half-decade. But without a downgrade, using TLS 1.3 as written would break 3% of the Internet for their users. What could be done?</p><p>The controversial choice was to accept a proposal from David Benjamin to make the first TLS 1.3 message (the client hello) look like it TLS 1.2. The version number from the client was changed back to (3, 3) and a new “version” extension was introduced with the list of supported versions inside. The server would return a server hello starting with (3, 4) if TLS 1.3 was supported and (3, 3) or earlier otherwise. Draft 16 of TLS 1.3 contained this new and “improved” protocol negotiation logic.</p><p>And this worked. Servers for the most part were tolerant to this change and easily fell back to TLS 1.2, ignoring the new extension. But this was not the end of the story. Ossification is a fickle phenomenon. It not only affects clients and servers, but it also affects everything on the network that interacts with a protocol.</p>
    <div>
      <h3>The real world is full of middleboxes</h3>
      <a href="#the-real-world-is-full-of-middleboxes">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/47fsWCuUoGyhvHj0mKoSxg/ae37b8a52bfff83574e2b59ce7d6481e/Ramen_Box_Wall_at_Anime_Midwest_2014.jpg" />
            
            </figure><p><a href="https://en.wikipedia.org/wiki/File:Ramen_Box_Wall_at_Anime_Midwest_2014.jpg">CC BY-SA 3.0</a></p><p>Readers of our blog may remember a post from earlier this year on <a href="/understanding-the-prevalence-of-web-traffic-interception/">HTTPS interception</a>. In it, we discussed a study that measured how many “secure” HTTPS connections were actually intercepted and decrypted by inspection software or hardware somewhere in between the browser and the web server. There are also passive inspection middleboxes that parse TLS and either block or divert the connections based on visible data, such as ISPs that use hostname information (<a href="https://en.wikipedia.org/wiki/Server_Name_Indication">SNI</a>) from TLS connections to block “banned” websites.</p><p>In order to inspect traffic, these network appliances need to implement some or all of TLS. Every new device that supports TLS introduces a TLS implementation that makes assumption about how the protocol should act. The more implementations there are, the more likely it is that ossification occurs.</p><p>In February of 2017, both Chrome and Firefox started enabling TLS 1.3 for a percentage of their customers. The results were unexpectedly horrible. A much higher percentage of TLS 1.3 connections were failing than expected. For some users, no matter what the website, TLS 1.2 worked but TLS 1.3 did not.</p><p>Success rates for TLS 1.3 Draft 18</p>
            <pre><code>Firefox &amp; Cloudflare
97.8% for TLS 1.2
96.1% for TLS 1.3

Chrome &amp; Gmail
98.3% for TLS 1.2
92.3% for TLS 1.3</code></pre>
            <p>After some investigation, it was found that some widely deployed middleboxes, both of the intercepting and passive variety, were causing connections to fail.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/69FNZ8lQO5MBFxPjmGPYfm/8d337aa54dd37e517bbf8be988022f49/image1-1.png" />
            
            </figure><p>Because TLS has generally looked the same throughout its history, some network appliances made assumptions about how the protocol would evolve over time. When faced with a new version that violated these assumptions, these appliances fail in various ways.</p><p>Some features of TLS that were changed in TLS 1.3 were merely cosmetic. Things like the ChangeCipherSpec, session_id, and compression fields that were part of the protocol since SSLv3 were removed. These fields turned out to be considered essential features of TLS to some of these middleboxes, and removing them caused connection failures to skyrocket.</p><p>If a protocol is in use for a long enough time with a similar enough format, people building tools around that protocol will make assumptions around that format being constant. This is often not an intentional choice by developers, but an unintended consequence of how a protocol is used in practice. Developers of network devices may not understand every protocol used on the internet, so they often test against what they see on the network. If a part of a protocol that is supposed to be flexible never changes in practice, someone will assume it is a constant. This is more likely the more implementations are created.</p><p>It would be disingenuous to put all of the blame for this on the specific implementers of these middleboxes. Yes, they created faulty implementations of TLS, but another way to think about it is that the original design of TLS lent itself to this type of failure. Implementers implement to the reality of the protocol, not the intention of the protocol’s designer or the text of the specification. In complex ecosystems with multiple implementers, unused joints rust shut.</p><p>Removing features that have been part of a protocol for 20 years and expecting it to simply “work” was wishful thinking.</p>
    <div>
      <h3>Making TLS 1.3 work</h3>
      <a href="#making-tls-1-3-work">
        
      </a>
    </div>
    <p>At the IETF meeting in Singapore last month, a new change was proposed to TLS 1.3 to help resolve this issue. These changes were based on an idea from Kyle Nekritz of Facebook: make TLS 1.3 look like TLS 1.2 to middleboxes. This change re-introduces many of the parts of the protocol that were removed (session_id, ChangeCipherSpec, an empty compression field), and introduces some other changes that make TLS 1.3 look like TLS 1.2 in all the ways that matter to the broken middleboxes.</p><p>Several iterations of these changes were developed by <a href="/make-ssl-boring-again/">BoringSSL</a> and tested in Chrome over a series of months. Facebook also performed some similar experiments and the two teams converged on the same set of changes.</p><p>Chrome Experiment Success Rates</p>
            <pre><code>TLS 1.2 - 98.6%
Experimental changes (PR 1091 on Github) - 98.8%</code></pre>
            <p>Firefox Experiment Success Rates</p>
            <pre><code>TLS 1.2 - 98.42%
Experimental changes (PR 1091 on Github) - 98.37%</code></pre>
            <p>These experiments showed that is was possible to modify TLS 1.3 to be compatible with middleboxes. They also demonstrated the ossification phenomenon. As we described in a previous section, the only thing that could have rusted shut in the client hello, the version negotiation, rusted shut. This resulted in Draft 16, which moved the version negotiation to an extension. As an intermediary between the client and the server, middleboxes also care about the server hello message. This message had many more hinges that were thought to be flexible but turned out weren’t. Almost all of these had rusted shut. The new “middlebox-friendly” changes took this reality into account. These experimental changes were incorporated into the specification in <a href="https://tools.ietf.org/html/draft-ietf-tls-tls13-22">TLS 1.3 Draft 22</a>.</p>
    <div>
      <h3>Making sure this doesn’t happen again</h3>
      <a href="#making-sure-this-doesnt-happen-again">
        
      </a>
    </div>
    <p>The original protocol negotiation mechanism is unrecoverably burnt. That means it likely can’t be used in a future version of TLS without significant breakage. However, many of the other protocol negotiation features are still flexible, such as ciphersuites selection and extensions. It would be great to keep it this way.</p><p>Last year, Adam Langley wrote a great blog post about cryptographic protocol design (<a href="https://www.imperialviolet.org/2016/05/16/agility.html">https://www.imperialviolet.org/2016/05/16/agility.html</a>) that covers similar ground as this blog post. In his post, he proposes the adage “have one joint and keep it well oiled.” This is great advice for protocol designers. Ossification is real, as we have seen in TLS 1.3.</p><p>Along these lines, David Benjamin proposed a way to keep the most important joints in TLS oiled. His <a href="https://tools.ietf.org/html/draft-ietf-tls-grease-00">GREASE proposal</a> for TLS is designed to throw in random values where a protocol should be tolerant of new values. If popular implementations intersperse unknown ciphers, extensions and versions in real-world deployments, then implementers will be forced to handle them correctly. GREASE is like WD-40 for the Internet.</p><p>One thing to note is that GREASE is intended to prevent servers from ossifying, not middleboxes, so there is still potential for more types of greasing to happen in TLS.</p><p>Even with GREASE, some servers were only found to be intolerant to TLS 1.3 as late as December 2017. GREASE only identifies servers that are intolerant to unknown extensions, but some servers may still be intolerant to specific extension ids. For example, RSA's BSAFE library used the extension id 40 for an experimental extension called "extended_random", associated with a <a href="/how-the-nsa-may-have-put-a-backdoor-in-rsas-cryptography-a-technical-primer/">theorized NSA backdoor</a>. Extension id 40 happens to be the extension id used for TLS 1.3 key shares. David Benjamin <a href="https://www.ietf.org/mail-archive/web/tls/current/msg25168.html">reported</a> that this library is still in use by some printers, which causes them to be TLS 1.3 intolerant. Matthew Green has a <a href="https://blog.cryptographyengineering.com/2017/12/19/the-strange-story-of-extended-random/">detailed write-up</a> of this compatibility issue.</p>
    <div>
      <h3>Help us understand the issue</h3>
      <a href="#help-us-understand-the-issue">
        
      </a>
    </div>
    <p>Cloudflare has been working with the Mozilla Firefox team to help measure this phenomenon, and Google and Facebook have been doing their own measurements. These experiments are hard to perform because the developers need to get protocol variants into browsers, which can take the entire release cycle of the browser (often months) to get into the hands of the users seeing issues. Cloudflare now supports the latest (hopefully) middlebox-compatible TLS 1.3 draft version (draft 22), but there’s always a chance we find a middlebox that is incompatible with this version.</p><p>To sidestep the browser release cycle, we took a shortcut. We <a href="https://tls13.mitm.watch">built a website</a> that you can use to see if TLS 1.3 works from your browser’s vantage point. This test was built by our Crypto intern, Peter Wu. It uses Adobe Flash, because that’s the only widespread cross-platform way to get access to raw sockets from a browser.</p><p>How it works:</p><ul><li><p>We cross-compiled our Golang-based TLS 1.3 client library (tls-tris) to JavaScript</p></li><li><p>We build a JavaScript library (called jssock) that implements tls-tris on the low-level socket interface network exposed through Adobe Flash</p></li><li><p>We connect to a remote server using TLS 1.2 and TLS 1.3 and compare the results</p></li></ul><p>If there is a mismatch, we gather information from the connection on both sides and send it back for analysis</p><p>If you see a failure, <a>let us know</a>! If you’re in a corporate environment, share the middlebox information, if you’re on a residential network, tell us who your ISP is.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7Axq62MNEuKIwQmxQtCTi6/d91d0f0e56f705c4f89271f3e3776b26/Screen-Shot-2017-12-26-at-11.14.28-AM.jpg" />
            
            </figure><p>We’re excited for TLS 1.3 to finally be enabled by default in browsers. This experiment will hopefully help prove that the latest changes make it safe for users to upgrade.</p> ]]></content:encoded>
            <category><![CDATA[TLS]]></category>
            <category><![CDATA[TLS 1.3]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">5kv7ooxy0pFmxIAkvDxFsB</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare supports Privacy Pass]]></title>
            <link>https://blog.cloudflare.com/cloudflare-supports-privacy-pass/</link>
            <pubDate>Thu, 09 Nov 2017 16:00:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare supports Privacy Pass, a recently-announced privacy-preserving protocol developed in collaboration with researchers from Royal Holloway and the University of Waterloo.  ]]></description>
            <content:encoded><![CDATA[ <p></p>
    <div>
      <h3>Enabling anonymous access to the web with privacy-preserving cryptography</h3>
      <a href="#enabling-anonymous-access-to-the-web-with-privacy-preserving-cryptography">
        
      </a>
    </div>
    <p>Cloudflare supports Privacy Pass, a <a href="https://medium.com/@alxdavids/privacy-pass-6f0acf075288">recently-announced</a> privacy-preserving protocol developed in collaboration <a href="https://privacypass.github.io">with researchers from Royal Holloway and the University of Waterloo</a>. Privacy Pass leverages an idea from cryptography — zero-knowledge proofs — to let users prove their identity across multiple sites anonymously without enabling tracking. Users can now use the Privacy Pass browser extension to reduce the number of challenge pages presented by Cloudflare. We are happy to support this protocol and believe that it will help improve the browsing experience for some of the Internet’s least privileged users.</p><p>The Privacy Pass extension is available for both <a href="https://chrome.google.com/webstore/detail/privacy-pass/ajhmfdgkijocedmfjonnpjfojldioehi">Chrome</a> and <a href="https://addons.mozilla.org/en-US/firefox/addon/privacy-pass/">Firefox</a>. When people use anonymity services or shared IPs, it makes it more difficult for <a href="https://www.cloudflare.com/learning/security/how-to-secure-a-website/">website protection services</a> like Cloudflare to identify their requests as coming from legitimate users and not bots. Privacy Pass helps reduce the friction for these users—which include some of the most vulnerable users online—by providing them a way to prove that they are a human across multiple sites on the Cloudflare network. This is done without revealing their identity, and without exposing Cloudflare customers to additional threats from malicious bots. As the first service to support Privacy Pass, we hope to help demonstrate its usefulness and encourage more Internet services to adopt it.</p><p>Adding support for Privacy Pass is part of a broader initiative to help make the Internet accessible to as many people as possible. Because Privacy Pass will only be used by a small subset of users, we are also working on other improvements to our network in service of this goal. For example, we are making improvements in our request categorization logic to better identify bots and to improve the web experience for legitimate users who are negatively affected by Cloudflare’s current bot protection algorithms. As this system improves, users should see fewer challenges and site operators should see fewer requests from unwanted bots. We consider Privacy Pass a piece of this puzzle.</p><p>Privacy Pass is fully open source under a BSD license and the code is available <a href="https://github.com/privacypass/challenge-bypass-extension">on GitHub</a>. We encourage anyone who is interested to download the source code, play around with the implementations and contribute to the project. The Pass Team have also open sourced a <a href="https://github.com/privacypass/challenge-bypass-server">reference implementation of the server</a> in Go if you want to test both sides of the system. Privacy Pass support at Cloudflare is currently in beta. If you find a bug, please let the team know by creating an issue on GitHub.</p><p>In this blog post I'll be going into depth about the problems that motivated our support for this project and how you can use it to reduce the annoyance factor of CAPTCHAs and other user challenges online.</p>
    <div>
      <h3>Enabling universal access to content</h3>
      <a href="#enabling-universal-access-to-content">
        
      </a>
    </div>
    <p>Cloudflare believes that the <a href="/ensuring-that-the-web-is-for-everyone/">web is for everyone</a>. This includes people who are accessing the web anonymously or through shared infrastructure. Tools like VPNs are useful for protecting your identity online, and people using these tools should have the same access as everyone else. We believe the vast collection of information and services that make up the Internet should be available to every person.</p><p>In a <a href="/the-trouble-with-tor/">blog post last year</a>, our CEO, Matthew Prince, spoke about the tension between security, anonymity, and convenience on the Internet. He posited that in order to secure a website or service while still allowing anonymous visitors, you have to sacrifice a bit of convenience for these users. This tradeoff is something that every website or web service has to make.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1rTJ4tISNkUI4x5SxAZIWU/3a9ad7898fa4811504aeb44db6b168d2/image5.jpg" />
            
            </figure><p>The Internet is full of bad actors. The frequency and severity of online attacks is <a href="http://techspective.net/2017/08/12/latest-ddos-trends-learning-experts/">rising every year</a>. This turbulent environment not only threatens websites and web services with attacks, it threatens their ability to stay online. As smaller and more diverse sites become targets of anonymous threats, a greater percentage of the Internet will choose to sacrifice user convenience in order to stay secure and universally accessible.</p><p>The average Internet user visits dozens of sites and services every day. Jumping through a hoop or two when trying to access a single website is not that big of a problem for people. Having to do that for every site you visit every day can be exhausting. This is the problem that Privacy Pass is perfectly designed to solve.</p><p>Privacy Pass doesn’t completely eliminate this inconvenience. Matthew’s trilemma still applies: anonymous users are still inconvenienced for sites that want security. What Privacy Pass does is to notably reduce that inconvenience for users with access to a browser. Instead of having to be inconvenienced thirty times to visit thirty different domains, you only have to be inconvenienced once to gain access to thirty domains on the Cloudflare network. Crucially, unlike unauthorized services like <a href="https://addons.mozilla.org/firefox/addon/cloudhole/">CloudHole</a>, Privacy Pass is designed to respect user privacy and anonymity. This is done using privacy-preserving cryptography, which prevents Cloudflare or anyone else from tracking a user’s browsing across sites. Before we go into how this works, let’s take a step back and take a look at why this is necessary.</p>
    <div>
      <h3>Am I a bot or not?</h3>
      <a href="#am-i-a-bot-or-not">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/43zt4JxSv0HW37HA0mfbpj/35736e017d0903dc6c0a89e135635e67/image2.jpg" />
            
            </figure><p><a href="https://commons.wikimedia.org/wiki/File:Metal_House_Battery_Operated_New_2010_Robots_You_are_Three_Times_a_Robot~~.jpg">D J Shin</a> Creative Commons Attribution-Share Alike 3.0 Unported</p><p>Without explicit information about the identity of a user, a web server has to rely on fuzzy signals to guess which request is from a bot and which is from a human. For example, bots often use automated scripts instead of web browsers to do their crawling. The way in which scripts make web requests is often different than how web browsers would make the same request in subtle ways.</p><p>A simple way for a user to prove they are not a bot to a website is by logging in. By providing valid authentication credentials tied to a long-term identity, a user is exchanging their anonymity for convenience. Having valid authentication credentials is a strong signal that a request is not from a bot. Typically, if you authenticate yourself to a website (say by entering your username and password) the website sets what’s called a “cookie”. A cookie is just a piece of data with an expiration date that’s stored by the browser. As long as the cookie hasn’t expired, the browser includes it as part of the subsequent requests to the server that set it. Authentication cookies are what websites use to know whether you’re logged in or not. Cookies are only sent on the domain that set them. A cookie set by site1.com is not sent for requests to site2.com. This prevents identity leakage from one site to another.</p><p>A request with an authentication cookie is usually not from a bot, so bot detection is much easier for sites that require authentication. Authentication is by definition de-anonymizing, so putting this in terms of Matthew’s trilemma, these sites can have security and convenience because they provide no anonymous access. The web would be a very different place if every website required authentication to display content, so this signal can only be used for a small set of sites. The question for the rest of the Internet becomes: without authentication cookies, what else can be used as a signal that a user is a person and not a bot?</p>
    <div>
      <h3>The Turing Test</h3>
      <a href="#the-turing-test">
        
      </a>
    </div>
    <p>One thing that can be used is a user challenge: a task that the server asks the user to do before showing content. User challenges can come in many forms, from a <a href="https://en.wikipedia.org/wiki/Proof-of-work_system">proof-of-work</a> to a <a href="https://en.wikipedia.org/w/index.php?title=Guided_tour_puzzle_protocol">guided tour puzzle</a> to the classic CAPTCHA. A CAPTCHA (an acronym for "Completely Automated Public Turing test to tell Computers and Humans Apart") is a test to see if the user is a human or not. It often involves reading some scrambled letters or identifying certain slightly obscured objects — tasks that humans are generally better at than automated programs. The goal of a user challenge is not only to deter bots, but to gain confidence that a visitor is a person. Cloudflare uses a combination of different techniques as user challenges.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2VcN8gtQWsULtIcGMggqDJ/c51be6c6bb97edf8836d04b2542a4f63/image7.jpg" />
            
            </figure><p>CAPTCHAs can be annoying and time-consuming to solve, so they are usually reserved for visitors with a high probability of being malicious.</p><p>The challenge system Cloudflare uses is cookie-based. If you solve a challenge correctly, Cloudflare will set a cookie called <code>CF_CLEARANCE</code> for the domain that presented the challenge. Clearance cookies are like authentication cookies, but instead of being tied to an identity, they are tied to the fact that you solved a challenge sometime in the past.</p><ol><li><p>Person sends Request</p></li><li><p>Server responds with a challenge</p></li><li><p>Person sends solution</p></li><li><p>Server responds with <code>set-cookie</code> and bypass cookie</p></li><li><p>Person sends new request with cookie</p></li><li><p>Server responds with content from origin</p></li></ol><p>Site visitors who are able to solve a challenge are much more likely to be people than bots, the harder the challenge, the more likely the visitor is a person. The presence of a valid <code>CF_CLEARANCE</code> cookie is a strong positive signal that a request is from a legitimate person.</p>
    <div>
      <h3>How Privacy Pass protects your privacy: a voting analogy</h3>
      <a href="#how-privacy-pass-protects-your-privacy-a-voting-analogy">
        
      </a>
    </div>
    <p>You can use cryptography to prove that you have solved a challenge of a certain difficulty without revealing which challenge you solved. The technique that enables this is something called a <a href="https://en.wikipedia.org/wiki/Zero-knowledge_proof">Zero-knowledge proof</a>. This may sound scary, so let’s use a real-world scenario, vote certification, to explain the idea.</p><p>In some voting systems the operators of the voting center certify every ballot before sending them to be counted. This is to prevent people from adding fraudulent ballots while the ballots are being transferred from where the vote takes place to where the vote is counted.</p><p>An obvious mechanism would be to have the certifier sign every ballot that a voter submits. However, this would mean that the certifier, having just seen the person that handed them a ballot, would know how each person voted. Instead, we can use a better mechanism that preserves voters’ privacy using an envelope and some carbon paper.</p><ol><li><p>The voter fills out their ballot</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3jJCdqzHAp2kJrLYM3sYCT/5cfc32ff560877037977e7530faf1929/image6.png" />
            
            </figure></li><li><p>The voter puts their ballot into an envelope along with a piece of carbon paper, and seals the envelope</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7z8pR9zhr9HYM4OE9y2r4f/26fc8bcb4a1e4c92637cfc5b0f6ea0fb/image1.png" />
            
            </figure></li><li><p>The sealed envelope is given to the certifier</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3OhNebQdBXnoTBrBOTcDN9/54ad9db17b0956adc0a973f9a4d56b6b/image3.png" />
            
            </figure></li><li><p>The certifier signs the outside of the envelope. The pressure of the signature transfers the signature from the carbon paper to the ballot itself, effectively signing the ballot.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/fOvx6CrNvdsaPofVLPgPG/c33497b10a9212634b63c0bb349809dc/image8.png" />
            
            </figure></li><li><p>Later, when the ballot counter unseals the envelope, they see the certifier’s signature on the ballot.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4FSldNuKdhhv537vDigZtp/c35bd412ad8c468d9b2068149afef072/image4.png" />
            
            </figure></li></ol><p>With this system, a voting administrator can authenticate a ballot without knowing its content, and then the ballot can be verified by an independent assessor.</p><p>Privacy Pass is like vote certification for the Internet. In this analogy, Cloudflare’s challenge checking service is the vote certifier, Cloudflare’s bot detection service is the vote counter and the anonymous visitor is the voter. When a user encounters a challenge on site A, they put a ballot into a sealed envelope and send it to the server along with the challenge solution. The server then signs the envelope and returns it to the client. Since the server is effectively signing the ballot without knowing its contents, this is called a <i>blind signature</i>.</p><p>When the user sees a challenge on site B, the user takes the ballot out of the envelope and sends it to the server. The server then checks the signature on the ballot, which proves that the user has solved a challenge. Because the server has never seen the contents of the ballot, it doesn’t know which site the challenge was solved for, just that a challenge was solved.</p><p>It turns out that with the right cryptographic construction, you can approximate this scenario digitally. This is the idea behind Privacy Pass.</p><p>The Privacy Pass team implemented this using a privacy-preserving cryptographic construction called an Elliptic Curve Verifiable Oblivious Pseudo-Random Function (EC-VOPRF). Yes, it’s a mouthful. From the Privacy Pass Team:</p><blockquote><p>Every time the Privacy Pass plugin needs a new set of privacy passes, it creates a set of thirty random numbers <code>t1</code> to <code>t30</code>, hashes them into a curve (P-256 in our case), blinds them with a value <code>b</code> and sends them along with a challenge solution. The server returns the set of points multiplied by its private key and a batch discrete logarithm equivalence proof. Each pair <code>tn, HMAC(n,M)</code> constitutes a Privacy Pass and can be redeemed to solve a subsequent challenge. Voila!</p></blockquote><p>If none of these words make sense to you and you want to know more, check out the Privacy Pass team’s [protocol design document](<a href="https://privacypass.github.io/protocol/">https://privacypass.github.io/protocol/</a>).</p>
    <div>
      <h3>Making it work in the browser</h3>
      <a href="#making-it-work-in-the-browser">
        
      </a>
    </div>
    <p>It takes more than a nice security protocol based on solid cryptography to make something useful in the real world. To bring the advantages of this protocol to users, the Privacy Pass team built a client in JavaScript and packaged it using <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/What_are_WebExtensions">WebExtensions</a>, a cross-browser framework for developing applications that run in the browser and modify website behavior. This standard is compatible with both Chrome and Firefox. A reference implementation of the server side of the protocol was <a href="https://github.com/privacypass/challenge-bypass-server">also implemented in Go</a>.</p><p>If you’re a web user and are annoyed by CAPTCHAs, you can download the Privacy Pass extension for Chrome <a href="https://chrome.google.com/webstore/detail/privacy-pass/ajhmfdgkijocedmfjonnpjfojldioehi">here</a> and for Firefox <a href="https://addons.mozilla.org/en-US/firefox/addon/privacy-pass/">here</a>. It will significantly improve your web browsing experience. Once it is installed, you’ll see a small icon on your browser with a number under it. The number is how many unused privacy passes you have. If you are running low on passes, simply click on the icon and select “Get More Passes,” which will load a CAPTCHA you can solve in exchange for thirty passes. Every time you visit a domain that requires a user challenge page to view, Privacy Pass will “spend” a pass and the content will load transparently. Note that you may see more than one pass spent up when you load a site for the first time if the site has subresources from multiple domains.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/23gnEcti3z4owPHwH37m6o/09b9335b07c60d4e20b2510159f83440/Firefox-3--2-.png" />
            
            </figure><p>The Privacy Pass extension works by hooking into the browser and looking for HTTP responses that have a specific header that indicates support for the Privacy Pass protocol. When a challenge page is returned, the extension will either try to issue new privacy passes or redeem existing privacy passes. The cryptographic operations in the plugin were built on top of <a href="https://github.com/bitwiseshiftleft/sjcl">SJCL</a>.</p><p>If you’re a Cloudflare customer and want to opt out from supporting Privacy Pass, please <a href="https://support.cloudflare.com">contact our support team</a> and they will disable it for you. We are soon adding a toggle for Privacy Pass in the Firewall app in the Cloudflare dashboard.</p>
    <div>
      <h3>The web is for everyone</h3>
      <a href="#the-web-is-for-everyone">
        
      </a>
    </div>
    <p>The technology behind Privacy Pass is free for anyone to use. We see a bright future for this technology and think it will benefit from community involvement. The protocol is currently only deployed at Cloudflare, but it could easily be used across different organizations. It’s easy to imagine obtaining a Privacy Pass that proves that you have a Twitter or Facebook identity and using it to access other services on the Internet without revealing your identity, for example. There are a wide variety of applications of this technology that extend well beyond our current use cases.</p><p>If this technology is intriguing to you and you want to collaborate, please reach out to the Privacy Pass team on <a href="https://github.com/privacypass">GitHub</a>.</p> ]]></content:encoded>
            <category><![CDATA[Privacy]]></category>
            <category><![CDATA[CAPTCHA]]></category>
            <category><![CDATA[Privacy Pass]]></category>
            <category><![CDATA[Firefox]]></category>
            <category><![CDATA[Chrome]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">7vBxBfvbpwQEokzxhTdIy6</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[Geo Key Manager: How It Works]]></title>
            <link>https://blog.cloudflare.com/geo-key-manager-how-it-works/</link>
            <pubDate>Tue, 26 Sep 2017 13:00:00 GMT</pubDate>
            <description><![CDATA[ Today we announced Geo Key Manager, a feature that gives customers control over where their private keys are stored with Cloudflare. This builds on a previous Cloudflare innovation called Keyless SSL and a novel cryptographic access control mechanism. ]]></description>
            <content:encoded><![CDATA[ <p>Today we announced <a href="/introducing-cloudflare-geo-key-manager">Geo Key Manager</a>, a feature that gives customers unprecedented control over where their private keys are stored when uploaded to Cloudflare. This feature builds on a previous Cloudflare innovation called Keyless SSL and a novel cryptographic access control mechanism based on both identity-based encryption and broadcast encryption. In this post we’ll explain the technical details of this feature, the first of its kind in the industry, and how Cloudflare leveraged its existing network and technologies to build it.</p>
    <div>
      <h3>Keys in different area codes</h3>
      <a href="#keys-in-different-area-codes">
        
      </a>
    </div>
    <p>Cloudflare launched <a href="/announcing-keyless-ssl-all-the-benefits-of-cloudflare-without-having-to-turn-over-your-private-ssl-keys/">Keyless SSL</a> three years ago to wide acclaim. With Keyless SSL, customers are able to take advantage of the full benefits of Cloudflare’s network while keeping their HTTPS private keys inside their own infrastructure. Keyless SSL has been popular with customers in industries with regulations around the control of access to private keys, such as the financial industry. Keyless SSL adoption has been slower outside these regulated industries, partly because it requires customers to run custom software (the key server) inside their infrastructure.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/121VptrQkTUYUPss5HLIWs/1f01586195f9611eb1490f98166bd8ef/image5.png" />
            
            </figure><p></p><p>Standard Configuration</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/W3u9jRPpuvciPzndNJYTE/f99f3e97afb98b68c17447bde600b805/image7.png" />
            
            </figure><p></p><p>Keyless SSL</p><p>One of the motivating use cases for Keyless SSL was the expectation that customers may not trust a third party like Cloudflare with their private keys. We found that this is actually very uncommon; most customers actually do trust Cloudflare with their private keys. But we have found that sometimes customers would like a way to reduce the risk associated with having their keys in some physical locations around the world.</p><p>This is where Geo Key Manager is useful: it lets customers limit the exposure of their private keys to certain locations. It’s similar Keyless SSL, but instead of having to run a key server inside your infrastructure, Cloudflare hosts key servers in the locations of your choosing. This reduces the complexity of deploying Keyless SSL and gives the control that people care about. Geo Key Manager “just works” with no software required.</p>
    <div>
      <h3>A Keyless SSL Refresher</h3>
      <a href="#a-keyless-ssl-refresher">
        
      </a>
    </div>
    <p>Keyless SSL was developed at Cloudflare to make HTTPS more secure. Content served over HTTPS is both encrypted and authenticated so that eavesdroppers or attackers can’t read or modify it. HTTPS makes use of a protocol called Transport Layer Security (TLS) to keep this data safe.</p><p>TLS has two phases: a handshake phase and a data exchange phase. In the handshake phase, cryptographic keys are exchanged and a shared secret is established. As part of this exchange, the server proves its identity to the client using a certificate and a private key. In the data exchange phase, shared keys from the handshake are used to encrypt and authenticate the data.</p><p>A TLS handshake can be naturally broken down into two components:</p><ol><li><p>The private key operation</p></li></ol><ul><li><p>Everything else</p></li></ul><p>The private key operation is critical to the TLS handshake: it allows the server to prove that it owns a given certificate. Without this private key operation, the client has no way of knowing whether or not the server is authentic. In Keyless SSL, the private key operation is separated from the rest of the handshake. In a Keyless SSL handshake, instead of performing the private key operation locally, the server makes a remote procedure call to another server (called the key server) that controls the private key.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2qVkp63Sxh2oKSbGYq5S4t/57ce236a21aa8623fc7a7a7c3e9a1030/image8.gif" />
            
            </figure><p>Keyless SSL lets you logically separate concerns so that a compromise of the web server does not result in a compromise of the private key. This additional security comes at a cost. The remote procedure call from the server to the key server can add latency to the handshake, slowing down connection establishment. The additional latency cost corresponds to the round-trip time from the server to the key server, which can be as much as a second if the key server is on the other side of the world.</p><p>Luckily, this latency cost only applies to the first time you connect to a server. Once the handshake is complete, the key server is not involved. Furthermore, if you reconnect to a site you don’t have to pay the latency cost either because resuming a connection with <a href="/tls-session-resumption-full-speed-and-secure/">TLS Session Resumption</a> doesn’t require the private key.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5eRBZiNmYoLOrG7EKJiBtC/589586580fa3559e67aa222047ca7908/geo-key-frame_4x.gif" />
            
            </figure><p>Latency is only added for the initial connection.</p><p>For a deep-dive on this topic, read <a href="/keyless-ssl-the-nitty-gritty-technical-details/">this post I wrote</a> in 2014.</p><p>With Keyless SSL as a basic building block, we set out to design Geo Key Manager.</p>
    <div>
      <h3>Geo Key Manager: designing the architecture</h3>
      <a href="#geo-key-manager-designing-the-architecture">
        
      </a>
    </div>
    <p>Cloudflare has a truly international customer base and we’ve learnt that customers around the world have different regulatory and statutory requirements, and different risk profiles, concerning the placement of their private keys. There’s no one size fits all solution across the planet. With that philosophy in mind, we set out to design a very flexible system for deciding where keys can be kept.</p><p>The first problem to solve was access control. How could we limit the number of locations that a private key is sent to? Cloudflare has a database that takes user settings and distributes them to all edge locations <a href="/kyoto-tycoon-secure-replication/">securely, and very fast</a>. However, this system is optimized to synchronize an entire database worldwide; modifying it to selectively distribute keys to different locations was too big of an architectural change for Cloudflare. Instead, we decided to explore the idea of a cryptographic access control (CAC) system.</p><p>In a CAC system, data is encrypted and distributed everywhere. A piece of data can only be accessed if you have the decryption key. By only sending decryption keys to certain locations, we can effectively limit who has access to data. For example, we could encrypt customer private keys once—right after they’re uploaded—and send the encrypted keys to every location using the existing database replication system.</p><p>We’ve experimented with CAC systems before, most notably with the <a href="https://github.com/cloudflare/redoctober">Red October</a> project. With Red October, you can encrypt a piece of data so that multiple people are required to decrypt it. This is how <a href="/pal-a-container-identity-bootstrapping-tool/">PAL</a>, our Docker Secrets solution works. However, Red October system is ill-suited to Geo Key Manager for a number of reasons:</p><ol><li><p>The more locations you encrypt to, the larger the encrypted key gets</p></li></ol><ul><li><p>There is no way to encrypt a key to “everywhere except a given location” without having to re-encrypt when new locations are added (which we do <a href="/portland/">frequently</a>)</p></li><li><p>There has to be a secure registry of each datacenter’s public key</p></li></ul><p>For Geo Key Manager we wanted something that provides users with granular control and can scale with Cloudflare’s growing network. We came up with the following requirements:</p><ul><li><p>Users can select from a set of pre-defined regions they would like their keys to be in (E.U., U.S., Highest Security, etc.)Users can add specific datacenter locations outside of the chosen regions (e.g. all U.S. locations plus Toronto)</p></li><li><p>Users can choose selected datacenter locations inside their chosen regions to not send keys (e.g. all E.U. locations except London)</p></li><li><p>It should be fast to decrypt a key and easy to store it, no matter how complicated the configuration</p></li></ul><p>Building a system to satisfy these requirements gives customers the freedom to decide where their keys are kept and the scalability necessary to be useful with a growing network.</p>
    <div>
      <h3>Identity-based encryption</h3>
      <a href="#identity-based-encryption">
        
      </a>
    </div>
    <p>The cryptographic tool that allows us to satisfy these requirements is called Identity-based encryption.</p><p>Unlike traditional public key cryptography, where each party has a public key and a private key, in identity-based encryption, your identity <i>is</i> your public key. This is a very powerful concept, because it allows you to encrypt data to a person without having to obtain a their public key ahead of time. Instead of a large random-looking number, a public key can literally be any string, such as “<a>bob@example.com</a>” or “beebob”. Identity-based encryption is useful for email, where you can imagine encrypting a message using person’s email address as the public key. Compare this to the complexity of using PGP, where you need to find someone’s public key and validate it before you send a message. With identity-based encryption, you can even encrypt data to someone before they have the private key associated with their identity (which is managed by a central key generation authority).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1Q2nDn5ijrqWLGMEpqCvtL/8492334a36047cfa46df3a9c041d9e6a/image10.png" />
            
            </figure><p></p><p>Public Key Cryptography (PGP, etc.)</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1tKl78Up3D6ZQcQObkEscl/9052e1d04856d4a690cb368a984c5469/image1-2.png" />
            
            </figure><p></p><p>Identity-based Encryption</p><p>ID-based encryption was proposed by <a href="https://discovery.csc.ncsu.edu/Courses/csc774-S08/reading-assignments/shamir84.pdf">Shamir in the 80s</a>, but it wasn’t fully practical until <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.66.1131">Boneh and Franklin’s proposal</a> in 2001. Since then, a variety of interesting schemes been discovered and put to use. The underlying cryptographic primitive that makes efficient ID-based encryption possible is called <a href="https://www.math.uwaterloo.ca/~ajmeneze/publications/pairings.pdf">Elliptic Curve Pairings</a>, a topic that deserves its own blog post.</p><p>Our scheme is based the combination of two primitives:</p><p><b>Identity-Based Broadcast Encryption</b> (IBBE)</p><p><b>Identity-Based Revocation</b> (IBR)</p><p><i>Identity-Based Broadcast Encryption</i> (IBBE) is like a allowlist. It lets you take a piece of data and encrypt it to a set of recipients. The specific construction we use is from a 2007 paper by <a href="https://link.springer.com/content/pdf/10.1007/978-3-540-76900-2_12.pdf">Delerablee</a>. Critically, the size of the ciphertext does not depend on the number of recipients. This means we can efficiently encrypt data without it getting larger no matter how many recipients there are (or PoPs in our case).</p><p><i>Identity-based Revocation</i> (IBR) is like a blocklist. It lets you encrypt a piece of data so that all recipients can decrypt it except for a pre-defined set of recipients who are excluded. The implementation we used was from section 4 of a paper by <a href="https://pdfs.semanticscholar.org/5da9/eaa24ba749f1ae193800b6961a37b88da1de.pdf">Attrapadung et al. from 2011</a>. Again, the ciphertext size does not depend on the number of excluded identities.</p><p>These two primitives can be combined to create a very flexible cryptographic access control scheme. To do this, create two sets of identities: an identity for each region, and an identity for each datacenter location. Once these sets have been decided, each server is provisioned the identity-based encryption private key for its region and its location.</p><p>With this in place, you can configure access to the key in terms of the following sets:</p><ul><li><p>Set of regions to encrypt to</p></li><li><p>Set of locations inside the region to exclude</p></li><li><p>Set of locations outside the region to include</p></li></ul><p>Here’s how you can encrypt a customer key so that a given access control policy (regions, blocklist, allowlist) can be enforced:</p><ol><li><p>Create a key encryption key KEK</p></li></ol><ul><li><p>Split it in two halves KEK1, KEK2</p></li><li><p>Encrypt KEK1 with IBBE to include the set of regions (allowlist regions)</p></li><li><p>Encrypt KEK2 with IBR to exclude locations in the regions defined in 3 (blocklist colo)</p></li><li><p>Encrypt KEK with IBBE to include locations not in the regions defined in 3 (allowlist colo)</p></li><li><p>Send all three encrypted keys (KEK1)region, (KEK2)exclude, (KEK)include to all locations</p></li></ul><p>This can be visualized as follows with</p><ul><li><p>Regions: U.S. and E.U.</p></li><li><p>Blocklist colos: Dallas and London</p></li><li><p>Allowlist colos: Sydney and Tokyo</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3dEYAkvLTz4wg4vnpSmJ1y/80f8c01cc9ad92f920c1886d14541898/image11.png" />
            
            </figure><p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5A6r4FXSSdko6wNNKA2sFi/d898890a6196d82796618e7245850a45/image4.jpg" />
            
            </figure><p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2ZEZXyLDAkN0Gpxr0ils0f/fa28cb9857466912df7c5001c1ee62b2/image2-2.png" />
            
            </figure><p>The locations inside the regions allowlist can decrypt half of the key (KEK1), and need to also be outside the blocklist to decrypt the other half of the key (KEK2). In the example, London and Dallas only have access to KEK1 because they can’t decrypt KEK2. These locations can’t reconstruct KEK and therefore can’t decrypt the private key. Every other location in the E.U. and U.S. can decrypt KEK1 and KEK2 so they can construct KEK to decrypt the private key. Tokyo and Sydney can decrypt the KEK from the allowlist and use it to decrypt the private key.</p><p>This will make the private TLS key available in all of the EU and US except for Dallas and London and it will additionally be available in Tokyo and Sydney. The result is the following map:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/S9frEbHm1U5VAzfqpeTWW/dcb0b031d8d552c0b1322f243b02d360/image3.png" />
            
            </figure><p>This design lets customers choose with per-datacenter granularity where their private keys can be accessed. If someone connects to a datacenter that can’t decrypt the private key, that SSL connection is handled using Keyless SSL, where the key server is located in a location with access to the key. The Geo Key code automatically finds the nearest data center that can access the relevant TLS private key and uses Keyless SSL to handle the TLS handshake with the client.</p>
    <div>
      <h3>Creating a key server network</h3>
      <a href="#creating-a-key-server-network">
        
      </a>
    </div>
    <p>Any time you use Keyless SSL for a new connection, there’s going to be a latency cost for connecting to the key server. With Geo Key Manager, we wanted to reduce this latency cost as much as possible. In practical terms, this means we need to know which key server will respond fastest.</p><p>To solve this, we created an overlay network between all of our datacenters to measure latency. Every datacenter has an outbound connection to every other datacenter. Every few seconds, we send a “ping” (a <a href="https://github.com/cloudflare/gokeyless/blob/d129f600f7c60cc36d9da9ef99eefe430b05a3c4/protocol/protocol.go#L95">message in the Keyless SSL protocol</a>, not an <a href="https://en.wikipedia.org/wiki/Ping_(networking_utility)">ICMP message</a>) and we measure how long it takes the server to send a corresponding “pong”.</p><p>When a client connects to a site behind Cloudflare in a datacenter that can’t decrypt the private key for that site, we use metadata to find out which datacenters have access to the key. We then choose the datacenter that has the lowest latency according to our measurements and use that datacenter’s key server for Keyless SSL. If the location with the lowest latency is overloaded, we may choose another location with higher latency but more capacity.</p><p>The data from these measurements was used to construct the following map, highlighting the additional latency added for visitors around the world for the US-only configuration.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1BbX0LQqopTXlY86GvIpa8/922b82e0e9e38dc3865f3148d9156ce1/image6.png" />
            
            </figure><p>Latency added when keys are in U.S. only. Green: no latency cost,Yellow: &lt;50ms,Red: &gt; 100ms</p>
    <div>
      <h3>In conclusion</h3>
      <a href="#in-conclusion">
        
      </a>
    </div>
    <p>We’re constantly innovating to provide our customers with powerful features that are simple to use. With Geo Key Manager, we are leveraging Keyless SSL and 21st century cryptography to improve private key security in an increasingly complicated geo-political climate.</p> ]]></content:encoded>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[SSL]]></category>
            <category><![CDATA[HTTPS]]></category>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Keyless SSL]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">6n44oy7eH4vHKsbzTZKngz</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[High-reliability OCSP stapling and why it matters]]></title>
            <link>https://blog.cloudflare.com/high-reliability-ocsp-stapling/</link>
            <pubDate>Mon, 10 Jul 2017 12:43:30 GMT</pubDate>
            <description><![CDATA[ At Cloudflare our focus is making the internet faster and more secure. Today we are announcing a new enhancement to our HTTPS service: High-Reliability OCSP stapling. ]]></description>
            <content:encoded><![CDATA[ <p>At Cloudflare our focus is making the Internet faster and more secure. Today we are announcing a new enhancement to our HTTPS service: High-Reliability OCSP stapling. This feature is a step towards enabling an important security feature on the web: certificate revocation checking. Reliable OCSP stapling also improves connection times by up to 30% in some cases. In this post, we’ll explore the importance of certificate revocation checking in HTTPS, the challenges involved in making it reliable, and how we built a robust OCSP stapling service.</p>
    <div>
      <h3>Why revocation is hard</h3>
      <a href="#why-revocation-is-hard">
        
      </a>
    </div>
    <p>Digital certificates are the cornerstone of trust on the web. A digital certificate is like an identification card for a website. It contains identity information including the website’s hostname along with a cryptographic public key. In public key cryptography, each public key has an associated private key. This private key is kept secret by the site owner. For a browser to trust an HTTPS site, the site’s server must provide a certificate that is valid for the site’s hostname and a proof of control of the certificate’s private key. If someone gets access to a certificate’s private key, they can impersonate the site. Private key compromise is a serious risk to trust on the web.</p><p>Certificate revocation is a way to mitigate the risk of key compromise. A website owner can revoke a compromised certificate by informing the certificate issuer that it should no longer be trusted. For example, back in 2014, <a href="/the-heartbleed-aftermath-all-cloudflare-certificates-revoked-and-reissued/">Cloudflare revoked</a> all managed certificates after it was shown that the Heartbleed vulnerability could be <a href="/the-results-of-the-cloudflare-challenge/">used to steal private keys</a>. There are other reasons to revoke, but key compromise is the most common.</p><p>Certificate revocation has a spotty history. Most of the revocation checking mechanisms implemented today don’t protect site owners from key compromise. If you know about why revocation checking is broken, feel free to skip ahead to the OCSP stapling section <a href="#ocspstapling">below</a>.</p>
    <div>
      <h3>Revocation checking: a history of failure</h3>
      <a href="#revocation-checking-a-history-of-failure">
        
      </a>
    </div>
    <p>There are several ways a web browser can check whether a site’s certificate is revoked or not. The most well-known mechanisms are Certificate Revocation Lists (CRL) and Online Certificate Status Protocol (OCSP). A CRL is a signed list of serial numbers of certificates revoked by a CA. OCSP is a protocol that can be used to query a CA about the revocation status of a given certificate. An OCSP response contains signed assertions that a certificate is not revoked.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6lGxsndXR5EF4yGX4thxuq/6c0e5a895ae6674e8d783aa5d6cef071/image1-1.jpg" />
            
            </figure><p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3ovTuDaVKP72LIddkcRGIE/cf81791b20b77dfbd5dbf4c0221926fa/Frame-658.png" />
            
            </figure><p>Certificates that support OCSP contain the responder's URL and those that support CRLs contain a URLs where the CRL can be obtained. When a browser is served a certificate as part of an HTTPS connection, it can use the embedded URL to download a CRL or an OCSP response and check that the certificate hasn't been revoked before rendering the web page. The question then becomes: what should the browser do if the request for a CRL or OCSP response fails? As it turns out, both answers to that question are problematic.</p>
    <div>
      <h3>Hard-fail doesn’t work</h3>
      <a href="#hard-fail-doesnt-work">
        
      </a>
    </div>
    <p>When browsers encounter a web page and there’s a problem fetching revocation information, the safe option is to block the page and show a security warning. This is called a hard-fail strategy. This strategy is conservative from a security standpoint, but prone to false positives. For example, if the proof of non-revocation could not be obtained for a valid certificate, a hard-fail strategy will show a security warning. Showing a security warning when no security issue exists is dangerous because it can lead to <a href="http://www.wired.co.uk/article/cybersecurity-warnings-fatigue">warning fatigue</a> and teach users to click through security warnings, which is a bad idea.</p><p>In the real world, false positives are unavoidable. OCSP and CRL endpoints subject to service outages and network errors. There are also common situations where these endpoints are completely inaccessible to the browser, such as when the browser is behind a captive portal. For some access points used in hotels and airplanes, unencrypted traffic (like OCSP endpoints) are blocked. A hard-fail strategy force users behind captive portals and other networks that block OCSP requests to click through unnecessary security warnings. This reality is unpalatable to browser vendors.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3X32ji9gvjXGc5BGcrw6TH/e25942fb12b7844085fbb40c6cf811bd/image3-1.png" />
            
            </figure><p>Another drawback to a hard-fail strategy is that it puts an increased burden on certificate authorities to keep OCSP and CRL endpoints available and online. A broken OCSP or CRL server becomes a central point of failure for all certificates issued by a certificate authority. If browsers followed a hard-fail strategy, an OCSP outage would be an Internet outage. Certificate authorities are organizations optimized to provide trust and accountability, not necessarily resilient infrastructure. In a hard-fail world, the availability of the web as a whole would be limited by the ability for CAs to keep their OCSP services online at all times; a dangerous systemic risk to the internet as a whole.</p>
    <div>
      <h3>Soft-fail: it’s not much better</h3>
      <a href="#soft-fail-its-not-much-better">
        
      </a>
    </div>
    <p>To avoid the downsides of a hard-fail strategy, most browsers take another approach to certificate revocation checking. Upon seeing a new certificate, the browser will attempt to fetch the revocation information from the CRL or OCSP endpoint embedded in the certificate. If the revocation information is available, they rely on it, and otherwise they assume the certificate is not revoked and display the page without any errors. This is called a “soft-fail” strategy.</p><p>The soft-fail strategy has a critical security flaw. An attacker with network position can block the OCSP request. If this attacker also has the private key of a revoked certificate, they can intercept the outgoing connection for the site and present the revoked certificate to the browser. Since the browser doesn’t know the certificate is revoked and is following a soft-fail strategy, the page will load without alerting the user. As Adam Langley <a href="https://www.imperialviolet.org/2012/02/05/crlsets.html">described</a>: “soft-fail revocation checks are like a seat-belt that snaps when you crash. Even though it works 99% of the time, it's worthless because it only works when you don't need it.”</p><p>A soft-fail strategy also makes connections slower. If revocation information for a certificate is not already cached, the browser will block the rendering of the page until the revocation information is retrieved, or a timeout occurs. This additional step causes a noticeable and unwelcome delay, with marginal security benefits. This tradeoff is a hard sell for the performance-obsessed web. Because of the limited benefit, some browsers have eliminated live revocation checking for at least <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1366100">some subset of certificates</a>.</p><p>Live OCSP checking has an additional downside: it leaks private browsing information. OCSP requests are sent over unencrypted HTTP and are tied to a specific certificate. Sending an OCSP request tells the certificate authority which websites you are visiting. Furthermore, everyone on the network path between your browser and the OCSP server will also know which sites you are browsing.</p>
    <div>
      <h3>Alternative revocation checking</h3>
      <a href="#alternative-revocation-checking">
        
      </a>
    </div>
    <p>Some client still perform soft-fail OCSP checking, but it’s becoming less common due to the performance and privacy downsides described above. To protect high-value certificates, some browsers have explored alternative mechanisms for revocation checking.</p><p>One technique is to pre-package a list of revoked certificates and distribute them through browser updates. Because the list of all revoked certificates is so large, only a few high-impact certificates are included in this list. This technique is called <a href="https://blog.mozilla.org/security/2015/03/03/revoking-intermediate-certificates-introducing-onecrl/">OneCRL</a> by Firefox and <a href="https://www.imperialviolet.org/2012/02/05/crlsets.html">CRLSets</a> by Chrome. This has been effective for some high-profile revocations, but it is by no means a complete solution. Not only are not all certificates covered, this technique leaves a window of vulnerability between the time the certificate is revoked and the certificate list gets to browsers.</p>
    <div>
      <h3>OCSP Stapling</h3>
      <a href="#ocsp-stapling">
        
      </a>
    </div>
    <p>OCSP stapling is a technique to get revocation information to browsers that fixes some of the performance and privacy issues associated with live OCSP fetching. In OCSP stapling, the server includes a current OCSP response for the certificate included (or "stapled") into the initial HTTPS connection. That removes the need for the browser to request the OCSP response itself. OCSP stapling is widely supported by modern browsers.</p><p>Not all servers support OCSP stapling, so browsers still take a soft-fail approach to warning the user when the OCSP response is not stapled. Some browsers (such as Safari, Edge and Firefox <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1366100">for now</a>) check certificate revocation for certificates, so OCSP stapling can provide a performance boost of <a href="/ocsp-stapling-how-cloudflare-just-made-ssl-30/">up to 30%</a>. For browsers like Chrome that don’t check for revocation for all certificates, OCSP stapling provides a proof of non-revocation that they would not have otherwise.</p>
    <div>
      <h3>High-reliability OCSP stapling</h3>
      <a href="#high-reliability-ocsp-stapling">
        
      </a>
    </div>
    <p>Cloudflare <a href="/ocsp-stapling-how-cloudflare-just-made-ssl-30/">started offering OCSP stapling in 2012</a>. Cloudflare’s original implementation relied on code from <a href="https://www.nginx.com/press/globalsign-digicert-and-comodo-collaborate-nginx-improve-online/">nginx</a> that was able to provide OCSP stapling for a some, but not all connections. As Cloudflare’s network grew, the implementation wasn’t able to scale with it, resulting in a drop in the percentage of connections with OCSP responses stapled. The architecture we had chosen had served us well, but we could definitely do better.</p><p>In the last year we redesigned our OCSP stapling infrastructure to make it much more robust and reliable. We’re happy to announce that we now provide reliable OCSP stapling connections to Cloudflare. As long as the certificate authority has set up OCSP for a certificate, Cloudflare will serve a valid OCSP stapled response. All Cloudflare customers now benefit from much more reliable OCSP stapling.</p>
    <div>
      <h3>OCSP stapling past</h3>
      <a href="#ocsp-stapling-past">
        
      </a>
    </div>
    <p>In Cloudflare’s original implementation of OCSP stapling, OCSP responses were fetched opportunistically. Given a connection that required a certificate, Cloudflare would check to see if there was a fresh OCSP response to staple. If there was, it would be included in the connection. If not, then the client would not be sent an OCSP response, and Cloudflare would send a request to refresh the OCSP response in the cache in preparation for the next request.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/695TLaZM0gWEN9q339DdiE/1a275ed24ab629605b3881660fe036e5/image2-1.jpg" />
            
            </figure><p>If a fresh OCSP response wasn’t cached, the connection wouldn’t get an OCSP staple. The next connection for that same certificate would get a OCSP staple, because the cache will have been populated.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/26xAQKhW2tBTI9uwb1R3OD/2095dd4e959366e8c4ddcf7f8bfe337a/image7.jpg" />
            
            </figure><p>This architecture was elegant, but not robust. First, there are several situations in which the client is guaranteed to not get an OCSP response. For example, the first request in every cache region and the first request after an OCSP response expires are guaranteed to not have an OCSP response stapled. With Cloudflare’s expansion to more locations, these failures were more common. Less popular sites would have their OCSP responses fetched less often resulting in an even lower ratio of stapled connections. Another reason that connections could be missing OCSP responses is if the OCSP request from Cloudflare to fill the cache failed. There was a lot of room for improvement.</p>
    <div>
      <h3>Our solution: OCSP pre-fetching</h3>
      <a href="#our-solution-ocsp-pre-fetching">
        
      </a>
    </div>
    <p>In order to be able to reliably include OCSP staples in all connection, we decided to change the model. Instead of fetching the OCSP response when a request came in, we would fetch it in a centralized location and distribute valid responses to all our servers. When a response started getting close to expiration, we’d fetch a new one. If the OCSP request fails, we put it into a queue to re-fetch at a later time. Since most OCSP staples are valid for around 7 days, there is a lot of flexibility in term of refreshing expiring responses.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5VtZ72GF4qvtDLHF4YwnhS/0e788290c059f675821c94ba04194032/image5.jpg" />
            
            </figure><p>To keep our cache of OCSP responses fresh, we created an OCSP fetching service. This service ensures that there is a valid OCSP response for every certificate managed by Cloudflare. We constantly crawl our cache of OCSP responses and refresh those that are close to expiring. We also make sure to never cache invalid OCSP responses, as this can have <a href="https://www.theregister.co.uk/2017/05/29/certificate_snafu_sees_azure_portal_reject_firefox/">bad consequences</a>. This system has been running for several months now, and we are now reliably including OCSP staples for almost every HTTPS request.</p><p>Reliable stapling improves performance for browsers that would have otherwise fetched OCSP, but it also changes the optimal failure strategy for browsers. If a browser can reliably get an OCSP staple for a certificate, why not switch back from a soft-fail to a hard-fail strategy?</p>
    <div>
      <h3>OCSP must-staple</h3>
      <a href="#ocsp-must-staple">
        
      </a>
    </div>
    <p>As <a href="#softfail">described above</a>, the soft-fail strategy for validating OCSP responses opens up a security hole. An attacker with a revoked certificate can simply neglect to provide an OCSP response when a browser connects to it and the browser will accept their revoked certificate.</p><p>In the OCSP fetching case, a soft-fail approach makes sense. There many reasons the browser would not be able to obtain an OCSP: captive portals, broken OCSP servers, network unreliability and more. However, as we have shown with our high-reliability OCSP fetching service, it is possible for a server to fetch OCSP responses without any of these problems. OCSP responses are re-usable and are valid for several days. When one is close to expiring, the server can fetch a new one out-of-band and be able to reliably serve OCSP staples for all connections.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3DwccMgq7pMKrCnU5S7Ivj/fb5bbe40027ccf2d34f9cddb24f076cb/Swingline-stapler.jpg" />
            
            </figure><p><a href="https://commons.wikimedia.org/wiki/File:Swingline-stapler.jpg">Public Domain</a></p><p>If the client knows that a server will always serve OCSP staples for every connection, it can apply a hard-fail approach, failing a connection if the OCSP response is missing. This closes the security hole introduced by the soft-fail strategy. This is where OCSP must-staple fits in.</p><p>OCSP must-staple is an extension that can be added to a certificate that tells the browser to expect an OCSP staple whenever it sees the certificate. This acts as an explicit signal to the browser that it’s safe to use the more secure hard-fail strategy.</p><p>Firefox enforces OCSP must-staple, returning the following error if such a certificate is presented without a stapled OCSP response.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2qH0Q1eryXiXZ2yLcNKS6o/3fa23feece99f107ffc5c58a1d0d249a/image4.jpg" />
            
            </figure><p>Chrome provides the ability to mark a domain as “Expect-Staple”. If Chrome sees a certificate for the domain without a staple, it will send a report to a pre-configured report endpoint.</p>
    <div>
      <h3>Reliability</h3>
      <a href="#reliability">
        
      </a>
    </div>
    <p>As a part of our push to provide reliable OCSP stapling, we put our money where our mouths are and put an OCSP must-staple certificate on blog.cloudflare.com. Now if we ever don’t serve an OCSP staple, this page will fail to load on browsers like Firefox that enforce must-staple. You can identify a certificate by looking at the certificate details for the “1.3.6.1.5.5.7.1.24” OID.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/HdZil165qgzzMx4Cvnm8K/f36c26003ee86ab25888fa1af9ca6f37/image6.jpg" />
            
            </figure><p>Cloudflare customers can choose to upload must-staple custom certificates, but we encourage them not to do so yet because there may be a multi-second delay between the certificate being installed and our ability to populate the OCSP response cache. This will be fixed in the coming months. Other than the first few seconds after uploading the certificate, Cloudflare’s new OCSP fetching is robust enough to offer OCSP staples for every connection thereafter.</p><p>As of today, an attacker with access to the private key for a revoked certificate can still hijack the connection. All they need to do is to place themselves on the network path of the connection and block the OCSP request. OCSP must-staple prevents that, since an attacker will not be able to obtain an OCSP response that says the certificate has not been revoked.</p>
    <div>
      <h3>The weird world of OCSP responders</h3>
      <a href="#the-weird-world-of-ocsp-responders">
        
      </a>
    </div>
    <p>For browsers, an OCSP failure is not the end of the world. Most browsers are configured to soft-fail when an OCSP responder returns an error, so users are unaffected by OCSP server failures. Some Certificate Authorities have had <a href="https://community.letsencrypt.org/t/may-19-2017-ocsp-and-issuance-outage-postmortem/34922">massive multi-day outages</a> in their OCSP servers without affecting the availability of sites that use their certificates.</p><p>There’s no strong feedback mechanism for broken or slow OCSP servers. This lack of feedback has led to an ecosystem of faulty or unreliable OCSP servers. We experienced this first-hand while developing high-reliability OCSP stapling. In this section, we’ll outline half a dozen unexpected behaviors we found when deploying high-reliability OCSP stapling. A big thanks goes out to all the CAs who fixed the issues we pointed out. CA names redacted to preserve their identities.</p>
    <div>
      <h4>CA #1: Non-overlapping periods</h4>
      <a href="#ca-1-non-overlapping-periods">
        
      </a>
    </div>
    <p>We noticed CA #1 certificates frequently missing their refresh-deadline, and during debugging we were lucky enough to see this:</p>
            <pre><code>$ date -u
Sat Mar  4 02:45:35 UTC 2017
$ ocspfetch &lt;redacted, customer ID&gt;
This Update: 2017-03-04 01:45:49 +0000 UTC
Next Update: 2017-03-04 02:45:49 +0000 UTC
$ date -u
Sat Mar  4 02:45:48 UTC 2017
$ ocspfetch &lt;redacted, customer ID&gt;
This Update: 2017-03-04 02:45:49 +0000 UTC
Next Update: 2017-03-04 03:45:49 +0000 UTC</code></pre>
            <p>It shows that CA #1 had configured their OCSP responders to use an incredibly short validity period with almost no overlap between validity periods, which makes it functionally impossible to always have a fresh OCSP response for their certificates. We contacted them, and they reconfigured the responder to produce new responses every half-interval.</p>
    <div>
      <h4>CA #2: Wrong signature algorithm</h4>
      <a href="#ca-2-wrong-signature-algorithm">
        
      </a>
    </div>
    <p>Several certificates from CA #2 started failing with this error:</p>
            <pre><code> bad OCSP signature: crypto/rsa: verification error</code></pre>
            <p>The issue is that the OCSP claims to be signed with SHA256-RSA, when it is actually signed with SHA1-RSA (and the reverse: indicates SHA1-RSA, actually signed with SHA256-RSA).</p>
    <div>
      <h4>CA #3: Malformed OCSP responses</h4>
      <a href="#ca-3-malformed-ocsp-responses">
        
      </a>
    </div>
    <p>When we first started the project, our tool was unable to parse dozens of certificates in our database because of this error</p>
            <pre><code>asn1: structure error: integer not minimally-encoded</code></pre>
            <p>and many OCSP responses that we fetched from the same CA:</p>
            <pre><code>parsing ocsp response: bad OCSP signature: asn1: structure error: integer not minimally-encoded</code></pre>
            <p>What happened was that this CA had begun issuing &lt;1% of certificates with a minor formatting error that rendered them unparseable by Golang’s x509 package. After contacting them directly, they quickly fixed the issue but then we had to patch Golang's parser to be more lenient about encoding bugs.</p>
    <div>
      <h4>CA #4: Failed responder behind a load balancer</h4>
      <a href="#ca-4-failed-responder-behind-a-load-balancer">
        
      </a>
    </div>
    <p>A small number of CA #4’s OCSP responders fell into a "bad state" without them knowing, and would return 404 on every request. Since the CA used load balancing to round-robin requests to a number of responders, it looked like 1 in 6 requests would fail inexplicably.</p><p>Two times between Jan 2017 and May 2017, this CA also experienced some kind of large data-loss event that caused them to return persistent "Try Later" responses for a large number of requests.</p>
    <div>
      <h4>CA #5: Delay between certificate and OCSP responder</h4>
      <a href="#ca-5-delay-between-certificate-and-ocsp-responder">
        
      </a>
    </div>
    <p>When a certificate is issued by CA #5, there is a large delay between the time a certificate is issued and the OCSP responder is able to start returning signed responses. This results in a delay between certificate issance and the availability of OCSP. It has mostly been resolved, but this general pattern is dangerous for OCSP must-staple. There have been some <a href="https://github.com/sleevi/cabforum-docs/pull/2">changes discussed</a> by the <a href="https://cabforum.org/">CA/B Forum</a>, an organization that regulates the issuance and management of certificates, to require CAs to offer OCSP soon after issuance.</p>
    <div>
      <h4>CA #6: Extra certificates</h4>
      <a href="#ca-6-extra-certificates">
        
      </a>
    </div>
    <p>It is typical to embed only one certificate in an OCSP response, if any. The one embedded certificate is supposed to be a leaf specially issued for signing an intermediate's OCSP responses. However, several CAs embed multiple certificates: the leaf they use for signing OCSP responses, the intermediate itself, and sometimes all the intermediates up to the root certificate.</p>
    <div>
      <h3>Conclusions</h3>
      <a href="#conclusions">
        
      </a>
    </div>
    <p>We made OCSP stapling better and more reliable for Cloudflare customers. Despite the various strange behaviors we found in OCSP servers, we’ve been able to consistently serve OCSP responses for over 99.9% of connections since we’ve moved over to the new system. This great work was done by Brendan McMillion and Alessandro Ghedini. This is an important step in protecting the web community from attackers who have compromised certificate private keys.</p> ]]></content:encoded>
            <category><![CDATA[OCSP]]></category>
            <category><![CDATA[TLS]]></category>
            <category><![CDATA[HTTPS]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Programming]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">7tbSyaQLOejVqQI7xEdGhi</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
        <item>
            <title><![CDATA[How to make your site HTTPS-only]]></title>
            <link>https://blog.cloudflare.com/how-to-make-your-site-https-only/</link>
            <pubDate>Thu, 06 Jul 2017 13:35:00 GMT</pubDate>
            <description><![CDATA[ The Internet is getting more secure every day as people enable HTTPS, the secure version of HTTP, on their sites and services. ]]></description>
            <content:encoded><![CDATA[ <p>The Internet is getting more secure every day as people enable HTTPS, the secure version of HTTP, on their sites and services. Last year, Mozilla reported that the percentage of requests made by Firefox using encrypted HTTPS passed <a href="https://twitter.com/0xjosh/status/78697141295942042">50% for the first time</a>. HTTPS has numerous benefits that are not available over unencrypted HTTP, including improved performance with <a href="https://www.cloudflare.com/website-optimization/http2/">HTTP/2</a>, <a href="http://searchengineland.com/google-starts-giving-ranking-boost-secure-httpsssl-sites-199446">SEO benefits</a> for search engines like Google and the reassuring lock icon in the address bar.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2mExGu34GTxoBejOt9ef1Y/a173ce5dfc0b61d2213238afab253abe/image1.jpg" />
            
            </figure><p>So how do you add HTTPS to your site or service? That’s simple, Cloudflare offers free and automatic HTTPS support for all customers with no configuration. Sign up for any plan and Cloudflare will issue an SSL certificate for you and serve your site over HTTPS.</p>
    <div>
      <h3>HTTPS-only</h3>
      <a href="#https-only">
        
      </a>
    </div>
    <p>Enabling HTTPS does not mean that all visitors are protected. If a visitor types your website’s name into the address bar of a browser or follows an HTTP link, it will bring them to the insecure HTTP version of your website. In order to make your site HTTPS-only, you need to redirect visitors from the HTTP to the HTTPS version of your site.</p><p>Going HTTPS-only should be as easy as a click of a button, so we literally added one to the Cloudflare dashboard. Enable the “Always Use HTTPS” feature and all visitors of the HTTP version of your website will be redirected to the HTTPS version. You’ll find this option just above the HTTP Strict Transport Security setting and it is of course also available through our <a href="https://api.cloudflare.com/#zone-settings-change-always-use-https-setting">API</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/19twvdqDrUtYthZ88NZCG1/9b888300f8ed08e480adfbcaad1c1ee0/image2-1.png" />
            
            </figure><p>In case you would like to redirect only some subset of your requests you can still do this by creating a <a href="https://www.cloudflare.com/features-page-rules/">Page Rule</a>. Simply use the “Always Use HTTPS” setting on any URL pattern.</p>
    <div>
      <h3>Securing your site: next steps</h3>
      <a href="#securing-your-site-next-steps">
        
      </a>
    </div>
    <p>Once you have confirmed that your site is fully functional with HTTPS-only enabled, you can take it a step further and enable HTTP Strict Transport Security (<a href="/enforce-web-policy-with-hypertext-strict-transport-security-hsts/">HSTS</a>). HSTS is a header that tells browsers that your site is available over HTTPS and will be for a set period of time. Once a browser sees an HSTS header for a site, it will automatically fetch the HTTPS version of HTTP pages without needing to follow redirects. HSTS can be enabled in the crypto app right under the Always Use HTTPS toggle.</p><p>It's also important to secure the connection between Cloudflare and your site. To do that, you can use Cloudflare's <a href="/cloudflare-ca-encryption-origin/">Origin CA</a> to get a free certificate for your origin server. Once your origin server is set up with HTTPS and a valid certificate, change your SSL mode to Full (strict) to get the highest level of security.</p> ]]></content:encoded>
            <category><![CDATA[HTTPS]]></category>
            <category><![CDATA[SSL]]></category>
            <category><![CDATA[Automatic HTTPS]]></category>
            <category><![CDATA[Certificate Authority]]></category>
            <category><![CDATA[HTTP2]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">2XThcNAZoHfneQaKkn6XXC</guid>
            <dc:creator>Nick Sullivan</dc:creator>
        </item>
    </channel>
</rss>