
<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>Wed, 15 Apr 2026 21:09:52 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Extending Cloudflare Radar’s security insights with new DDoS, leaked credentials, and bots datasets]]></title>
            <link>https://blog.cloudflare.com/cloudflare-radar-ddos-leaked-credentials-bots/</link>
            <pubDate>Tue, 18 Mar 2025 13:00:00 GMT</pubDate>
            <description><![CDATA[ For Security Week 2025, we are adding several new DDoS-focused graphs, new insights into leaked credential trends, and a new Bots page to Cloudflare Radar.  ]]></description>
            <content:encoded><![CDATA[ <p>Security and attacks continues to be a very active environment, and the visibility that Cloudflare Radar provides on this dynamic landscape has evolved and expanded over time. To that end, during 2023’s Security Week, we <a href="https://blog.cloudflare.com/radar-url-scanner-early-access/"><u>launched our URL Scanner</u></a>, which enables users to safely scan any URL to determine if it is safe to view or interact with. During 2024’s Security Week, we <a href="https://blog.cloudflare.com/email-security-insights-on-cloudflare-radar/"><u>launched an Email Security page</u></a>, which provides a unique perspective on the threats posed by malicious emails, spam volume, the adoption of <a href="https://www.cloudflare.com/learning/email-security/dmarc-dkim-spf/"><u>email authentication methods like SPF, DMARC, and DKIM</u></a>, and the use of IPv4/IPv6 and TLS by email servers. For Security Week 2025, we are adding several new DDoS-focused graphs, new insights into leaked credential trends, and a new <b>Bots</b> page to Cloudflare Radar.  We are also taking this opportunity to <a href="https://www.cloudflare.com/learning/cloud/how-to-refactor-applications/">refactor</a> Radar’s <b>Security &amp; Attacks</b> page, breaking it out into <b>Application Layer</b> and <b>Network Layer</b> sections.</p><p>Below, we review all of these changes and additions to Radar.</p>
    <div>
      <h3>Layered security</h3>
      <a href="#layered-security">
        
      </a>
    </div>
    <p>Since Cloudflare Radar launched in 2020, it has included both network layer (Layers 3 &amp; 4) and application layer (Layer 7) attack traffic insights on a single <b>Security &amp; Attacks</b> page. Over the last four-plus years, we have evolved some of the existing data sets on the page, as well as adding new ones. As the page has grown and improved over time, it risked becoming unwieldy to navigate, making it hard to find the graphs and data of interest. To help address that, the <b>Security</b> section on Radar now features separate <a href="https://radar.cloudflare.com/security/application-layer"><b><u>Application Layer</u></b></a> and <a href="https://radar.cloudflare.com/security/network-layer"><b><u>Network Layer</u></b></a> pages. The <b>Application Layer</b> page is the default, and includes insights from analysis of HTTP-based malicious and attack traffic. The <b>Network Layer</b> page includes insights from analysis of network and transport layer attacks, as well as observed <a href="https://blog.cloudflare.com/tcp-resets-timeouts/"><u>TCP resets and timeouts</u></a>. Future security and attack-related data sets will be added to the relevant page. <a href="https://radar.cloudflare.com/email-security"><b><u>Email Security</u></b></a> remains on its own dedicated page.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3zxFA8iG7N9MZQzAQAaCNf/ee92891b74b0d70052cc43239dad656f/image__2_.png" />
          </figure>
    <div>
      <h3>A geographic and network view of application layer DDoS attacks</h3>
      <a href="#a-geographic-and-network-view-of-application-layer-ddos-attacks">
        
      </a>
    </div>
    <p>Radar’s <a href="https://radar.cloudflare.com/reports"><u>quarterly DDoS threat reports</u></a> have historically provided insights, aggregated on a quarterly basis, into the top source and target locations of application layer DDoS attacks. A <a href="https://radar.cloudflare.com/security/application-layer#application-layer-ddos-attacks-distribution"><u>new map and table</u></a> on Radar’s <b>Application Layer</b> Security page now provide more timely insights, with a global choropleth map showing a geographical distribution of source and target locations, and an accompanying list of the top 20 locations by share of all DDoS requests. Source location attribution continues to rely on the geolocation of the IP address originating the blocked request, while target location remains the billing location of the account that owns the site being attacked. </p><p>Over the first week of March 2025, the United States, Indonesia, and Germany were the top sources of <a href="https://www.cloudflare.com/learning/ddos/application-layer-ddos-attack/">application layer DDoS attacks</a>, together accounting for over 30% of such attacks as shown below. The concentration across the top targeted locations was quite different, with customers from Canada, the United States, and Singapore attracting 56% of application layer DDoS attacks.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7nW8CyC5L4s68ntQEe1pfT/a8b571b9b2325f5f71936367e8879af1/image10.png" />
          </figure><p>In addition to extended visibility into the geographic source of application layer DDoS attacks, we have also added <a href="https://www.cloudflare.com/learning/network-layer/what-is-an-autonomous-system/"><u>autonomous system (AS)</u></a>-level visibility. A <a href="https://radar.cloudflare.com/security/application-layer#application-layer-ddos-attacks-source-as-distribution"><u>new treemap</u></a> view shows the distribution of these attacks by source AS. At a global level, the largest sources include cloud/hosting providers in Germany, the United States, China, and Vietnam.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/332A6OGGKUNCE0wLVBKBmd/2b93c6bd46105602214d7ced2ead71b6/image7.png" />
          </figure><p>For a selected country/region, the treemap displays a source AS distribution for attacks observed to be originating from that location. In some, the sources of attack traffic are heavily concentrated in consumer/business network providers, such as in <a href="https://radar.cloudflare.com/security/application-layer/pt#application-layer-ddos-attacks-source-as-distribution"><u>Portugal</u></a>, shown below. However, in other countries/regions that have a large cloud provider presence, such as <a href="https://radar.cloudflare.com/security/application-layer/ie#application-layer-ddos-attacks-source-as-distribution"><u>Ireland</u></a>, <a href="https://radar.cloudflare.com/security/application-layer/sg#application-layer-ddos-attacks-source-as-distribution"><u>Singapore</u></a>, and the <a href="https://radar.cloudflare.com/security/application-layer/us#application-layer-ddos-attacks-source-as-distribution"><u>United States</u></a>, ASNs associated with these types of providers are the dominant sources. To that end, Singapore was listed as being among the top sources of application layer DDoS attacks in each of the quarterly DDoS threat reports in 2024. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3RpwYjFjmTR2WFx5UpsUuS/5211c6e5afd4733185ba1ed03750d1d2/image3.png" />
          </figure>
    <div>
      <h3>Have you been pwned?</h3>
      <a href="#have-you-been-pwned">
        
      </a>
    </div>
    <p>Every week, it seems like there’s another headline about a <a href="https://www.cloudflare.com/learning/security/what-is-a-data-breach/">data breach</a>, talking about thousands or millions of usernames and passwords being stolen. Or maybe you get an email from an identity monitoring service that your username and password were found on the “dark web”. (Of course, you’re getting those alerts thanks to a complementary subscription to the service offered as penance from another data breach…)</p><p>This credential theft is especially problematic because people often reuse passwords, despite best practices advising the use of strong, unique passwords for each site or application. To help mitigate this risk, <a href="https://blog.cloudflare.com/a-safer-internet-with-cloudflare/#account-takeover-detection"><u>starting in 2024</u></a>, Cloudflare began enabling customers to scan authentication requests for their websites and applications using a <a href="https://blog.cloudflare.com/privacy-preserving-compromised-credential-checking/"><u>privacy-preserving</u></a> compromised credential checker implementation to detect known-leaked usernames and passwords. Today, we're using aggregated data to display trends in how often these leaked and stolen credentials are observed across Cloudflare's network. (Here, we are defining “leaked credentials” as usernames or passwords being found in a public dataset, or the username and password detected as being similar.)</p><p><a href="https://developers.cloudflare.com/waf/detections/leaked-credentials/#how-it-works"><u>Leaked credentials detection</u></a> scans incoming HTTP requests for known authentication patterns from common web apps and any custom detection locations that were configured. The service uses a privacy-preserving compromised credential checking protocol to compare a hash of the detected passwords to hashes of compromised passwords found in databases of leaked credentials. A <a href="https://radar.cloudflare.com/security/application-layer#leaked-credentials-usage"><u>new Radar graph</u></a> on the worldwide <b>Application Layer</b> Security page provides visibility into aggregate trends around the detection of leaked credentials in authentication requests. Filterable by authentication requests from human users, bots, or all (human + bot), the graph shows the distribution requests classified as “clean” (no leaked credentials detected) and “compromised” (leaked credentials, as defined above, were used). At a worldwide level, we found that for the first week of March 2025, leaked credentials were used in 64% of all, over 65% of bot, and over 44% of human authorization requests. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5r8sHbOTrQ1ceGpLa0d3Dn/4ea9ab5b342cd394bd096349d4907ab0/image6.png" />
          </figure><p>This suggests that from a human perspective, password reuse is still a problem, as is users not taking immediate actions to change passwords when notified of a breach. And from a bot perspective, this suggests that attackers know that there is a good chance that leaked credentials for one website or application will enable them to access that same user’s account elsewhere.</p><p>As a complement to the leaked credentials data, Radar is also now providing a worldwide view into the <a href="https://radar.cloudflare.com/security/application-layer#bot-vs-human"><u>share of authentication requests originating from bots</u></a>. Note that not all of these requests are necessarily malicious — while some may be associated with <a href="https://www.cloudflare.com/learning/bots/what-is-credential-stuffing/">credential stuffing-style attacks</a>, others may be from automated scripts or other benign applications accessing an authentication endpoint. (Having said that, automated malicious attack request volume far exceeds legitimate automated login attempts.) During the first week of March 2025, we found that over 94% of authentication requests came from bots (were automated), with the balance coming from humans. Over that same period, <a href="https://radar.cloudflare.com/traffic?dateStart=2025-03-01&amp;dateEnd=2025-03-07#bot-vs-human"><u>bot traffic only accounted for 30% of overall requests</u></a>. So although bots don’t represent a majority of request traffic, authentication requests appear to comprise a significant portion of their activity.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/20tYE9sH7SOnJDsnh28ZYz/3c33320a0a7406a348c4b92d22f469ed/image4.png" />
          </figure>
    <div>
      <h3>Bots get a dedicated page</h3>
      <a href="#bots-get-a-dedicated-page">
        
      </a>
    </div>
    <p>As a reminder, <a href="https://www.cloudflare.com/learning/bots/what-is-a-bot/"><u>bot</u></a> traffic describes any non-human Internet traffic, and monitoring bot levels can help spot potential malicious activities. Of course, bots can be helpful too, and Cloudflare maintains a list of <a href="https://radar.cloudflare.com/bots#verified-bots"><u>verified bots</u></a> to help keep the Internet healthy. Given the importance of monitoring bot activity, we have launched a new dedicated <a href="https://radar.cloudflare.com/bots"><b><u>Bots</u></b></a> page in the Traffic section of Cloudflare Radar to support these efforts. For both worldwide and location views over the selected time period, the page shows the distribution of bot (automated) vs. human HTTP requests, as well as a graph showing bot traffic trends. (Our <a href="https://developers.cloudflare.com/bots/concepts/bot-score/"><u>bot score</u></a>, combining machine learning, heuristics, and other techniques, is used to identify automated requests likely to be coming from bots.) </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5bvoSNcGRbc2I5RGhZoIdo/948eca1e82148a1db6130295c0ea2f42/image2.png" />
          </figure><p>Both the <a href="https://radar.cloudflare.com/year-in-review/2023/#bot-traffic-sources"><u>2023</u></a> and <a href="https://radar.cloudflare.com/year-in-review/2024#bot-traffic-sources"><u>2024</u></a> Cloudflare Radar Year in Review microsites included a “Bot Traffic Sources” section, showing the locations and networks that Cloudflare determined that the largest shares of <a href="https://developers.cloudflare.com/bots/concepts/bot-score/"><u>automated/likely automated</u></a> traffic was originating from. However, these traffic shares were published just once a year, aggregating traffic from January through the end of November.</p><p>In order to provide a more timely perspective, these insights are now available on the new Radar Bots page. Similar to the new <a href="https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/">DDoS attacks</a> content discussed above, the <a href="https://radar.cloudflare.com/bots#bot-traffic-sources"><u>worldwide view</u></a> includes a choropleth map and table illustrating the locations originating the largest shares of all bot traffic. (Note that a similar <a href="https://radar.cloudflare.com/traffic#traffic-characteristics"><u>Traffic Characteristics</u></a> map and table on the <a href="https://radar.cloudflare.com/traffic"><u>Traffic Overview page</u></a> ranks locations by the bot traffic share of the location’s total traffic.) Similar to Year in Review data linked above, the United States continues to originate the largest share of bot traffic.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/RPCiFgeihzYIbm4XIdQ1r/ae9afa59586266c785e4e9dfa8cb3428/image11.png" />
          </figure><p>In addition, the worldwide view also breaks out <a href="https://radar.cloudflare.com/bots#bot-traffic-share-by-autonomous-system"><u>bot traffic share by AS</u></a>, mirroring the treemap shown in the Year in Review. As we have noted <a href="https://blog.cloudflare.com/radar-2024-year-in-review/#the-united-states-was-responsible-for-over-a-third-of-global-bot-traffic-amazon-web-services-was-responsible-for-12-7-of-global-bot-traffic-and-7-8-came-from-google"><u>previously</u></a>, cloud platform providers account for a significant amount of bot traffic.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5CsXZNKOZ2ssiVaUzVVM51/5d8ad8b6a257eb0413be19fa101806c9/image8.png" />
          </figure><p>At a location level, depending on the country/region selected, the top sources of bot traffic may be cloud/hosting providers, consumer/business network providers, or a mix. For instance, <a href="https://radar.cloudflare.com/bots/fr#bot-traffic-sources"><u>France’s distribution</u></a> is shown below, and four ASNs account for just over half of the country’s bot traffic. Of these ASNs, two (<a href="https://radar.cloudflare.com/as16276"><u>AS16276</u></a> and <a href="https://radar.cloudflare.com/as12876"><u>AS12876</u></a>) belong to cloud/hosting providers, and two (<a href="https://radar.cloudflare.com/as3215"><u>AS3215</u></a> and <a href="https://radar.cloudflare.com/as12322"><u>AS12322</u></a>) belong to network providers.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4RM9zvPRa8NzfdTOFMvMcB/b04d53dd725d1890918668775b551004/image9.png" />
          </figure><p>In addition, the <a href="https://radar.cloudflare.com/bots#verified-bots"><u>Verified Bots list</u></a> has been moved to the new Bots page on Radar. The data shown and functionality remains unchanged, and links to the old location will automatically be redirected to the new one.</p>
    <div>
      <h3>Summary</h3>
      <a href="#summary">
        
      </a>
    </div>
    <p>The Cloudflare dashboard provides customers with specific views of security trends, application and network layer attacks, and bot activity across their sites and applications. While these views are useful at an individual customer level, aggregated views at a worldwide, location, and network level provide a macro-level perspective on trends and activity. These aggregated views available on Cloudflare Radar not only help customers understand how their observations compare to the larger whole, but they also help the industry understand emerging threats that may require action.</p><p>The underlying data for the graphs and data discussed above is available via the Radar API (<a href="https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/"><u>Application Layer</u></a>, <a href="https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/"><u>Network Layer</u></a>, <a href="https://developers.cloudflare.com/api/resources/radar/subresources/http/"><u>Bots</u></a>, <a href="https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/"><u>Leaked Credentials</u></a>). The data can also be interactively explored in more detail across locations, networks, and time periods using Radar’s <a href="https://radar.cloudflare.com/explorer"><u>Data Explorer and AI Assistant</u></a>. And as always, Radar and Data Explorer charts and graphs are downloadable for sharing, and embeddable for use in your own blog posts, websites, or dashboards.</p><p>If you share our security, attacks, or bots graphs on social media, be sure to tag us: <a href="https://x.com/CloudflareRadar"><u>@CloudflareRadar</u></a> and <a href="https://x.com/1111Resolver"><u>@1111Resolver</u></a> (X), <a href="https://noc.social/@cloudflareradar"><u>noc.social/@cloudflareradar</u></a> (Mastodon), and <a href="https://bsky.app/profile/radar.cloudflare.com"><u>radar.cloudflare.com</u></a> (Bluesky). If you have questions or comments, you can reach out to us on social media, or <a href="#"><u>contact us via email</u></a>.</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[Radar]]></category>
            <category><![CDATA[DDoS]]></category>
            <category><![CDATA[Bots]]></category>
            <category><![CDATA[Passwords]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">4VnSmFMYvyiJqbBjhjo0DH</guid>
            <dc:creator>David Belson</dc:creator>
        </item>
        <item>
            <title><![CDATA[Helping keep customers safe with leaked password notification]]></title>
            <link>https://blog.cloudflare.com/helping-keep-customers-safe-with-leaked-password-notification/</link>
            <pubDate>Mon, 24 Jun 2024 17:06:42 GMT</pubDate>
            <description><![CDATA[ To help protect against account compromise via credential stuffing attacks, Cloudflare will notify dashboard users when we detect that a password was found in an external data breach ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Password reuse is a real problem. When people use the same password across multiple services, it creates a risk that a breach of one service will give attackers access to a different, apparently unrelated, service. Attackers know people reuse passwords and build giant lists of known passwords and known usernames or email addresses.</p><p>If you got to the end of that paragraph and realized you’ve reused the same password multiple places, stop reading and go change those passwords. We’ll wait.</p><p>To help protect Cloudflare customers who have used a password attackers know about, we are releasing a feature to improve the security of the Cloudflare dashboard for all our customers by automatically checking whether their Cloudflare user password has appeared in an attacker's list. Cloudflare will securely check a customer’s password against threat intelligence sources that monitor data breaches in other services.</p><p>If a customer logs in to Cloudflare with a password that was leaked in a breach elsewhere on the Internet, Cloudflare will alert them and ask them to choose a new password.</p><p>For some customers, the news that their password was known to hackers will come as a surprise – no one wants to intentionally use passwords that they know have been leaked elsewhere. To help customers avoid being locked out when they urgently need to use their Cloudflare dashboard, the leaked password check will provide a warning to the customer for the first three login attempts. After those three attempts, Cloudflare will require that the customer reset their password.</p><p>Resetting a leaked password is just the first step in Internet account security. The best way to protect your Cloudflare account, or any account, is to add two-factor authentication, such as using a hardware security key or an authenticator application, or to rely on a single sign-on integration. Cloudflare makes it easy for any user to <a href="https://developers.cloudflare.com/fundamentals/setup/account/account-security/2fa/#enable-two-factor-authentication-for-your-cloudflare-account">add two-factor authentication security to their account</a> through app-based codes, hardware keys, or passkeys. Cloudflare account Super Administrators can also require that all members enable two-factor authentication.</p><p>Whether or not a user has been impacted in a data breach, we encourage everyone to add two-factor authentication security to their Cloudflare account.</p>
    <div>
      <h3>How do credentials leak?</h3>
      <a href="#how-do-credentials-leak">
        
      </a>
    </div>
    <p>Each time you authenticate to a service on the Internet with a username and password, that service can take a range of steps to protect your credentials.</p><p>More secure providers will hash the passwords. <a href="https://www.authgear.com/post/password-hashing-salting#hashing">Hashing</a> uses a cryptographic algorithm to convert the password into a random string of characters. Some platforms will layer on additional safeguards like a <a href="https://www.authgear.com/post/password-hashing-salting#salting">salt</a> mechanism that introduces a random value to each password before the hashing process to ensure that two identical passwords do not have identical hashes.</p><p>These protections, combined with rate limits on login attempts, prevent brute force attacks. However, even for providers that adopt these best practices, users can still become victims of determined attackers when bad actors gain access to breached password databases. Attackers can collect compromised email password pairs to gain access to user accounts elsewhere as part of targeted attacks.</p><p>When vendors discover these kinds of compromised accounts, in many cases they will quickly force a password reset. However, resetting a leaked password in one application can still leave you vulnerable in other applications if you reused that password in other places and do not change your credentials everywhere.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/410DAKcAIJaJmKI71DfN3L/71c68701609b8ead70dbdea2f37215fd/image3-13.png" />
            
            </figure><p>That kind of password reuse means that an attacker can steal your credentials from one Internet service and try them against dozens of other popular destinations to see where you reuse the same password.</p><p>These so-called <a href="https://www.cloudflare.com/learning/bots/what-is-credential-stuffing/">credential stuffing attacks</a> have become more prevalent as breaches pile up. Attackers can sit on large troves of credentials for months or years, waiting to sell them to another bad actor or to use them in targeted attacks. For customers who want to protect themselves from these and other attacks that can compromise their end customer’s accounts, Cloudflare has solutions like <a href="/account-takeover-protection/">bot management, exposed credential checks, and rate limiting</a> available to help defend against these kinds of attacks</p>
    <div>
      <h3>How can customers protect against the impact of leaked credentials?</h3>
      <a href="#how-can-customers-protect-against-the-impact-of-leaked-credentials">
        
      </a>
    </div>
    <p>If every password you use is unique, then a data breach in one vendor will be limited to just that particular system. For that reason, we encourage users to adopt a password manager that can create and remember unique passwords for each service that you use. Thankfully, the most popular operating systems now include password managers by default, and multiplatform third party options also make it easy for users to adopt this practice.</p><p>However, unique passwords are still vulnerable to phishing attacks. The best way to protect any Internet account is to add two-factor authentication (2FA). Two-factor authentication provides a comprehensive defense against credential stuffing attacks. When using two-factor authentication to log in, you must use your password and, for example, a one-time code from an app or a tap on a physical hardware key. The password alone is not enough to access your account.</p><p>Adoption of two-factor authentication, specifically hardware keys, has been <a href="https://www.microsoft.com/en-us/security/blog/2019/08/20/one-simple-action-you-can-take-to-prevent-99-9-percent-of-account-attacks/">shown to be able to eliminate 99.9% of account takeovers</a>, since the attacker must also get access to your second factor in addition to your password. In the case of hardware keys, they need to physically obtain the key.</p>
    <div>
      <h3>How does Cloudflare check for leaked credentials?</h3>
      <a href="#how-does-cloudflare-check-for-leaked-credentials">
        
      </a>
    </div>
    <p>When a user attempts to log into Cloudflare, we will check if the password used has been leaked in a known data breach of another service or application on the Internet. We maintain data on breaches of Internet services that we can use to search against. Because we use password hashes, scrambled versions of the original password that can’t be easily reversed, we compare a hash of the password to hashes of compromised passwords found in these lists from other attacks. An additional benefit, beside the security of hashes, is the ability to perform fast lookups, much faster than plaintext searches. This means that we can perform these checks without adding significant latency to the login process for users.</p><p>Because of the potential impact of a Cloudflare account being compromised, we opt for a more secure approach of disallowing leaked credentials regardless of whether they were associated with the specific user’s email or not. Unfortunately, data breaches are likely to continue to happen. Therefore, being proactive helps reduce the risk of new breaches that contain the email and password pair allowing for an account to be compromised before the data is available to us.</p><p>If we detect a match, the user will be prompted with the following warning. We will also send an email notification with instructions on what to do and a unique link in order to reset the password.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/bCm8LmZVjuGn70hDdjVT2/7c554325a98559d54ae2f5683f75090a/Screenshot-2024-06-24-at-10.16.02-AM.png" />
            
            </figure><p>At this point, the user will still be able to log in to their Cloudflare account. We strongly encourage users to reset their password immediately. However, we know that in some cases you need to reach the Cloudflare dashboard immediately or do not have convenient access to the email used for the account. Cloudflare will allow two additional login attempts to succeed with the same compromised password before forcing the user to reset their password.</p><p>To reset a password in Cloudflare Dashboard, navigate to the <a href="https://dash.cloudflare.com/profile/authentication"><b>Authentication</b> page</a> in <b>My Profile</b>. From here, select <b>Change Password</b> and enter both the current password to authenticate and a new, non-compromised password. Alternatively, for those whose password was leaked, upon login an email will be sent with a unique link to reset the password.</p>
    <div>
      <h3>What’s next?</h3>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>Forcing users to reset compromised credentials helps prevent attacks from spreading on the Internet, but it’s just a small piece of improved account security. We know that adding the next step, second factor authentication, can be cumbersome. We have committed to <a href="https://www.cisa.gov/securebydesign">CISA’s Secure by Design Pledge</a>, which includes working to increase 2FA adoption across the industry. We will share our plans on how we will be implementing the pledge by mid-2025.</p><p>Adding multifactor authentication to every one of your accounts on the Internet can still be a chore, no matter how much the experience is improved. It’s much easier if you can just do it with one account and use that account to authenticate into other services and applications – a single-sign on (SSO) flow. Right now, our SSO feature is limited to enterprise accounts, and we plan to change that. We will allow users to access Cloudflare through other providers like Google, GitHub, and more. Allowing users to reduce how many unique password and 2FA combinations they have to keep track of helps to reduce the likelihood of being impacted by future password breaches.</p> ]]></content:encoded>
            <category><![CDATA[Passwords]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">OEX1mcgZrCSgEplJZHr1h</guid>
            <dc:creator>Garrett Galow</dc:creator>
        </item>
        <item>
            <title><![CDATA[Research Directions in Password Security]]></title>
            <link>https://blog.cloudflare.com/research-directions-in-password-security/</link>
            <pubDate>Thu, 14 Oct 2021 12:59:14 GMT</pubDate>
            <description><![CDATA[ We've been studying password problems, including malicious logins using compromised credentials. Here's what we learned and here's where we think we can go from here with safer password systems. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>As Internet users, we all deal with passwords every day. With so many different services, each with their own login systems, we have to somehow keep track of the credentials we use with each of these services. This situation leads some users to delegate credential storage to password managers like LastPass or a browser-based password manager, but this is far from universal. Instead, many people still rely on old-fashioned human memory, which has its limitations — leading to reused passwords and to security problems. This blog post discusses how Cloudflare Research is exploring how to minimize password exposure and thwart password attacks.</p>
    <div>
      <h2>The Problem of Password Reuse</h2>
      <a href="#the-problem-of-password-reuse">
        
      </a>
    </div>
    <p>Because it’s too difficult to remember many distinct passwords, people often reuse them across different online services. When breached password datasets are leaked online, attackers can take advantage of these to conduct “credential stuffing attacks”. In a credential stuffing attack, an attacker tests breached credentials against multiple online login systems in an attempt to hijack user accounts. These attacks are highly effective because users tend to reuse the same credentials across different websites, and they have quickly become one of the most prevalent types of online guessing attacks. Automated attacks can be run at a large scale, testing out exposed passwords across multiple systems, under the assumption that some of these passwords will unlock accounts somewhere else (if they have been reused). When a data breach is detected, users of that service will likely receive a security notification and will reset that account password. However, if this password was reused elsewhere, they may easily forget that it needs to be changed for those accounts as well.</p><p>How can we protect against credential stuffing attacks? There are a number of methods that have been deployed — with varying degrees of success. Password managers address the problem of remembering a strong, unique password for every account, but many users have yet to adopt them. Multi-factor authentication is another potential solution — that is, using another form of authentication in addition to the username/password pair. This can work well, but has limits: for example, such solutions may rely on specialized hardware that not all clients have. Consumer systems are often reluctant to mandate multi-factor authentication, given concerns that people may find it too complicated to use; companies do not want to deploy something that risks impeding the growth of their user base.</p><p>Since there is no perfect solution, security researchers continue to try to find improvements. Two different approaches we will discuss in this blog post are hardening password systems using cryptographically secure keys, and detecting the reuse of compromised credentials, so they don’t leave an account open to guessing attacks.</p>
    <div>
      <h2>Improved Authentication with PAKEs</h2>
      <a href="#improved-authentication-with-pakes">
        
      </a>
    </div>
    <p>Investigating how to securely authenticate a user just using what they can remember has been an important area in secure communication. To this end, the subarea of cryptography known as Password Authenticated Key Exchange (PAKE) came about. PAKEs deal with protocols for establishing cryptographically secure keys where the only source of authentication is a human memorizable (low-entropy, attacker-guessable) password — that is, the “what you know” side of authentication.</p><p>Before diving into the details, we’ll provide a high-level overview of the basic problem. Although passwords are typically protected in transit by being sent over HTTPS, servers handle them in <i>plaintext</i> to verify them once they arrive. Handling plaintext passwords increases security risk — for instance, they might get inadvertently logged and exposed. Ideally, the user’s password never gets sent to the server in the first place. This is where PAKEs come in — a means of verifying that the user and server share a password, ideally without revealing information about the password that could help attackers to discover or crack it.</p>
    <div>
      <h3>A few words on PAKEs</h3>
      <a href="#a-few-words-on-pakes">
        
      </a>
    </div>
    <p>PAKE protocols let two parties turn a password into a shared key. Each party only gets one guess at the password the other holds. If a user tries to log in to the wrong server with a PAKE, that server will not be able to turn around and impersonate the user. As such, PAKEs guarantee that communication with one of the parties is the only way for an attacker to test their (single) password guess. This may seem like an unneeded level of complexity when we could use already available tools like a key distribution mechanism along with <a href="/opaque-oblivious-passwords/">password-over-TLS</a>, but this puts a lot of trust in the service. You may trust a service with learning your password on that service, but what about if you accidentally use a password for a different service when trying to log in? Note the particular risks of a reused password: it is no longer just a secret shared between a user and a <i>single</i> service, but is now a secret shared between a user and <i>multiple</i> services. This therefore increases the password’s privacy sensitivity — a service should not know users’ account login information for <i>other</i> services.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/953CGN6o81Ak25ZlQLpdL/3b467111621985bded03b137ad464c1c/ifYbW6e-iYo9uU3KtBcbMzgURxbxi5Q-29EBuZT46b9RypGo3zco16W3sx9UuACOVKTpKe6ZiJq3QUoZQM3v9_G22YDk6cQJeXIVOlRbjP2C0ssQrMVG7qhDM7XM.png" />
            
            </figure><p>A comparison of shared secrets between passwords over TLS versus PAKEs.With passwords over TLS, a service might learn passwords used on another service. This problem does not arise with PAKEs.</p><p>PAKE protocols are built with the assumption that the server isn’t always working in the best interest of the client and, even more, cannot use any kind of public-key infrastructure during login (although it doesn’t hurt to have both!). This precludes the user from sending their plaintext password (or any information that could be used to derive it —  in a computational sense) to the server during login.</p><p>PAKE protocols have expanded into new territory since the <a href="https://scholar.google.com/scholar?cluster=2364773997049033938&amp;hl=en&amp;as_sdt=0,31">seminal EKE paper of Bellovin and Merritt</a>, where the client and server both remembered a plaintext version of the password. As mentioned above, when the server stores the plaintext password, the client risks having the password logged or leaked. To address this, new protocols were developed, referred to as augmented, verifier-based, or <b>asymmetric PAKE</b>s (aPAKEs), where the server stored a modified version (similar to a hash) of the password instead of the plaintext password. This mirrors the way many of us were <a href="/keeping-passwords-safe-by-staying-up-to-date/">taught to store passwords</a> in a database, specifically as a hash of the password with accompanying salt and pepper. However, in these cases, attackers can still use traditional methods of attack such as targeted rainbow tables. To avoid these kinds of attacks, a new kind of PAKE was born, the <b>strong asymmetric PAKE</b> (saPAKE).</p><p><a href="https://scholar.google.com/scholar?cluster=5047618283495879801&amp;hl=en&amp;as_sdt=0,31">OPAQUE was the first saPAKE</a> and it guarantees defense against precomputation by hiding the password dictionary itself! It does this by replacing the noninteractive hash function with an interactive protocol referred to as an Oblivious Pseudorandom Function (OPRF) where one party inputs their “salt”, another inputs their “password”, and only the password-providing party learns the output of the function. The fact that the password-providing party learns nothing (computationally) about the salt prevents offline precomputation by disallowing an attacker from evaluating the function in their head.</p><p>Another way to think about the three PAKE paradigms has to do with how each of them treats the password dictionary:</p><p>PAKE type</p><p>Password Dictionary</p><p>Threat Model</p><p>PAKE</p><p>The password dictionary is public and common to every user.</p><p>Without any guessing, the attacker learns the user’s password upon compromise of the server.</p><p>aPAKE</p><p>Each user gets their own password dictionary; a description of the dictionary (e.g., the “salt”) is leaked to the client when they attempt to log in.</p><p>The attacker must perform an independent precomputation for each client they want to attack.</p><p>saPAKE (e.g., OPAQUE)</p><p>Each user gets their own password dictionary; the server only provides an online interface (the OPRF) to the dictionary.</p><p>The adversary must wait until after they compromise the server to run an offline attack on the user’s password<sup>1</sup>.</p><p>OPAQUE also goes one step further and allows the user to perform the password transformation on their own device so that the server doesn’t see the plaintext password during registration either. Cloudflare Research has been involved with OPAQUE for a while now — for instance, you can read about our previous <a href="/opaque-oblivious-passwords/">implementation work and demo</a> if you want to learn more.</p><p>But OPAQUE is not a panacea: in the event of server compromise, the attacker can learn the salt that the server uses to evaluate the OPRF and can still run the same offline attack that was available in the aPAKE world, although this is now considerably more time-consuming and can be made increasingly difficult through the use of memory-hard hash functions like scrypt. This means that despite our best efforts, when a server is breached, the attacker can eventually come out with a list of plaintext passwords. Indeed, this attack is always inevitable as the attacker can always run the (sa)PAKE protocol in their head acting as both parties to test each password. With this being the case, we still need to take steps to defend against automated password attacks such as credential stuffing attacks and have ways of mitigating them.</p>
    <div>
      <h2>Are You Overexposed?</h2>
      <a href="#are-you-overexposed">
        
      </a>
    </div>
    <p>To help detect and respond to credential stuffing, Cloudflare recently <a href="/account-takeover-protection/">rolled out the Exposed Credential Checks feature</a> on the <a href="https://www.cloudflare.com/learning/ddos/glossary/web-application-firewall-waf/">Web Application Firewall (WAF)</a>, which can alert the origin if a user’s login credentials have appeared in a recent breach. Historically, compromised credential checking services have allowed users to be proactive against credential stuffing attacks when their username and password appear together in a breach. However, they do not account for <a href="https://scholar.google.com/scholar?cluster=1197873264049178787&amp;hl=en&amp;as_sdt=0,31">recently proposed credential tweaking attacks</a>, in which an attacker tries <i>variants</i> of a breached password, under the assumption that users often use slight modifications of the same password for different accounts, such as “sunshineFB”, “sunshineIG”, and so on. Therefore, compromised credential check services should incorporate methods of checking for credential tweaks.</p><p>Under the hood, Cloudflare’s Exposed Credential Checks feature relies on an underlying protocol deemed <a href="https://scholar.google.com/scholar?cluster=13673195091406912846&amp;hl=en&amp;as_sdt=0,31">Might I Get Pwned (MIGP)</a>. MIGP uses the bucketization method proposed in <a href="https://scholar.google.com/scholar?cluster=11401588548541554564&amp;hl=en&amp;as_sdt=0,31">Li et al.</a> to avoid sending the plaintext username or password to the server while handling a large breach dataset. After receiving a user’s credentials, MIGP hashes the username and sends a portion of that hash as a “bucket identifier” to the server. The client and server can then perform a private membership test protocol to verify whether the user’s username/password pair appeared in that bucket, without ever having to send plaintext credentials to the server.</p><p>Unlike previous compromised credential check services, MIGP also enables credential tweaking checks by augmenting the original breach dataset with a set of password “variants”. For each leaked password, it generates a list of password variants, which are labeled as such to differentiate them from the original leaked password and added to the original dataset. For more information, you can check out the Cloudflare Research <a href="/privacy-preserving-compromised-credential-checking">blog post</a> detailing our open-source implementation and deployment of the MIGP protocol.  </p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6s0cOYGpG1oabqonc0mF9O/11882b44b6803b77a7f7235c0e4efb01/image2-24.png" />
            
            </figure>
    <div>
      <h2>Measuring Credential Compromises</h2>
      <a href="#measuring-credential-compromises">
        
      </a>
    </div>
    <p>The question remains, just how important are these exposed credential checks for detecting and preventing credential stuffing attacks in practice? To answer this question, the Research Team has initiated a study investigating login requests to our own Cloudflare dashboard. For this study, we are collecting the data logged by Cloudflare’s Exposed Credential Check feature (described above), designed to be privacy-preserving: this check does not reveal a password, but provides a “yes/no” response on whether the submitted credentials appear in our breach dataset. Along with this signal, we are looking at other fields that may be indicative of malicious behavior such as <a href="/mitigating-bot-attacks-against-cloudflare/">bot score</a> and IP reputation. As this project develops, we plan to cluster the data to find patterns of different types of credential stuffing attacks that we can generalize to form attack fingerprints. We can then feed these fingerprints into the alert logs for the Cloudflare Detection &amp; Response team to see if they provide useful information for the security analysts.</p><p>Additionally, we hope to investigate potential post-compromise behavior as it relates to these compromise check fields. After an attacker successfully hijacks an account, they may take a number of actions such as changing the password, revoking all valid access tokens, or setting up a malicious script. By analyzing compromised credential checks along with these signals, we may be able to better differentiate benign from malicious behavior.</p>
    <div>
      <h3>Future directions: OPAQUE and MIGP combined</h3>
      <a href="#future-directions-opaque-and-migp-combined">
        
      </a>
    </div>
    <p>This post has discussed how we’re approaching the problem of preventing credential stuffing attacks from two different angles. Through the deployment and analysis of compromised credential checks, we aim to prevent server compromise by detecting and preventing credential stuffing attacks before they happen. In addition, in the case that a server does get compromised, the wider use of OPAQUE would help address the problem of leaking passwords to an attacker by avoiding the reception and storage of plaintext passwords on the server as well as preventing precomputation attacks.</p><p>However, there are still remaining research challenges to address. Notably, the current method for interfacing with MIGP still requires the server to either pass along a plaintext version of the client’s password, or trust the client to honestly communicate with the MIGP service on behalf of the server. If we want to leverage the security guarantees of OPAQUE (or generally an saPAKE) with the analytics and alert system provided by MIGP in a privacy-preserving way, we need additional mechanisms.</p><p>At first glance, the privacy-preserving goals of both protocols seem to be perfect matches for each other. Both OPAQUE and MIGP are built upon the idea of replacing the traditional salted password hashes with an OPRF as a way of keeping the client’s plaintext passwords from ever leaving their device. However, both the interfaces for these protocols rely on user-provided inputs which aren’t cryptographically tied to each other. This allows an attacker to provide a false password to MIGP while providing their actual password to the OPAQUE server. Further, the security analysis of both protocols assume that their idealized building blocks are separated in an important way. This isn’t to say that the two protocols are incompatible, and indeed, much of these protocols may be salvaged.</p><p>The next stages for password privacy will be an integration of these two protocols such that a server can be made aware of credential stuffing attacks and the patterns of compromised account usage that can protect a server against the compromise of other servers while providing the same privacy guarantees OPAQUE does. Our goal is to allow you to protect yourself from <i>other</i> compromised servers while protecting your clients from compromise of <i>your</i> server. Stay tuned for updates!</p><p>We’re always keen to collaborate with others to build more secure systems, and would love to hear from those interested in password research. You can reach us with questions, comments, and research ideas at <a href="#">ask-research@cloudflare.com</a>. For those interested in joining our team, please visit our <a href="https://www.cloudflare.com/careers/jobs/?department=Technology%20Research&amp;location=default">Careers Page</a>.</p><p>...</p><p><sup>1</sup>There are other ways of constructing saPAKE protocols. The curious reader can see <a href="https://scholar.google.com/scholar?cluster=7458935618932751816&amp;hl=en&amp;as_sdt=0,31">this CRYPTO 2019 paper</a> for details.</p> ]]></content:encoded>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Salt]]></category>
            <category><![CDATA[Passwords]]></category>
            <guid isPermaLink="false">5KZNCnkEzTgAysfN3nPrLX</guid>
            <dc:creator>Ian McQuoid</dc:creator>
            <dc:creator>Marina Sanusi</dc:creator>
            <dc:creator>Tara Whalen</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[OPAQUE: The Best Passwords Never Leave your Device]]></title>
            <link>https://blog.cloudflare.com/opaque-oblivious-passwords/</link>
            <pubDate>Tue, 08 Dec 2020 12:00:00 GMT</pubDate>
            <description><![CDATA[ Imagine passwords for online services that never leave your device, encrypted or otherwise. OPAQUE is a new cryptographic protocol that makes this idea possible, giving you and only you full control of your password. ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/ooidY51NqRXSzRAvVf2Kc/d952f9c1e38f135a535cbd1641b03d0f/Opaque-Header-1.png" />
            
            </figure><p><i>Update: On January 19, 2022, we added </i><a href="https://opaque-full.research.cloudflare.com/"><i>a new demo for the OPAQUE protocol</i></a><i>.</i></p><p>Passwords are a problem. They are a problem for reasons that are familiar to most readers. For us at Cloudflare, the problem lies much deeper and broader. Most readers will immediately acknowledge that passwords are hard to remember and manage, especially as password requirements grow increasingly complex. Luckily there are great software packages and browser add-ons to help manage passwords. Unfortunately, the greater underlying problem is beyond the reaches of software to solve.</p><p>The fundamental password problem is simple to explain, but hard to solve: A password that leaves your possession is guaranteed to sacrifice security, no matter its complexity or how hard it may be to guess. Passwords are insecure by their very existence.</p><p>You might say, “but passwords are always stored in encrypted format!” That would be great. More accurately, they are likely stored as a salted hash, as explained below. Even worse is that there is no way to verify the way that passwords are stored, and so we can assume that on some servers passwords are stored in cleartext. The truth is that even responsibly stored passwords can be leaked and broken, albeit (and thankfully) with enormous effort. An increasingly pressing problem stems from the nature of passwords themselves: any direct use of a password, today, means that the password must be handled in the clear.</p><p>You say, “but my password is transmitted securely over HTTPS!” This is true.</p><p>You say, “but I know the server stores my password in hashed form, secure so no one can access it!” Well, this puts a lot of faith in the server. Even so, let’s just say that yes, this may be true, too.</p><p>There remains, however, an important caveat — a gap in the end-to-end use of passwords. Consider that once a server receives a password, between being securely transmitted and securely stored, the password has to be read and processed. Yes, as cleartext!</p><p>And it gets worse — because so many are used to thinking in software, it’s easy to forget about the vulnerability of hardware. This means that even if the software is somehow trusted, the password must at some point reside in memory. The password must at some point be transmitted over a shared bus to the CPU. These provide vectors of attack to on-lookers in many forms. Of course, these attack vectors are far less likely than those presented by transmission and permanent storage, but they are no less severe (recent CPU vulnerabilities such as Spectre and Meltdown should serve as a stark reminder.)</p><p>The only way to fix this problem is to get rid of passwords altogether. There is hope! Research and private sector communities are working hard to do just that. New standards are emerging and growing mature. Unfortunately, passwords are so ubiquitous that it will take a long time to agree on and supplant passwords with new standards and technology.</p><p>At Cloudflare, we’ve been asking if there is something that can be done now, imminently. Today’s deep-dive into OPAQUE is one possible answer. OPAQUE is one among many examples of systems that enable a password to be useful without it ever leaving your possession. No one likes passwords, but as long they’re in use, at least we can ensure they are never given away.</p><p>I’ll be the first to admit that password-based authentication is annoying. Passwords are hard to remember, tedious to type, and notoriously insecure. Initiatives to reduce or replace passwords are promising. For example, <a href="/cloudflare-now-supports-security-keys-with-web-authentication-webauthn/">WebAuthn</a> is a standard for web authentication based primarily on public key cryptography using hardware <a href="https://github.com/github/SoftU2F">(or software)</a> tokens. Even so, passwords are frustratingly persistent as an authentication mechanism. Whether their persistence is due to their ease of implementation, familiarity to users, or simple ubiquity on the web and elsewhere, we’d like to make password-based authentication as secure as possible while they persist.</p><p>My internship at Cloudflare focused on OPAQUE, a cryptographic protocol that solves one of the most glaring security issues with password-based authentication on the web: though passwords are typically protected in transit by HTTPS, <b>servers</b> <b>handle them in plaintext</b> to check their correctness. Handling plaintext passwords is dangerous, as accidentally logging or caching them could lead to a catastrophic breach. The goal of the project, rather than to advocate for adoption of any particular protocol, is to show that OPAQUE is a viable option among many for authentication. Because the web case is most familiar to me, and likely many readers, I will use the web as my main example.</p>
    <div>
      <h3>Web Authentication 101: Password-over-TLS</h3>
      <a href="#web-authentication-101-password-over-tls">
        
      </a>
    </div>
    <p>When you type in a password on the web, what happens? The website must check that the password you typed is the same as the one you originally registered with the site. But how does this check work?</p><p>Usually, your username and password are sent to a server. The server then checks if the registered password associated with your username matches the password you provided. Of course, to prevent an attacker eavesdropping on your Internet traffic from stealing your password, your connection to the server should be encrypted via HTTPS (HTTP-over-TLS).</p><p>Despite use of HTTPS, there still remains a glaring problem in this flow: the server must store a representation of your password somewhere. Servers are hard to secure, and breaches are all too common. Leaking this representation can cause catastrophic security problems. (For records of the latest breaches, check out <a href="https://haveibeenpwned.com/">https://haveibeenpwned.com/</a>).</p><p>To make these leaks less devastating, servers often apply a <i>hash function</i> to user passwords. A hash function maps each password to a unique, random-looking value. It’s easy to apply the hash to a password, but almost impossible to reverse the function and retrieve the password. (That said, anyone can guess a password, apply the hash function, and check if the result is the same.)</p><p>With password hashing, plaintext passwords are no longer stored on servers.  An attacker who steals a password database no longer has direct access to passwords. Instead, the attacker must apply the hash to many possible passwords and compare the results with the leaked hashes.</p><p>Unfortunately, if a server hashes only the passwords, attackers can download precomputed <i>rainbow tables</i> containing hashes of trillions of possible passwords and almost instantly retrieve the plaintext passwords. (See <a href="https://project-rainbowcrack.com/table.htm">https://project-rainbowcrack.com/table.htm</a> for a list of some rainbow tables).</p><p>With this in mind, a good defense-in-depth strategy is to use <i>salted</i> hashing, where the server hashes your password appended to a random, per-user value called a <i>salt</i>. The server also saves the salt alongside the username, so the user never sees or needs to submit it. When the user submits a password, the server re-computes this hash function using the salt. An attacker who steals password data, i.e., the password representations and salt values, must then guess common passwords one by one and apply the (salted) hash function to each guessed password. Existing rainbow tables won’t help because they don’t take the salts into account, so the attacker needs to make a new rainbow table for each user!</p><p>This (hopefully) slows down the attack enough for the service to inform users of a breach, so they can change their passwords. In addition, the salted hashes should be <i>hardened</i> by applying a hash many times to further slow attacks. (See <a href="/keeping-passwords-safe-by-staying-up-to-date/">https://blog.cloudflare.com/keeping-passwords-safe-by-staying-up-to-date/</a> for a more detailed discussion).</p><p>These two mitigation strategies — encrypting the password in transit and storing salted, hardened hashes — are the current best practices.</p><p>A large security hole remains open. <i>Password-over-TLS</i> (as we will call it) requires users to <b>send plaintext passwords to servers during login</b>, because servers must see these passwords to match against registered passwords on file. Even a well-meaning server could accidentally cache or log your password attempt(s), or become corrupted in the course of checking passwords. (For example, Facebook detected in 2019 that it had <a href="https://about.fb.com/news/2019/03/keeping-passwords-secure/">accidentally been storing hundreds of millions of plaintext user passwords</a>). Ideally, servers should never see a plaintext password at all.</p><p>But that’s quite a conundrum: how can you check a password if you never see the password? Enter OPAQUE: a Password-Authenticated Key Exchange (PAKE) protocol that simultaneously proves knowledge of a password and derives a secret key. Before describing OPAQUE in detail, we’ll first summarize PAKE functionalities in general.</p>
    <div>
      <h3>Password Proofs with Password-Authenticated Key Exchange</h3>
      <a href="#password-proofs-with-password-authenticated-key-exchange">
        
      </a>
    </div>
    <p>Password-Authenticated Key Exchange (PAKE) was proposed by Bellovin and Merrit[1] in 1992, with an initial motivation of allowing password-authentication without the possibility of dictionary attacks based on data transmitted over an insecure channel.</p><p>Essentially, a plain, or <i>symmetric</i>, PAKE is a cryptographic protocol that allows two parties who share only a password to establish a strong shared secret key. The goals of PAKE are:</p><ol><li><p>The secret keys will match if the passwords match, and appear random otherwise.</p></li><li><p>Participants do not need to trust third parties (in particular, no Public Key Infrastructure),</p></li><li><p>The resulting secret key is not learned by anyone not participating in the protocol - including those who know the password.</p></li><li><p>The protocol does not reveal either parties’ password to each other (unless the passwords match), or to eavesdroppers.</p></li></ol><p>In sum, the only way to successfully attack the protocol is to guess the password correctly while participating in the protocol. (Luckily, such attacks can be mostly thwarted by rate-limiting, i.e, blocking a user from logging in after a certain number of incorrect password attempts).</p><p>Given these requirements, password-over-TLS is clearly <i>not</i> a PAKE, because:</p><ul><li><p>It relies on WebPKI, which places trust in third-parties called Certificate Authorities (see <a href="/introducing-certificate-transparency-and-nimbus/">https://blog.cloudflare.com/introducing-certificate-transparency-and-nimbus/</a> for an in-depth explanation of WebPKI and some of its shortcomings).</p></li><li><p>The user’s password is revealed to the server.</p></li><li><p>Password-over-TLS provides the user no assurance that the server knows their password or a derivative of it — a server could accept any input from the user with no checks whatsoever.</p></li></ul><p>That said, plain PAKE is still worse than Password-over-TLS, simply because it requires the server to <i>store</i> plaintext passwords. We need a PAKE that lets the server store salted hashes if we want to beat the current practice.</p><p>An improvement over plain PAKE is what’s called an <i>asymmetric</i> PAKE (aPAKE), because only the client knows the password, and the server knows a <i>hashed</i> password. An aPAKE has the four properties of PAKE, plus one more:</p><ol><li><p>An attacker who steals password data stored on the server must perform a dictionary attack to retrieve the password.</p></li></ol><p>The issue with most existing aPAKE protocols, however, is that they do not allow for a <i>salted</i> hash (or if they do, they require that salt to be transmitted to the user, which means the attacker has access to the salt beforehand and can begin computing a rainbow table for the user before stealing any data). We’d like, therefore, to upgrade the security property as follows:</p><p>5*) An attacker who steals password data stored on the server must perform a <i>per-user</i> dictionary attack to retrieve the password <i>after the data is compromised</i>.</p><p>OPAQUE is the first aPAKE protocol with a formal security proof that has this property: it allows for a completely secret salt.</p>
    <div>
      <h3>OPAQUE - Servers safeguard secrets without knowing them!</h3>
      <a href="#opaque-servers-safeguard-secrets-without-knowing-them">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/39WP72kgESNW6mjf08g5UM/db539617b444e7683825d02b9d704b14/opaque-wordmark.png" />
            
            </figure><p><a href="https://eprint.iacr.org/2018/163.pdf">OPAQUE</a> is what’s referred to as a <i>strong aPAKE</i>, which simply means that it resists these pre-computation attacks by using a secretly salted hash on the server. OPAQUE was proposed and formally analyzed by Stanislaw Jarecki, Hugo Krawcyzk and Jiayu Xu in 2018 (full disclosure: Stanislaw Jarecki is my academic advisor). The name OPAQUE is a combination of the names of two cryptographic protocols: OPRF and PAKE. We already know PAKE, but what is an OPRF? OPRF stands for Oblivious Pseudo-Random Function, which is a protocol by which two parties compute a function <i>F(key, x)</i> that is deterministic but outputs random-looking values. One party inputs the value <i>x</i>, and another party inputs the key - the party who inputs <i>x</i> learns the result <i>F(key, x)</i> but not the key, and the party providing the key learns nothing.  (You can dive into the math of OPRFs here: <a href="/privacy-pass-the-math/">https://blog.cloudflare.com/privacy-pass-the-math/</a>).</p><p>The core of OPAQUE is a method to store user secrets for safekeeping on a server, without giving the server access to those secrets. Instead of storing a traditional salted password hash, the server stores a secret envelope for you that is “locked” by two pieces of information: your password known only by you, and a random secret key (like a salt) known only by the server. To log in, the client initiates a cryptographic exchange that reveals the envelope key to the client, but, importantly, not to the server.</p><p>The server then sends the envelope to the user, who now can retrieve the encrypted keys. (The keys included in the envelope are a private-public key pair for the user, and a public key for the server.) These keys, once unlocked, will be the inputs to an Authenticated Key Exchange (AKE) protocol, which allows the user and server to establish a secret key which can be used to encrypt their future communication.</p><p>OPAQUE consists of two phases, being credential registration and login via key exchange.</p>
    <div>
      <h3>OPAQUE: Registration Phase</h3>
      <a href="#opaque-registration-phase">
        
      </a>
    </div>
    <p>Before registration, the user first signs up for a service and picks a username and password. Registration begins with the OPRF flow we just described: Alice (the user) and Bob (the server) do an OPRF exchange. The result is that Alice has a random key <b><i>rwd</i></b>, derived from the OPRF output <i>F(key, pwd), where key</i> is a server-owned OPRF key specific to Alice and <i>pwd</i> is Alice’s password.</p><p>Within his OPRF message, Bob sends the public key for his OPAQUE identity. Alice then generates a new private/public key pair, which will be her persistent OPAQUE identity for Bob’s service, and encrypts <i>her</i> private key along with <i>Bob’s</i> public key with the <b>rwd</b> (we will call the result an <i>encrypted envelope</i>). She sends this encrypted envelope along with her public key (unencrypted) to Bob, who stores the data she provided, along with Alice’s specific OPRF keysecret, in a database indexed by her username.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5FwREcK0qMw6EVKrxDjUyg/399a52baf731039c16d03644a57cb5f2/OPAQUE-diagram-1_3x.png" />
            
            </figure>
    <div>
      <h3>OPAQUE: Login Phase</h3>
      <a href="#opaque-login-phase">
        
      </a>
    </div>
    <p>The login phase is very similar. It starts the same way as registration — with an OPRF flow. However, on the server side, instead of generating a new OPRF key, Bob instead looks up the one he created during Alice’s registration. He does this by looking up Alice’s username (which she provides in the first message), and retrieving his record of her. This record contains her public key, her encrypted envelope, and Bob’s OPRF key for Alice.</p><p>He also sends over the encrypted envelope which Alice can decrypt with the output of the OPRF flow. (If decryption fails, she aborts the protocol — this likely indicates that she typed her password incorrectly, or Bob isn’t who he says he is). If decryption succeeds, she now has her own secret key and Bob’s public key. She inputs these into an AKE protocol with Bob, who, in turn, inputs his private key and her public key, which gives them both a fresh shared secret key.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/75WquAD9w7Z3AJ8RcBdtiF/03e77ccaad51380d96fcc8e1c395d1b8/OPAQUE-diagram-2_3x.png" />
            
            </figure>
    <div>
      <h3>Integrating OPAQUE with an AKE</h3>
      <a href="#integrating-opaque-with-an-ake">
        
      </a>
    </div>
    <p>An important question to ask here is: what AKE is suitable for OPAQUE? The <a href="https://tools.ietf.org/html/draft-irtf-cfrg-opaque-01">emerging CFRG specification</a> outlines several options, including 3DH and SIGMA-I. However, on the web, we already have an AKE at our disposal: TLS!</p><p>Recall that TLS is an AKE because it provides unilateral (and mutual) authentication with shared secret derivation. The core of TLS is a Diffie-Hellman key exchange, which by itself is <i>unauthenticated</i>, meaning that the parties running it have no way to verify who they are running it with. (This is a problem because when you log into your bank, or any other website that stores your private data, you want to be sure that they are who they say they are). Authentication primarily uses certificates, which are issued by trusted entities through a system called <a href="/how-to-build-your-own-public-key-infrastructure/">Public Key Infrastructure (PKI)</a>. Each certificate is associated with a secret key. To prove its identity, the server presents its certificate to the client, and signs the TLS handshake with its secret key.</p><p>Modifying this ubiquitous certificate-based authentication on the web is perhaps not the best place to start. Instead, an improvement would be to authenticate the TLS shared secret, <i>using</i> OPAQUE, after the TLS handshake completes. In other words, once a server is authenticated with its typical WebPKI certificate, clients could subsequently authenticate to the server. This authentication could take place “post handshake” in the TLS connection using OPAQUE.</p><p><a href="https://datatracker.ietf.org/doc/draft-ietf-tls-exported-authenticator/">Exported Authenticators</a> are one mechanism for “post-handshake” authentication in TLS. They allow a server or client to provide proof of an identity without setting up a new TLS connection. Recall that in the standard web case, the server establishes their identity with a certificate (proving, for example, that they are “cloudflare.com”). But if the same server also holds alternate identities, they must run TLS again to prove who they are.</p><p>The basic Exported Authenticator flow works resembles a classical challenge-response protocol, and works as follows. (We’ll consider the server authentication case only, as the client case is symmetric).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3eYv5LQOx1cD9iTFxqfkAC/3231d07f2a1b4a140b345454dc2ca2e0/OPAQUE-diagram-3_3x.png" />
            
            </figure><p>At any point after a TLS connection is established, Alice (the client) sends an <i>authenticator request</i> to indicate that she would like Bob (the server) to prove an additional identity. This request includes a context (an unpredictable string — think of this as a challenge), and extensions which include information about what identity the client wants to be provided. For example, the client could include the SNI extension to ask the server for a certificate associated with a certain domain name other than the one initially used in the TLS connection.</p><p>On receipt of the client message, if the server has a valid certificate corresponding to the request, it sends back an <i>exported authenticator</i> which proves that it has the secret key for the certificate. (This message has the same format as an Auth message from the client in TLS 1.3 handshake - it contains a Certificate, a CertificateVerify and a Finished message). If the server cannot or does not wish to authenticate with the requested certificate, it replies with an empty authenticator which contains only a well formed Finished message.</p><p>The client then checks that the Exported Authenticator it receives is well-formed, and then verifies that the certificate presented is valid, and if so, accepts the new identity.</p><p>In sum, Exported Authenticators provide authentication in a higher layer (such as the application layer) safely by leveraging the well-vetted cryptography and message formats of TLS. Furthermore, it is tied to the TLS session so that authentication messages can't be copied and pasted from one TLS connection into another. In other words, Exported Authenticators provide exactly the right hooks needed to add OPAQUE-based authentication into TLS.</p>
    <div>
      <h3>OPAQUE with Exported Authenticators (OPAQUE-EA)</h3>
      <a href="#opaque-with-exported-authenticators-opaque-ea">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/13SUbsSrju6qTw13hFBhoh/8a41eefa575f8661b6c0b821d4516b72/OPAQUE-diagram-2_3x-1.png" />
            
            </figure><p><a href="https://datatracker.ietf.org/doc/html/draft-sullivan-tls-opaque-00">OPAQUE-EA</a> allows OPAQUE to run at any point after a TLS connection has already been set up. Recall that Bob (the server) will store his OPAQUE identity, in this case a signing key and verification key, and Alice will store her identity — encrypted — on Bob’s server. (The registration flow where Alice stores her encrypted keys is the same as in regular OPAQUE, except she stores a signing key, so we will skip straight to the login flow). Alice and Bob run two request-authenticate EA flows, one for each party, and OPAQUE protocol messages ride along in the extensions section of the EAs. Let’s look in detail how this works.</p><p>First, Alice generates her OPRF message based on her password. She creates an Authenticator Request asking for Bob’s OPAQUE identity, and includes (in the extensions field) her username and her OPRF message, and sends this to Bob over their established TLS connection.</p><p>Bob receives the message and looks up Alice’s username in his database. He retrieves her OPAQUE record containing her verification key and encrypted envelope, and his OPRF key. He uses the OPRF key on the OPRF message, and creates an Exported Authenticator proving ownership of his OPAQUE signing key, with an extension containing his OPRF message and the encrypted envelope. Additionally, he sends a new Authenticator Request asking Alice to prove ownership of her OPAQUE signing key.</p><p>Alice parses the message and completes the OPRF evaluation using Bob’s message to get output <i>rwd</i>, and uses <i>rwd</i> to decrypt the envelope. This reveals her signing key and Bob’s public key. She uses Bob’s public key to validate his Authenticator Response proof, and, if it checks out, she creates and sends an Exported Authenticator proving that she holds the newly decrypted signing key. Bob checks the validity of her Exported Authenticator, and if it checks out, he accepts her login.</p>
    <div>
      <h3>My project: OPAQUE-EA over HTTPS</h3>
      <a href="#my-project-opaque-ea-over-https">
        
      </a>
    </div>
    <p>Everything described above is supported by lots and lots of theory that has yet to find its way into practice. My project was to turn the theory into reality. I started with written descriptions of <a href="https://tools.ietf.org/html/draft-ietf-tls-exported-authenticator-13">Exported Authenticators</a>, <a href="https://tools.ietf.org/html/draft-irtf-cfrg-opaque-01">OPAQUE</a>, and a preliminary draft of <a href="https://tools.ietf.org/html/draft-sullivan-tls-opaque-00">OPAQUE-in-TLS</a>. My goal was to get from those to a working prototype.</p><p>My demo shows the feasibility of implementing OPAQUE-EA on the web, completely removing plaintext passwords from the wire, even encrypted. This provides a possible alternative to the current password-over-TLS flow with better security properties, but no visible change to the user.</p><p>A few of the implementation details are worth knowing. In computer science, abstraction is a powerful tool. It means that we can often rely on existing tools and APIs to avoid duplication of effort. In my project I relied heavily on <a href="https://github.com/bifurcation/mint">mint</a>, an open-source implementation of TLS 1.3 in Go that is great for prototyping. I also used <a href="https://github.com/cloudflare/circl/tree/master/oprf">CIRCL’s OPRF API</a>. I built libraries for Exported Authenticators, the core of OPAQUE, and OPAQUE-EA (which ties together the two).</p><p>I made the web demo by wrapping the OPAQUE-EA functionality in a simple HTTP server and client that pass messages to each other over HTTPS. Since a browser can’t run Go, I compiled from Go to WebAssembly (WASM) to get the Go functionality in the browser, and wrote a simple script in JavaScript to call the WASM functions needed.</p><p>Since current browsers do not give access to the underlying TLS connection on the client side, I had to implement a work-around to allow the client to access the exporter keys, namely, that the server simply computes the keys and sends them to the client over HTTPS. This workaround reduces the security of the resulting demo — it means that trust is placed in the server to provide the right keys. Even so, the user’s password is still safe, even if a malicious server provided bad keys— they just don’t have assurance that they actually previously registered with that server. However, in the future, browsers could include a mechanism to support exported keys and allow OPAQUE-EA to run with its full security properties.</p><p>You can explore my implementation <a href="https://github.com/cloudflare/opaque-ea">on Github</a>, and even follow the instructions to spin up your own OPAQUE-EA test server and client. I’d like to stress, however, that the implementation is meant as a proof-of-concept only, and must not be used for production systems without significant further review.</p>
    <div>
      <h3>OPAQUE-EA Limitations</h3>
      <a href="#opaque-ea-limitations">
        
      </a>
    </div>
    <p>Despite its great properties, there will definitely be some hurdles in bringing OPAQUE-EA from a proof-of-concept to a fully fledged authentication mechanism.</p><p><b>Browser support for TLS exporter keys.</b> As mentioned briefly before, to run OPAQUE-EA in a browser, you need to access secrets from the TLS connection called <i>exporter keys</i>. There is no way to do this in the current most popular browsers, so support for this functionality will need to be added.</p><p><b>Overhauling password databases.</b> To adopt OPAQUE-EA, servers need not only to update their password-checking logic, but also completely overhaul their password databases. Because OPAQUE relies on special password representations that can only be generated interactively, existing salted hashed passwords cannot be automatically updated to OPAQUE records. Servers will likely need to run a special OPAQUE registration flow on a user-by-user basis. Because OPAQUE relies on buy-in from both the client and the server, servers may need to support the old method for a while before all clients catch up.</p><p><b>Reliance on emerging standards.</b> OPAQUE-EA relies on OPRFs, which is in the process of standardization, and Exported Authenticators, a proposed standard. This means that support for these dependencies is not yet available in most existing cryptographic libraries, so early adopters may need to implement these tools themselves.</p>
    <div>
      <h3>Summary</h3>
      <a href="#summary">
        
      </a>
    </div>
    <p>As long as people still use passwords, we’d like to make the process as secure as possible. Current methods rely on the risky practice of handling plaintext passwords on the server side while checking their correctness. PAKEs, and (specifically aPAKEs) allow secure password login without ever letting the server see the passwords.</p><p>OPAQUE is also being explored within other companies. According to Kevin Lewi, a research scientist from the Novi Research team at Facebook, they are “excited by the strong cryptographic guarantees provided by OPAQUE and are actively exploring OPAQUE as a method for further safeguarding credential-protected fields that are stored server-side.”</p><p>OPAQUE is one of the best aPAKEs out there, and can be fully integrated into TLS. You can check out the core OPAQUE implementation <a href="https://github.com/cloudflare/opaque-core">here</a> and the demo TLS integration <a href="https://github.com/cloudflare/opaque-ea">here</a>. A running version of the demo is also available <a href="https://opaque.research.cloudflare.com/">here</a>. A Typescript client implementation of OPAQUE is coming soon. If you're interested in implementing the protocol, or encounter any bugs with the current implementation, please drop us a line at <a href="#">ask-research@cloudflare.com</a>! Consider also subscribing to the <a href="https://irtf.org/cfrg">IRTF CFRG mailing list</a> to track discussion about the OPAQUE specification and its standardization.</p><p>[1] Bellovin, S. M., and Merritt, M. “Encrypted key exchange: Password-based protocols secure against dictionary attacks.” In Proc. IEEE Computer Society Symposium on Research in Security and Privacy (Oakland, May 1992), pp. 72–84.</p> ]]></content:encoded>
            <category><![CDATA[Privacy Week]]></category>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[Passwords]]></category>
            <category><![CDATA[Protocols]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Salt]]></category>
            <guid isPermaLink="false">7daEt3ab6jwAnizdsMzbfl</guid>
            <dc:creator>Tatiana Bradley</dc:creator>
        </item>
        <item>
            <title><![CDATA[Pwned Passwords Padding (ft. Lava Lamps and Workers)]]></title>
            <link>https://blog.cloudflare.com/pwned-passwords-padding-ft-lava-lamps-and-workers/</link>
            <pubDate>Wed, 04 Mar 2020 13:00:00 GMT</pubDate>
            <description><![CDATA[ Starting today, we are offering a new security advancement in the Pwned Passwords API - API clients can receive responses padded with random data. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>The Pwned Passwords API (part of Troy Hunt’s <a href="https://haveibeenpwned.com/">Have I Been Pwned</a> service) is used tens of millions of times each day, to alert users if their credentials are breached in a variety of online services, browser extensions and applications. Using Cloudflare, the API cached around 99% of requests, making it very efficient to run.</p><p>From today, we are offering a new security advancement in the Pwned Passwords API - API clients can receive responses padded with random data. This exists to effectively protect from any potential attack vectors which seek to use passive analysis of the size of API responses to identify which anonymised bucket a user is querying. I am hugely grateful to security researcher Matt Weir who I met at <a href="https://passwordscon.org/">PasswordsCon</a> in Stockholm and has explored <a href="https://github.com/lakiw/pwnedpasswords_padding">proof-of-concept</a> analysis of unpadded API responses in Pwned Passwords and has driven some of the work to consider the addition of padded responses.</p><p>Now, by passing a header of “Add-Padding” with a value of “true”, Pwned Passwords API users are able to request padded API responses (to a minimum of 800 entries with additional padding of a further 0-200 entries). The padding consists of randomly generated hash suffixes with the usage count field set to “0”.</p><p>Clients using this approach should seek to exclude 0-usage hash suffixes from breach validation. Given most implementations of PwnedPasswords simply do string matching on the suffix of a hash, there is no real performance implication of searching through the padding data. The false positive risk if a hash suffix matches a randomly generated response is very low, 619/(2<sup>35*4</sup>) ≈ 4.44 x 10<sup>-40</sup>. This means you’d need to do about 10<sup>40</sup> queries (roughly a query for every two atoms in the universe) to have a 44.4% probability of a collision.</p><p>In the future, non-padded responses will be deprecated outright (and all responses will be padded) once clients have had a chance to update.</p><p>You can see an example padded request by running the following curl request:</p>
            <pre><code>curl -H Add-Padding:true https://api.pwnedpasswords.com/range/FFFFF</code></pre>
            
    <div>
      <h2>API Structure</h2>
      <a href="#api-structure">
        
      </a>
    </div>
    <p>The high level structure of the Pwned Passwords API is discussed in my original blog post “<a href="/validating-leaked-passwords-with-k-anonymity/">Validating Leaked Passwords with k-Anonymity</a>”. In essence, a client queries the API for the first 5 hexadecimal characters of a SHA-1 hashed password (amounting to 20 bits), a list of responses is returned with the remaining 35 hexadecimal characters of the hash (140 bits) of every breached password in the dataset. Each hash suffix is appended with a colon (“:”) and the number of times that given hash is found in the breached data.</p><p>An example query for <i>FFFFF</i> can be seen below, with the structure represented:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3NE4abRyEojOo5caiuNQ0D/9d824a10e4a833f7b8acc10dd52eeb5b/pwned_passwords_curl.png" />
            
            </figure><p>Without padding, the message length varies given the amount of hash suffixes in the bucket that is queried. It is known that it is possible to fingerprint TLS traffic based on the encrypted message length - fortunately this padding can be inserted in the API responses themselves (in the HTTP content). We can see the difference in download size between two unpadded buckets by running:</p>
            <pre><code>$ curl -so /dev/null https://api.pwnedpasswords.com/range/E0812 -w '%{size_download} bytes\n'
17022 bytes
$ curl -so /dev/null https://api.pwnedpasswords.com/range/834EF -w '%{size_download} bytes\n'
25118 bytes</code></pre>
            <p>The randomised padded entries can be found with with the “:0” suffix (indicating usage count); for example, below the top three entries are real entries whilst the last 3 represent padding data:</p>
            <pre><code>FF1A63ACC70BEA924C5DBABEE4B9B18C82D:10
FF8A0382AA9C8D9536EFBA77F261815334D:12
FFEE791CBAC0F6305CAF0CEE06BBE131160:2
2F811DCB8FF6098B838DDED4D478B0E4032:0
A1BABA501C55ACB6BDDC6D150CF585F20BE:0
9F31397459FF46B347A376F58506E420A58:0</code></pre>
            
    <div>
      <h2>Compression and Randomisation</h2>
      <a href="#compression-and-randomisation">
        
      </a>
    </div>
    <p>Cloudflare supports both GZip and Brotli for compression. Compression benefits the PwnedPasswords API as responses are hexadecimal represented in ASCII. That said, compression is somewhat limited given the Avalanche Effect in hashing algorithms (that a small change in an input results in a completely different hash output) - each range searched has dramatically different input passwords and the remaining 35 characters of the SHA-1 hash are similarly different and have no expected similarity between them.</p><p>Accordingly, if one were to simply pad messages with null messages (say “000...”), the compression could mean that values padded to the same could be differentiated after compression. Similarly, even without compression, padding messages with the same data could still yield credible attacks.</p><p>Accordingly, padding is instead generated with randomly generated entries. In order to not break clients, such padding is generated to effectively look like legitimate hash suffixes. It is possible, however, to identify such messages as randomised padding. As the PwnedPasswords API contains a count field (distinguished by a colon after the remainder of the hex followed by a numerical count), randomised entries can be distinguished with a 0 usage.</p>
    <div>
      <h2>Lava Lamps and Workers</h2>
      <a href="#lava-lamps-and-workers">
        
      </a>
    </div>
    <p>I’ve written before about how <a href="/optimising-caching-on-pwnedpasswords/">cache optimisation of Pwned Passwords</a> (including using Cloudflare Workers). Cloudflare Workers has an additional benefit that Workers run before elements are pulled from cache.</p><p>This allows for randomised entries to be generated dynamically on a request-to-request basis instead of being cached. This means the resulting randomised padding can differ from request-to-request (thus the amount of entries in a given response and the size of the response).</p><p>Cloudflare Workers supports the <a href="https://developers.cloudflare.com/workers/reference/apis/web-crypto/">Web Crypto API</a>, providing for exposure of a cryptographically sound random number generator. This random number generator is used to decide the variable amount of padding added to each response. Whilst a cryptographically secure random number generator is used for determining the amount of padding, as the random hexadecimal padding does not need to be indistinguishable from the real hashes, for computational performance we use the non-cryptographically secure <i>Math.random()</i> to generate the actual content of the padding.</p><p>Famously, one of the sources of entropy used in Cloudflare servers is <a href="/lavarand-in-production-the-nitty-gritty-technical-details/">sourced from Lava Lamps</a>. By filming a wall of lava lamps in our San Francisco office (with individual photoreceptors picking up on random noise beyond the movement of the lava), we are able to generate random seed data used in servers (complimented by other sources of entropy along the way). This lava lamp entropy is used alongside the randomness sources on individual servers. This entropy is used to seed <i>cryptographically secure pseudorandom number generators</i> (CSPRNG) algorithms when generating random numbers. Cloudflare Workers runtime uses the <a href="https://developers.cloudflare.com/workers/about/how-it-works/">v8 engine</a> for JavaScript, with randomness <a href="https://github.com/v8/v8/blob/master/src/base/utils/random-number-generator.cc#L63">sourced</a> from <i>/dev/urandom</i> on the server itself.</p><p>Each response is padded to a minimum of 800 hash suffixes and a randomly generated amount of additional padding (from 200 entries).</p><p>This can be seen in two ways, firstly we can see that repeating the same responses to the same endpoint (with the underlying response being cached), yields a randomised amount of lines between 800 and 1000:</p>
            <pre><code>$ for run in {1..10}; do curl -s -H Add-Padding:true https://api.pwnedpasswords.com/range/FFFFF | wc -l; done
     831
     956
     870
     980
     932
     868
     856
     961
     912
     827</code></pre>
            <p>Secondly, we can see a randomised download size in each response:</p>
            <pre><code>$ for run in {1..10}; do curl -so /dev/null -H Add-Padding:true https://api.pwnedpasswords.com/range/FFFFF -w '%{size_download} bytes\n'; done
35572 bytes
37358 bytes
38194 bytes
33596 bytes
32304 bytes
37168 bytes
32532 bytes
37928 bytes
35154 bytes
33178 bytes</code></pre>
            
    <div>
      <h2>Future Work and Conclusion</h2>
      <a href="#future-work-and-conclusion">
        
      </a>
    </div>
    <p>There has been a considerable amount of research that has complemented the anonymity approach in Pwned Passwords. For example; Google and Stanford have written a paper about their approach implemented in Google Password Checkup, “Protecting accounts from credential stuffing with password breach alerting” [<a href="https://www.usenix.org/system/files/sec19-thomas.pdf">Usenix</a>].</p><p>We have done a significant amount of work exploring more advanced protocols for Pwned Passwords, some of this work can be found in a paper we worked on with academics at Cornell University, “Protocols for Checking Compromised Credentials” [<a href="https://dl.acm.org/doi/abs/10.1145/3319535.3354229">ACM</a> or <a href="https://arxiv.org/pdf/1905.13737.pdf">arXiv preprint</a>]. This research offers two new protocols (FSB, frequency smoothing bucketization, and IDB, identifier-based bucketization) to further reduce information leakage in the APIs.</p><p>Further work is needed before these protocols gain the production worthiness that we’d like before they are shipped - but, as always, we’ll keep you updated here on our blog.</p> ]]></content:encoded>
            <category><![CDATA[Passwords]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Cryptography]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[LavaRand]]></category>
            <guid isPermaLink="false">3ikC6g6s6oo3MKLxFvsn3h</guid>
            <dc:creator>Junade Ali</dc:creator>
        </item>
        <item>
            <title><![CDATA[Banking-Grade Credential Stuffing: The Futility of Partial Password Validation]]></title>
            <link>https://blog.cloudflare.com/banking-grade-credential-stuffing-the-true-effectiveness-of-a-partial-password-validation/</link>
            <pubDate>Thu, 20 Dec 2018 13:00:00 GMT</pubDate>
            <description><![CDATA[ Recently when logging into one of my credit card providers, I was greeted by a familiar screen. After entering in my username, the service asked me to supply 3 random characters from my password to validate ownership of my account. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Recently when logging into one of my credit card providers, I was greeted by a familiar screen. After entering in my username, the service asked me to supply 3 random characters from my password to validate ownership of my account.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7sKJCKq5lJ8TWVbwBVPCpp/2129c72a003c8412e81625c1ce71348e/image-4.png" />
            
            </figure><p>It is increasingly common knowledge in the InfoSec community that this practice is the antithesis of, what we now understand to be, secure password management.</p><p>For starters; sites prompting you for Partial Password Validation cannot store your passwords securely using algorithms like BCrypt or Argon2. If the service provider is ever breached, such plain-text passwords can be used to login to other sites where the account holder uses the same password (known as a Credential Stuffing attack).</p><p>Increased difficulty using long, randomly-generated passwords from Password Managers, leads to users favouring their memory over securely generated unique passwords. Those using Password Managers must extract their password from their vault, paste it somewhere else and then calculate the correct characters to put in. With this increased complexity, it further incentivises users to (re-)use simple passwords they can remember and count off on their fingers (and likely repeatedly use on other sites).</p><p>This is not to distinct thinking that originally bought us complex password composition rules, which would also ultimately incentivise password re-use. I have previously written how <a href="/how-developers-got-password-security-so-wrong/">broken password management</a> policies came about and the collaborative solution I worked on with security researcher, Troy Hunt, to <a href="/validating-leaked-passwords-with-k-anonymity/">dissuade password reuse</a> (examples of <a href="https://www.troyhunt.com/pwned-passwords-in-practice-real-world-examples-of-blocking-the-worst-passwords/">this implementation</a> can be found on Troy’s blog).</p><p>However, in this blog post I want us to follow through some of the logic of Partial Password Validation that is used by so many websites, including banks and services which certainly contain sensitive data. Let’s see how effective this strategy really is.</p>
    <div>
      <h2>How secure is partial password data?</h2>
      <a href="#how-secure-is-partial-password-data">
        
      </a>
    </div>
    <p>In one data breach, we saw that <a href="https://www.troyhunt.com/86-of-passwords-are-terrible-and-other-statistics/">86% of users were using passwords already in data breaches</a>. So, if we have certain characters of a password, how easy is it to identify that password from a data breach?</p><p>So; how much information can 3 characters provide us about a password a user logs in with (assuming such a password is breached)?</p><p>By selecting 10,000 passwords randomly from a public database of 488,129 breached passwords (after excluding passwords less than 8 characters long), I selected 3 random characters from each password and saw how many passwords in the complete dataset had the same characters in the same place as the original password. This simulation was run 11 times per password considered.</p><p>In the 110,000 simulations, 58% of tested 3-character password segments were only valid for that password in the database. Additionally, 28% could be associated with only one other password and 8% with two other passwords.</p><p>As such, we can demonstrate that in this database, the presence of only 3 characters of a password is sufficient to let us breach a significant proportion of such accounts. Using slow brute force attacks, hundreds of passwords can be checked against an account before triggering any form of rate limiting (if any), combining password segments with common password databases allows us to bring down the search candidates substantially.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3Tp7HfUBAEmf26AhZQCwI5/9d0dbb6f928d61ede2b336b161eee65c/image-8.png" />
            
            </figure><p>Research for these tactics exists outside the scope of simulations alone. Prior work by the University of Edinburgh and the University of Aberdeen in <a href="http://groups.inf.ed.ac.uk/security/passwords/pps.pdf">a paper on Partial Password implementations and attacks</a>, created a password projection dictionary using a larger data breach (RockYou) alongside recording credentials during login attempts to user accounts. Result collection was based on a survey of user logins to online banking sites and showed a worryingly high success rate of being able to predict solutions to challenge pages (in particular, against banking websites which required no, or a weak, second credential):</p><blockquote><p>We find that with 6 guesses, an attacker can respond correctly to 2-place challenges on 6-digit PINs with a success rate of 30%. Recording up to 4 runs, an attacker can succeed over 60% of the time, or by combining guessing and recording, over 90%. Alphanumeric passwords do somewhat better: responding to 3-place challenges on 8-character alphanumeric passwords, with up to 10 guesses, the attacker can achieve a success rate of 5.5%. Combining guessing and recording increases that to 25% with one recorded run and at least 80% with four runs.</p></blockquote><p>Partial Password Validation arguably exists to prevent key loggers (either in software or hardware form) from learning your complete password; however now let's put this hypothesis to the test next.</p>
    <div>
      <h2>Getting the full password</h2>
      <a href="#getting-the-full-password">
        
      </a>
    </div>
    <p>Every time my banking site asks for a set of random characters of my password on login, someone who knows my keystrokes can learn even more. With personal computer ownership at an all time high (e.g. household computer ownership <a href="https://www.statista.com/statistics/289191/household-penetration-of-home-computers-in-the-uk/">at 88% in the UK</a>) it is increasingly likely such users will repeatedly login to their services using a single device.</p><p>Let's consider the threat model of whether Partial Password Validation actually helps. How many times would a user need to repeatedly login until their password is fully breached? This problem represents a modified form of the <a href="https://en.wikipedia.org/wiki/Coupon_collector's_problem">coupon collector's problem</a> (except with multiple selections), and as such <a href="https://math.stackexchange.com/questions/131664/coupon-collector-problem-with-batched-selections">approximations can be calculated</a> in mathematical terms; but instead, here I'll demonstrate this using real password data and simulations.</p><p>It is trivial to calculate how many possible ways 3 random characters can be selected from a password using binomial coefficients; there are 220 ways of selecting 3 characters from a 12 character password, but it is fundamentally important to know that, at the end of the day, you only need 12 characters to breach a password. Every time a user is prompted for more random characters, we have more chance of finding out what their password is.</p><p>By repeatedly taking the lengths of random passwords (over 8 characters in lengths), I ran a simulation to see how many times it would take for the entire password to become known. 110,000 simulations were run collectively on 10,000 passwords.</p><p><b>In simulation, 58% of passwords are revealed in entirety after 7 logins, 90% after 12 and 99% after 19 logins.</b> These results would be even more garish, with a maximum password length constraint (and/or including passwords less than 8 characters); as is implemented by many online banks using such an approach.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1HcjRHHCXJUqYomqPEJ87i/3f069cf91455b95a8ba18e0e847a8b80/image-12.png" />
            
            </figure>
    <div>
      <h2>The Road to Multi-Factor Authentication</h2>
      <a href="#the-road-to-multi-factor-authentication">
        
      </a>
    </div>
    <p>There we have it; there is no substantive keylogger protection from Partial Password Validation; all you get is a guarantee that the service you're dealing with isn't capable (or is too lazy) to properly secure your passwords.</p><p>Password Managers are a blessing and they provide a huge boost in security by allowing users to set strong, unique passwords on a per site basis and Partial Password Validation poses a massive usability frontier to users adopting such practices. In the words of the British National Cyber Security Centre: "<a href="https://www.ncsc.gov.uk/blog-post/let-them-paste-passwords">Let them paste passwords</a>".</p><p>So what do you do instead? Instead of merely using what your customers <i>know</i> to secure their accounts, additionally use something they <i>have</i>. The industry standard for key logger protection is Two Factor Authentication (or Multi Factor Authentication); using either apps on your users smartphones to generate cryptographically secure tokens, or, as is increasingly the case of banks, giving your customers hardware Two Factor token generators to validate their login attempts. Hardware token generators provide a distinct piece of hardware to generate secure tokens, that users cannot use to login to their online accounts.</p><p>Increasingly SMS is used to send a user a password to validate their login attempt, in addition to a password the users enters. SMS isn't technically Second Factor Authentication, and instead represents a One Time Password. This <a href="https://blog.1password.com/totp-for-1password-users/">can also be said</a> for users logging in to a site, using a password, on the same device they use to generate their one time token. Additionally, SMS tokens are not cryptographically generated on the device itself, using the <a href="https://tools.ietf.org/html/rfc6238">RFC 6238 standard</a> that's employed by 2FA apps, but are sent over a protocol with <a href="https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin">numerous security shortcomings</a>. In practice, this means that interception can reveal the One Time Password that you receive.</p><p>Whilst there are better alternatives to SMS, and indeed users who are educated to use such tactics should be allowed to do so, there is a usability gap to setting up Two Factor Authentication and somewhat of a cost and operational barrier to issuing users hardware devices. However; in a time where the vast majority of users guard their secure accounts using nothing more than their passwords, it is somewhat excusable to default opt-in users to SMS One Time Passwords, whilst providing the option for Two Factor Authentication if desired. The UK tax office (Her Majesty's Revenue &amp; Customs) have gone down this route, <a href="https://developer.service.hmrc.gov.uk/api-documentation/docs/authorisation/two-step-verification">requiring users to set-up some form of Multi-Step Verification</a> before being able to proceed with managing their accounts; either via SMS, landline or an authenticator app.</p><p>In conclusion; whilst SMS isn't the most secure way of generating a One Time Password, it offers huge advantages over a user only using a password. Any form of One Time Password is better than none at all, and it provides a path for users to handle the security threats that Partial Password Verification promises, but falls short on.</p><p><i>Want to help businesses, small and big, protect their users from security threats, small and large? The Cloudflare technical support team is </i><a href="https://www.cloudflare.com/careers/departments/customer-support/"><i>hiring</i></a><i>.</i></p> ]]></content:encoded>
            <category><![CDATA[Passwords]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">74Z1CAmW05crCbV74miJbi</guid>
            <dc:creator>Junade Ali</dc:creator>
        </item>
        <item>
            <title><![CDATA[Leave your VPN and cURL secure APIs with Cloudflare Access]]></title>
            <link>https://blog.cloudflare.com/leave-your-vpn-and-curl-secure-apis-with-cloudflare-access/</link>
            <pubDate>Fri, 05 Oct 2018 18:30:07 GMT</pubDate>
            <description><![CDATA[ We built Access to solve a problem here at Cloudflare: our VPN. Our team members hated the slowness and inconvenience of VPN but, that wasn’t the issue we needed to solve. The security risks posed by a VPN required a better solution. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>We built Access to solve a problem here at Cloudflare: our VPN. Our team members hated the slowness and inconvenience of VPN but, that wasn’t the issue we needed to solve. The security risks posed by a VPN required a better solution.</p><p>VPNs punch holes in the <a href="https://www.cloudflare.com/learning/access-management/what-is-the-network-perimeter/">network perimeter</a>. Once inside, individuals can access everything. This can include  critically sensitive content like private keys, cryptographic salts, and log files. Cloudflare is a security company; this situation was unacceptable. We need a better method that gives every application control over precisely who is allowed to  reach it.</p><p>Access meets that need. We started by moving our browser-based applications behind Access. Team members could connect to applications faster, from anywhere, while we improved the security of the entire organization. However, we weren’t yet ready to turn off our VPN as some tasks are better done through a command line. We cannot #EndTheVPN without replacing all of its use cases. Reaching a server from the command line required us to fall back to our VPN.</p><p>Today, we’re releasing a beta command line tool to help your team, and ours. Before we started using this feature at Cloudflare, curling a server required me to stop, find my VPN client and credentials, login, and run my curl command. With Cloudflare’s command line tool, <code>cloudflared</code>, and Access, I can run <code>$ cloudflared access curl https://example.com/api</code> and Cloudflare authenticates my request to the server. I save time and the security team at Cloudflare can control who reaches that endpoint (and monitor the logs).</p>
    <div>
      <h3>Protect your API with Cloudflare Access</h3>
      <a href="#protect-your-api-with-cloudflare-access">
        
      </a>
    </div>
    <p>To protect an <a href="https://www.cloudflare.com/learning/security/api/what-is-an-api/">API</a> with Access, you’ll follow the same <a href="https://developers.cloudflare.com/access/setting-up-access/securing-applications/">steps</a> that you use to protect a browser-based application. Start by adding the hostname where your API is deployed to your Cloudflare account.</p><p>Just like web applications behind Access, you can create granular policies for different paths of your HTTP API. Cloudflare Access will evaluate every request to the API for permission based on settings you configure. Placing your API behind Access means requests from any operation, CLI or other, will continue to be gated by Cloudflare. You can continue to use your API keys, if needed, as a second layer of security.</p>
    <div>
      <h3>Reach a protected API</h3>
      <a href="#reach-a-protected-api">
        
      </a>
    </div>
    <p>Cloudflare Access protects your application by checking for a valid JSON Web Token (JWT), whether the request comes through a browser or from the command line. We <a href="https://developers.cloudflare.com/access/setting-up-access/validate-jwt-tokens/">issue and sign</a> that JWT when you successfully login with your identity provider. That token contains claims about your identity and session. The Cloudflare network looks at the claims in that token to determine if the request should proceed to the target application.</p><p>When you use a browser with Access, we redirect you to your identity provider, you login, and we store that token in a cookie. Authenticating from the command line requires a different flow, but relies on the same principles. When you need to reach an application behind Access from your command line, the Cloudflare CLI tool, <code>cloudflared</code>, launches a browser window so that you can login with your identity provider. Once you login, Access will generate a JWT for your session, scoped to your user identity.</p><p>Rather than placing that JWT in a cookie, Cloudflare transfers the token in a cryptographically secure handoff to your machine. The client stores the token for you so that you don’t need to re-authenticate each time. The token is valid for the session duration as configured in Access.</p><p>When you make requests from your command line, Access will look for an HTTP header, <code>cf-access-token</code>, instead of a cookie. We’ll evaluate the token in that header and on every request.  <b>If you use cURL, we can help you move even faster.</b> <code>cloudflared</code> includes a subcommand that wraps cURL and injects the JWT into the header for you.</p>
    <div>
      <h3>Why use cloudflared to reach your application?</h3>
      <a href="#why-use-cloudflared-to-reach-your-application">
        
      </a>
    </div>
    <p>With <code>cloudflared</code> and its cURL wrapper, you can perform any cURL operation against an API protected by Cloudflare Access.</p><ul><li><p><b>Control endpoint access for specific users</b>Cloudflare Access can be configured to protect specific endpoints. For example, you can create a rule that only a small group within your team can reach a particular URL path. You can apply that granular protection to sensitive endpoints so that you control who can reach those, while making other parts of the tool available to the full team.</p></li><li><p><b>Download sensitive data</b>Placing applications with sensitive data behind Access lets you control who can reach that information. If a particular file is stored at a known location, you can save time by downloading it to your machine from the command line instead of walking through the UI flow.</p></li></ul>
    <div>
      <h3>What's next?</h3>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>CLI authentication is available today to all Access customers through the <code>cloudflared</code> tool. Just add the API hostname to your Cloudflare account and enable Access to start building policies that control who can reach that API. If you do not have an Access subscription yet, you can read more about the plans <a href="https://www.cloudflare.com/products/cloudflare-access/">here</a> and sign up.</p><p>Once you’re ready to continue ditching your VPN, follow this <a href="https://developers.cloudflare.com/access/cli/connecting-from-cli/">link</a> to install <code>cloudflared</code> today. The tool is in beta and does not yet support automated scripting or service-to-service connections. Full instructions and known limitations can be found <a href="https://developers.cloudflare.com/access/cli/connecting-from-cli/">here</a>. If you are interested in providing feedback, you can post your comments in this <a href="https://community.cloudflare.com/t/cloudflare-access-cli-auth-beta/37564">thread</a>.</p> ]]></content:encoded>
            <category><![CDATA[Cloudflare Access]]></category>
            <category><![CDATA[VPN]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Salt]]></category>
            <category><![CDATA[Passwords]]></category>
            <category><![CDATA[SASE]]></category>
            <guid isPermaLink="false">6jHWUuoTWxxosKdUqelM0K</guid>
            <dc:creator>Sam Rhea</dc:creator>
        </item>
        <item>
            <title><![CDATA[Using Cloudflare Workers to identify pwned passwords]]></title>
            <link>https://blog.cloudflare.com/using-cloudflare-workers-to-identify-pwned-passwords/</link>
            <pubDate>Mon, 26 Feb 2018 12:04:56 GMT</pubDate>
            <description><![CDATA[ Last week Troy Hunt launched his Pwned Password v2 service which has an API handled and cached by Cloudflare using a clever anonymity scheme.  The following simple code can check if a password exists in Troy's database without sending the password to Troy. ]]></description>
            <content:encoded><![CDATA[ <p>Last week Troy Hunt launched his <a href="https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/">Pwned Password v2</a> service which has an API handled and cached by Cloudflare using a <a href="/validating-leaked-passwords-with-k-anonymity/">clever anonymity scheme</a>.</p><p>The following simple code can check if a password exists in Troy's database without sending the password to Troy. The details of how it works are found in the blog post above.</p>
            <pre><code>use strict;
use warnings;

use LWP::Simple qw/$ua get/;
$ua-&gt;agent('Cloudflare Test/0.1');
use Digest::SHA1 qw/sha1_hex/;

uc(sha1_hex($ARGV[0]))=~/^(.{5})(.+)/;
print get("https://api.pwnedpasswords.com/range/$1")=~/$2/?'Pwned':'Ok', "\n";</code></pre>
            <p>It's just as easy to implement the same check in other languages, such as JavaScript, which made me realize that I could incorporate the check into a <a href="/introducing-cloudflare-workers/">Cloudflare Worker</a>. With a little help from people who know JavaScript far better than me, I wrote the <a href="https://gist.github.com/jgrahamc/21f31c8fb4b2c27bda4f605197d5143f">following Worker</a>:</p>
            <pre><code>addEventListener('fetch', event =&gt; {
  event.respondWith(fetchAndCheckPassword(event.request))
})

async function fetchAndCheckPassword(req) {
  if (req.method == "POST") {
    try {
      const post = await req.formData()
      const pwd = post.get('password')
      const enc = new TextEncoder("utf-8").encode(pwd)

      let hash = await crypto.subtle.digest("SHA-1", enc)
      let hashStr = hex(hash).toUpperCase()
      
      const prefix = hashStr.substring(0, 5)
      const suffix = hashStr.substring(5)

      const pwndpwds = await fetch('https://api.pwnedpasswords.com/range/' + prefix)
      const t = await pwndpwds.text()
      const pwnd = t.includes(suffix)

      let newHdrs = new Headers(req.headers)
      newHdrs.set('Cf-Password-Pwnd', pwnd?'YES':'NO')

      const init = {
        method: 'POST',
        headers: newHdrs,
        body: post
      }

      return await fetch(req.url, init)    
    } catch (err) {
      return new Response('Internal Error')
    }
  }
  
  return await fetch(req)
}

function hex(a) {
  var h = ""
  var b = new Uint8Array(a)
  for(var i = 0; i &lt; b.length; i++){
    var hi = b[i].toString(16)
    h += hi.length === 1?"0"+hi:hi
  }
  return h
}</code></pre>
            <p>This Worker can be used to intercept a request passing through Cloudflare to a Cloudflare site. It looks at POST requests and extracts a field called <code>password</code> and checks it against Troy Hunt's service.</p><p>It then adds an HTTP request header, <code>Cf-Password-Pwned</code>, with either the value <code>YES</code> or <code>NO</code> depending on whether the password being handled is found in the database or not.</p><p>The POST request is then passed on to the origin server for handling, with the extra header inserted. This could, for example, be used on a signup page to check whether the password a user is hoping to use has already been found in a leak. The server would simply look at the header.</p><p>Clearly, this code isn't completely production ready (it does a bad job of handling failure, for example), but it gives a good idea of the power of a Cloudflare Worker to perform a subrequest to an API as part of normal request processing by Cloudflare and augment at request with information.</p>
    <div>
      <h3>Trying it out</h3>
      <a href="#trying-it-out">
        
      </a>
    </div>
    <p>To test it out I created a simple page that just returns the received HTTP request headers as text and deployed this as a 'signup' page with the Worker code above routed to it.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6p6dvgMpxz9HWG5YylXrik/e96f93eded1a139c56086104e532da6b/Screen-Shot-2018-02-26-at-11.23.45.png" />
            
            </figure><p>And checked the a simple GET request was <i>not</i> handled by the Worker (notice that the <code>Cf-Password-Pwned</code> header is not present.</p>
            <pre><code>$ curl https://signup.example.com
Host: signup.example.com
Connection: Keep-Alive
Accept-Encoding: gzip
Cf-Ipcountry: US
Cf-Ray: 3f329308132f92b8-SJC
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
User-Agent: curl/7.26.0</code></pre>
            <p>But a POST request with a password results in an extra header. Clearly no one should be using the password <code>12345</code>.</p>
            <pre><code>$ curl -X POST -d 'password=12345' https://signup.example.com
Host: signup.example.com
Connection: Keep-Alive
Accept-Encoding: gzip
Cf-Ipcountry: US
Cf-Ray: 3f3294e714a36d42-SJC
Content-Length: 130
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Content-Type: application/x-www-form-urlencoded
Accept: */*
Cf-Password-Pwnd: YES
User-Agent: curl/7.26.0</code></pre>
            <p>But it looks like the password <code>kRc4qMwAtexDVZVygPnSt7LP5jPFsUDt</code> is safe for the time being:</p>
            <pre><code>$ curl -X POST -d 'password=kRc4qMwAtexDVZVygPnSt7LP5jPFsUDt' https://signup.example.com
Host: signup.example.com
Connection: Keep-Alive 
Accept-Encoding: gzip
Cf-Ipcountry: US
Cf-Ray: 3f329675e7f29625-SJC
Content-Length: 157
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Content-Type: application/x-www-form-urlencoded
Accept: */*
Cf-Password-Pwnd: NO
User-Agent: curl/7.26.0</code></pre>
            <p>The power of Cloudflare Workers comes from the ability to run standard JavaScript written against the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API">Service Workers API</a> on Cloudflare's edge nodes around the world. Small snippets of code can be used to transform and enhance requests and responses, build responses from multiple API calls, and interact with the Cloudflare cache.</p><p>Read more in the <a href="https://developers.cloudflare.com/workers/">developer documentation</a>.</p><hr /><p><i>If you have a worker you'd like to share, or want to check out workers from other Cloudflare users, visit the </i><a href="https://community.cloudflare.com/tags/recipe-exchange"><i>“Recipe Exchange”</i></a><i> in the Workers section of the </i><a href="https://community.cloudflare.com/c/developers/workers"><i>Cloudflare Community Forum</i></a><i>.</i></p> ]]></content:encoded>
            <category><![CDATA[Passwords]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Programming]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">NGbAdBYqiYoKOCBhmgVkN</guid>
            <dc:creator>John Graham-Cumming</dc:creator>
        </item>
        <item>
            <title><![CDATA[Validating Leaked Passwords with k-Anonymity]]></title>
            <link>https://blog.cloudflare.com/validating-leaked-passwords-with-k-anonymity/</link>
            <pubDate>Wed, 21 Feb 2018 19:00:44 GMT</pubDate>
            <description><![CDATA[ Today, v2 of Pwned Passwords was released as part of the Have I Been Pwned service offered by Troy Hunt. Containing over half a billion real world leaked passwords, this database provides a vital tool for correcting the course of how the industry combats modern threats against password security. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Today, <a href="https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/">v2 of <i>Pwned Passwords</i> was released</a> as part of the <i>Have I Been Pwned</i> service offered by Troy Hunt. Containing over half a billion real world leaked passwords, this database provides a vital tool for correcting the course of how the industry combats modern threats against password security.</p><p>I have written about how we need to rethink password security and <i>Pwned Passwords v2</i> in the following post: <a href="/how-developers-got-password-security-so-wrong/"><i>How Developers Got Password Security So Wrong</i></a>. Instead, in this post I want to discuss one of the technical contributions Cloudflare has made towards protecting user information when using this tool.</p><p>Cloudflare continues to support <i>Pwned Passwords</i> by providing <a href="https://www.cloudflare.com/learning/cdn/what-is-a-cdn/">CDN</a> and security functionality such that the data can easily be made available for download in raw form to organisations to protect their customers. Further, as part of the second iteration of this project, I have also worked with Troy on designing and implementing <a href="https://www.cloudflare.com/learning/security/api/what-is-api-endpoint/">API endpoints</a> that support anonymised <i>range queries</i> to function as an additional layer of security for those consuming the API, that is visible to the client.</p><p>This contribution allows for <i>Pwned Passwords</i> clients to use <i>range queries</i> to search for breached passwords, without having to disclose a complete unsalted password hash to the service.</p>
    <div>
      <h3>Getting Password Security Right</h3>
      <a href="#getting-password-security-right">
        
      </a>
    </div>
    <p>Over time, the industry has realised that complex password composition rules (such as requiring a minimum number of special characters) have done little to improve user behaviour in making stronger passwords; they have done little to prevent users from putting personal information in passwords, avoiding common passwords or prevent the use of previously breached passwords<a href="#fn1">[1]</a>. <a href="https://www.cloudflare.com/learning/bots/what-is-credential-stuffing/">Credential Stuffing</a> has become a real threat recently; usernames and passwords are obtained from compromised websites and then injected into other websites until you find user accounts that are compromised.</p><p>This fundamentally works because users reuse passwords across different websites; when one set of credentials is breached on one site, this can be reused on other websites. Here are some examples of how credentials can be breached from insecure websites:</p><ul><li><p>Websites which don't use <a href="https://www.cloudflare.com/learning/bots/what-is-rate-limiting/">rate limiting</a> or challenge login requests can have a user's log-in credentials breached using brute force attacks of common passwords for a given user,</p></li><li><p>database dumps from hacked websites can be taken offline and the password hashes can be cracked; modern GPUs make this very efficient for dictionary passwords (even with algorithms like Argon2, PBKDF2 and BCrypt),</p></li><li><p>many websites continue not to use any form of password hashing, once breached they can be captured in raw form,</p></li><li><p>Proxy Attacks or hijacking a web server can allow for capturing passwords before they're hashed.</p></li></ul><p>This becomes a problem with password reuse; having obtained real life username/password combinations, they can be injected into other websites (such as payment gateways, social networks, etc) until access is obtained to more accounts (often of a higher value than the original compromised site).</p><p>Under <a href="https://pages.nist.gov/800-63-3/sp800-63b.html">recent NIST guidance</a>, it is a requirement, when storing or updating passwords, to ensure they do not contain values which are commonly used, expected or compromised<a href="#fn2">[2]</a>. Research has found that 88.41% of users who received a <i>fear appeal</i> later set unique passwords, whilst only 4.45% of users who did not receive a fear appeal would set a unique password<a href="#fn3">[3]</a>.</p><p>Unfortunately, there are a lot of leaked passwords out there; the downloadable raw data from <i>Pwned Passwords</i> currently contains over 30 GB in password hashes.</p>
    <div>
      <h3>Anonymising Password Hashes</h3>
      <a href="#anonymising-password-hashes">
        
      </a>
    </div>
    <p>The key problem in checking passwords against the old <i>Pwned Passwords</i> API (and all similar services) lies in how passwords are checked; with users being effectively required to submit unsalted hashes of passwords to identify if the password is breached. The hashes must be unsalted, as salting them makes them computationally difficult to search quickly.</p><p>Currently there are two choices that are available for validating whether a password is or is not leaked:</p><ul><li><p>Submit the password (in an unsalted hash) to a third-party service, where the hash can potentially be stored for later cracking or analysis. For example, if you make an API call for a leaked password to a third-party API service using a WordPress plugin, the IP of the request can be used to identify the WordPress installation and then breach it when the password is cracked (such as from a later disclosure); or,</p></li><li><p>download the entire list of password hashes, uncompress the dataset and then run a search to see if your password hash is listed.</p></li></ul><p>Needless to say, this conflict can seem like being placed between a <a href="https://www.cloudflare.com/learning/security/how-to-improve-wordpress-security/">security-conscious rock</a> and an insecure hard place.</p>
    <div>
      <h3>The Middle Way</h3>
      <a href="#the-middle-way">
        
      </a>
    </div>
    
    <div>
      <h4>The Private Set Intersection (PSI) Problem</h4>
      <a href="#the-private-set-intersection-psi-problem">
        
      </a>
    </div>
    <p>Academic computer scientists have considered the problem of how two (or more) parties can validate the intersection of data (from two or more unequal sets of data either side already has) without either sharing information about what they have. Whilst this work is exciting, unfortunately these techniques are new and haven't been subject to long-term review by the cryptography community and cryptographic primitives have not been implemented in any major libraries. Additionally (but critically), PSI implementations have substantially higher overhead than our <i>k</i>-Anonymity approach (particularly for communication<a href="#fn4">[4]</a>). Even the current academic state-of-the-art is not with acceptable performance bounds for an API service, with the communication overhead being equivalent to downloading the entire set of data.</p>
    <div>
      <h4>k-Anonymity</h4>
      <a href="#k-anonymity">
        
      </a>
    </div>
    <p>Instead, our approach adds an additional layer of security by utilising a mathematical property known as <i>k</i>-Anonymity and applying it to password hashes in the form of <i>range queries</i>. As such, the <i>Pwned Passwords</i> API service never gains enough information about a non-breached password hash to be able to breach it later.</p><p><i>k</i>-Anonymity is used in multiple fields to release anonymised but workable datasets; for example, so that hospitals can release patient information for medical research whilst withholding information that discloses personal information. Formally, a data set can be said to hold the property of <i>k</i>-Anonymity, if for every record in a released table, there are <code>k − 1</code> other records identical to it.</p><p>By using this property, we are able to seperate hashes into anonymised "buckets". A client is able to anonymise the user-supplied hash and then download all leaked hashes in the same anonymised "bucket" as that hash, then do an offline check to see if the user-supplied hash is in that breached bucket.</p><p>In more concrete terms:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6FkAe2DhLMl2u6Dd4ZXx0P/fc76ccce5fe7570981625977f7d85ace/hash-bucket.png" />
            
            </figure><p>In essence, we turn the table on password derivation functions; instead of seeking to salt hashes to the point at which they are unique (against identical inputs), we instead introduce ambiguity into what the client is requesting.</p><p>Given hashes are essentially fixed-length hexadecimal values, we are able to simply truncate them, instead of having to resort to a decision tree structure to filter down the data. This does mean buckets are of unequal sizes but allows clients to query in a single API request.</p><p>This approach can be implemented in a trivial way. Suppose a user enters the password <code>test</code> into a login form and the service they’re logging into is programmed to validate whether their password is in a database of leaked password hashes. Firstly the client will generate a hash (in our example using SHA-1) of <code>a94a8fe5ccb19ba61c4c0873d391e987982fbbd3</code>. The client will then truncate the hash to a predetermined number of characters (for example, 5) resulting in a Hash Prefix of <code>a94a8</code>. This Hash Prefix is then used to query the remote database for all hashes starting with that prefix (for example, by making a HTTP request to <code>example.com/a94a8.txt</code>). The entire hash list is then downloaded and each downloaded hash is then compared to see if any match the locally generated hash. If so, the password is known to have been leaked.</p><p>As this can easily be implemented over HTTP, client side caching can easily be used for performance purposes; the API is simple enough for developers to implement with little pain.</p><p>Below is a simple Bash implementation of how the <i>Pwned Passwords</i> API can be queried using <i>range queries</i> (<a href="https://gist.github.com/IcyApril/56c3fdacb3a640f37c245e5813b98b99">Gist</a>):</p>
            <pre><code>#!/bin/bash

echo -n Password:
read -s password
echo
hash="$(echo -n $password | openssl sha1)"
upperCase="$(echo $hash | tr '[a-z]' '[A-Z]')"
prefix="${upperCase:0:5}"
response=$(curl -s https://api.pwnedpasswords.com/range/$prefix)
while read -r line; do
  lineOriginal="$prefix$line"
  if [ "${lineOriginal:0:40}" == "$upperCase" ]; then
    echo "Password breached."
    exit 1
  fi
done &lt;&lt;&lt; "$response"

echo "Password not found in breached database."
exit 0</code></pre>
            
    <div>
      <h3>Implementation</h3>
      <a href="#implementation">
        
      </a>
    </div>
    <p>Hashes (even in unsalted form) have two useful properties that are useful in anonymising data.</p><p>Firstly, the Avalanche Effect means that a small change in a hash results in a very different output; this means that you can't infer the contents of one hash from another hash. This is true even in truncated form.</p><p>For example; the Hash Prefix <code>21BD1</code> contains 475 seemingly unrelated passwords, including:</p>
            <pre><code>lauragpe
alexguo029
BDnd9102
melobie
quvekyny</code></pre>
            <p>Further, hashes are fairly uniformally distributed. If we were to count the original 320 million leaked passwords (in Troy's dataset) by the first hexadecimal charectar of the hash, the difference between the hashes associated to the largest and the smallest Hash Prefix is ≈ 1%. The chart below shows hash count by their first hexadecimal digit:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7IqJBkvelNZ0QVFoDEfrKY/96682f7d36961752b3f2c14bc6235f20/hashes_by_hash_prefix.png" />
            
            </figure><p>Algorithm 1 provides us a simple check to discover how much we should truncate hashes by to ensure every "bucket" has more than one hash in it. This requires every hash to be sorted by hexadecimal value. This algorithm, including an initial merge sort, runs in roughly <code>O(n log n + n)</code> time (worst-case):</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/rdI6HJEupI0hSGAsDvr4m/74045dd1a84842e41127e4a9d9213480/Screen-Shot-2018-02-18-at-23.37.15.png" />
            
            </figure><p>After identifying the Maximum Hash Prefix length, it is fairly easy to seperate the hashes into seperate buckets, as described in Algorithm 3:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3peODDMG8GqOHrkA48VOPt/168f1da40b0b41342d571791c3789541/Screen-Shot-2018-02-18-at-23.02.02.png" />
            
            </figure><p>This implementation was originally evaluated on a dataset of over 320 million breached passwords and we find the Maximum Prefix Length that all hashes can be truncated to, whilst maintaining the property k-anonymity, is 5 characters. When hashes are grouped together by a Hash Prefix of 5 characters, we find the median number of hashes associated with a Hash Prefix is 305. With the range of response sizes for a query varying from 8.6KB to 16.8KB (a median of 12.2KB), the dataset is usable in many practical scenarios and is certainly a good response size for an API client.</p><p>On the new <i>Pwned Password</i> dataset (with over half a billion) passwords and whilst keeping the Hash Prefix length 5; the average number of hashes returned is 478 - with the smallest being 381 (<code>E0812</code> and <code>E613D</code>) and the largest Hash Prefix being 584 (<code>00000</code> and <code>4A4E8</code>).</p><p>Splitting the hashes into buckets by a Hash Prefix of 5 would mean a maximum of 16^5 = 1,048,576 buckets would be utilised (for SHA-1), assuming that every possible Hash Prefix would contain at least one hash. In the datasets we found this to be the case and the amount of distinct Hash Prefix values was equal to the highest possible quantity of buckets. Whilst for secure hashing algorithms it is computationally inefficient to invert the hash function, it is worth noting that as the length of a SHA-1 hash is a total of 40 hexadecimal characters long and 5 characters is utilised by the Hash Prefix, the total number of possible hashes associated with a Hash Prefix is 16^{35} ≈ 1.39E42.</p>
    <div>
      <h3>Important Caveats</h3>
      <a href="#important-caveats">
        
      </a>
    </div>
    <p>It is important to note that where a user's password is already breached, an API call for a specific range of breached passwords can reduce the search candidates used in a <a href="https://www.cloudflare.com/learning/bots/brute-force-attack/">brute-force attack</a>. Whilst users with existing breached passwords are already vulnerable to brute-force attacks, searching for a specific range can help reduce the amount of search candidates - although the API service would have no way of determining if the client was or was not searching for a password that was breached. Using a deterministic algorithm to run queries for other Hash Prefixes can help reduce this risk.</p><p>One reason this is important is that this implementation does not currently guarantee <i>l</i>-diversity, meaning a bucket may contain a hash which is of substantially higher use than others. In the future we hope to use percentile-based usage information from the original breached data to better guarantee this property.</p><p>For general users, <i>Pwned Passwords</i> is usually exposed via web interface, it uses a JavaScript client to run this process; if the origin web server was hijacked to change the JavaScript being returned, this computation could be removed (and the password could be sent to the hijacked origin server). Whilst JavaScript requests are somewhat transparent to the client (in the case of a developer), this may not be depended on and for technical users, non-web client based requests are preferable.</p><p>The original use-case for this service was to be deployed privately in a Cloudflare data centre where our services can use it to enhance user security, and use <i>range queries</i> to complement the existing transport security used. Depending on your risks, it's safer to deploy this service yourself (in your own data centre) and use the <i>k</i>-anonymity approach to validate passwords where services do not themselves have the resources to store an entire database of leaked password hashes.</p><p>I would strongly recommend against storing the <i>range queries</i> used by users of your service, but if you do for whatever reason, store them as aggregate analytics such that they cannot be linked back to any given user's password.</p>
    <div>
      <h3>Final Thoughts</h3>
      <a href="#final-thoughts">
        
      </a>
    </div>
    <p>Going forward, as we test this technology more, Cloudflare is looking into how we can use a private deployment of this service to better offer security functionality, both for log-in requests to our dashboard and for customers who want to prevent against credential stuffing on their own websites using our edge network. We also seek to consider how we can incorporate recent work on the Private Set Interesection Problem alongside considering <i>l</i>-diversity for additional security guarantees. As always; we'll keep you updated right here, on our blog.</p><hr /><ol><li><p>Campbell, J., Ma, W. and Kleeman, D., 2011. Impact of restrictive composition policy on user password choices. Behaviour &amp; Information Technology, 30(3), pp.379-388. <a href="#fnref1">↩︎</a></p></li><li><p>Grassi, P. A., Fenton, J. L., Newton, E. M., Perlner, R. A., Regenscheid, A. R., Burr, W. E., Richer, J. P., Lefkovitz, N. B., Danker, J. M., Choong, Y.-Y., Greene, K. K., and Theofanos, M. F. (2017). NIST Special Publication 800-63B Digital Identity Guidelines, chapter Authentication and Lifecycle Management. National Institute of Standards and Technology, U.S. Department of Commerce. <a href="#fnref2">↩︎</a></p></li><li><p>Jenkins, Jeffrey L., Mark Grimes, Jeffrey Gainer Proudfoot, and Paul Benjamin Lowry. "Improving password cybersecurity through inexpensive and minimally invasive means: Detecting and deterring password reuse through keystroke-dynamics monitoring and just-in-time fear appeals." Information Technology for Development 20, no. 2 (2014): 196-213. <a href="#fnref3">↩︎</a></p></li><li><p>De Cristofaro, E., Gasti, P. and Tsudik, G., 2012, December. Fast and private computation of cardinality of set intersection and union. In International Conference on Cryptology and Network Security (pp. 218-231). Springer, Berlin, Heidelberg. <a href="#fnref4">↩︎</a></p></li></ol> ]]></content:encoded>
            <category><![CDATA[Passwords]]></category>
            <category><![CDATA[Best Practices]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Salt]]></category>
            <guid isPermaLink="false">4k6ry6xuTMJwpexgEzV2hB</guid>
            <dc:creator>Junade Ali</dc:creator>
        </item>
        <item>
            <title><![CDATA[How Developers got Password Security so Wrong]]></title>
            <link>https://blog.cloudflare.com/how-developers-got-password-security-so-wrong/</link>
            <pubDate>Wed, 21 Feb 2018 19:00:11 GMT</pubDate>
            <description><![CDATA[ Both in our real lives, and online, there are times where we need to authenticate ourselves - where we need to confirm we are who we say we are. This can be done using three things. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Both in our real lives, and online, there are times where we need to authenticate ourselves - where we need to confirm we are who we say we are. This can be done using three things:</p><ul><li><p>Something you <i>know</i></p></li><li><p>Something you <i>have</i></p></li><li><p>Something you <i>are</i></p></li></ul><p>Passwords are an example of something you <i>know</i>; they were introduced in 1961 for computer authentication for a time-share computer in MIT. Shortly afterwards, a PhD researcher breached this system (by being able to simply download a list of unencrypted passwords) and used the time allocated to others on the computer.</p><p>As time has gone on; developers have continued to store passwords insecurely, and users have continued to set them weakly. Despite this, no viable alternative has been created for password security. To date, no system has been created that retains all the benefits that passwords offer as researchers have rarely considered real world constraints<a href="#fn1">[1]</a>. For example; when using fingerprints for authentication, engineers often forget that there is a sizable percentage of the population that do not have usable fingerprints or hardware upgrade costs.</p>
    <div>
      <h3>Cracking Passwords</h3>
      <a href="#cracking-passwords">
        
      </a>
    </div>
    <p>In the 1970s, people started thinking about how to better store passwords and cryptographic hashing started to emerge.</p><p>Cryptographic hashes work like trapdoors; whilst it's easy to hash a password, it's far harder to turn that "hash" back into the original output (or computationally difficult for an ideal hashing algorithm). They are used in a lot of things from speeding up searching from files, to the One Time Password generators in banks.</p><p>Passwords should ideally use specialised hashing functions like Argon2, BCrypt or PBKDF2, they are modified to prevent Rainbow Table attacks.</p><p>If you were to hash the password, <code>p4$$w0rd</code> using the SHA-1 hashing algorithm, the output would be <code>6c067b3288c1b5c791afa04e12fb013ed2e84d10</code>. This output is the same every time the algorithm is run. As a result, attackers are able to create Rainbow Tables which contain the hashes of common passwords and then this information is used to break password hashes (where the password and hash is listed in a Rainbow Table).</p><p>Algorithms like BCrypt essentially salt passwords before they hash them using a random string. This random string is stored alongside the password hash and is used to help make the password harder to crack by making the output unique. The hashing process is repeated many times (defined by a difficulty variable), each time adding the random salt onto the output of the hash and rerunning the hash computation.</p><p>For example; the BCrypt hash <code>$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy</code> starts with <code>$2a$10$</code> which indicates the algorithm used is BCrypt and contains a random salt of <code>N9qo8uLOickgx2ZMRZoMye</code> and a resulting hash of <code>IjZAgcfl7p92ldGxad68LJZdL17lhWy</code>. Storing the salt allows the password hash to be regenerated identically when the input is known.</p><p>Unfortunately; salting is no longer enough, passwords can be cracked quicker and quicker using modern GPUs (specialised at doing the same task over and over). When a site suffers a security breach, users passwords can be taken offline in database dumps in order to be cracked offline.</p><p>Additionally; websites that fail to rate limit login requests or use captchas, can be challenged by Brute Force attacks. For a given user, an attacker will repeatedly try different (but common) passwords until they gain access to a given users account.</p><p>Sometimes sites will lock users out after a handful of failed login attempts, attacks can instead be targeted to move on quickly to a new account after the most common set of a passwords has been attempted. Lists like the following (in some cases with many, many more passwords) can be attempted to breach an account:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5uMRyoSntS2dkOn7C9Zc6v/c882908f5dfc1b8b5c257e8583f4b27a/common-weak-passwords.png" />
            
            </figure><p>The industry has tried to combat this problem by requiring password composition rules; requiring users comply to complex rules before setting passwords (requiring a minimum amount of numbers or punctuation symbols). Research has shown that this work hasn't helped combat the problem of password reuse, weak passwords or users putting personal information in passwords.</p>
    <div>
      <h4>Credential Stuffing</h4>
      <a href="#credential-stuffing">
        
      </a>
    </div>
    <p>Whilst it may seem that this is only a bad sign for websites that store passwords weakly, Credential Stuffing makes this problem even worse.</p><p>It is common for users to reuse passwords from site to site, meaning a username and password from a compromised website can be used to breach far more important information - like online banking gateways or government logins. When a password is reused - it takes just one website being breached, to gain access to others that a users has credentials for.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6l6Zm2PWsT6cXcXHpPevKX/87148160a2ed6d72bfd6288e156ecd28/this-is-not-fine-009-a7b6e6.png" />
            
            </figure><p> <a href="https://thenib.com/this-is-not-fine">This Is Not Fine - The Nib</a></p>
    <div>
      <h3>Fixing Passwords</h3>
      <a href="#fixing-passwords">
        
      </a>
    </div>
    <p>There are fundamentally three things that need to be done to fix this problem:</p><ul><li><p>Good UX to improve User Decisions</p></li><li><p>Improve Developer Education</p></li><li><p>Eliminating reuse of breached passwords</p></li></ul>
    <div>
      <h4>How Can I Secure Myself (or my Users)?</h4>
      <a href="#how-can-i-secure-myself-or-my-users">
        
      </a>
    </div>
    <p>Before discussing the things we're doing, I wanted to briefly discuss what you can do to help protect yourself now. For most users, there are three steps you can immediately take to help yourself.</p><p>Use a Password Manager (like 1Password or LastPass) to set random, unique passwords for every site. Additionally, look to enable Two-Factor Authentication where possible; this uses something you <i>have</i>, in addition to the password you <i>know</i>, to validate you. This will mean, alongside your password, you have to enter a short-lived password from a device like your phone before being able to login to any site.</p><p>Two-Factor Authentication is supported on many of the worlds most popular social media, banking and shopping sites. You can find out how to enable it on popular websites at <a href="https://www.turnon2fa.com/tutorials/">turnon2fa.com</a>. If you are a developer, you should take efforts to ensure you support Two Factor Authentication.</p><p>Set a secure memorable password for your password manager; and yes, turn on Two-Factor Authentication for it (and keep your backup codes safe). You can find additional security tips (including tips on how to create a secure main password) in my blog post: <a href="/cyber-security-advice-for-your-parents/">Simple Cyber Security Tips</a>.</p><p>Developers should look to abolish bad practice composition rules (and simplify them as much as possible). Password expiration policies do more harm than good, so seek to do away with them. For further information refer to the blog post by the UK's National Cyber Security Centre: <a href="https://www.ncsc.gov.uk/articles/problems-forcing-regular-password-expiry">The problems with forcing regular password expiry</a>.</p><p>Finally; Troy Hunt has an excellent blog post on passwords for users and developers alike: <a href="https://www.troyhunt.com/passwords-evolved-authentication-guidance-for-the-modern-era/">Passwords Evolved: Authentication Guidance for the Modern Era</a></p>
    <div>
      <h4>Improving Developer Education</h4>
      <a href="#improving-developer-education">
        
      </a>
    </div>
    <p>Developers should seek to build a culture of security in the organisations where they work; try and talk about security, talk about the benefits of challenging malicious login requests and talk about password hashing in simple terms.</p><p>If you're working on an open-source project that handles authentication; expose easy password hashing APIs - for example the <code>password_hash</code>, <code>password_​needs_​rehash</code> &amp; <code>password_verify</code> functions in modern PHP versions.</p>
    <div>
      <h4>Eliminating Password Reuse</h4>
      <a href="#eliminating-password-reuse">
        
      </a>
    </div>
    <p>We know that complex password composition rules are largely ineffective, and recent guidance has followed suit. A better alternative to composition rules is to block users from signing up with passwords which are known to have been breached. Under <a href="https://pages.nist.gov/800-63-3/sp800-63b.html">recent NIST guidance</a>, it is a requirement, when storing or updating passwords, to ensure they do not contain values which are commonly used, expected or compromised<a href="#fn2">[2]</a>.</p><p>This is easier said than done, the recent version of Troy Hunt's <i>Pwned Passwords</i> database contains over half a billion passwords (over 30 GB uncompressed). Whilst developers can use API services to check if a password is reused, this requires either sending the raw password, or the password in an unsalted hash. This can be especially problematic when multiple services handle authentication in a business, and each has to store a large quantity of passwords.</p><p>This is a problem I've started looking into recently; as part of our contribution to Troy Hunt's <i>Pwned Passwords</i> database, I have designed a <i>range search</i> API that allows developers to check if a password is reused without needing to share the password (even in hashed form) - instead only needing to send a short segment of the cryptographic hash used. You can find more information on this contribution in the post: <a href="/validating-leaked-passwords-with-k-anonymity/">Validating Leaked Passwords with k-Anonymity</a>.</p><p>Version 2 of <i>Pwned Passwords</i> is now available - you can find more information on how it works on Troy Hunt's blog post "<a href="https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/">I've Just Launched Pwned Passwords, Version 2</a>".</p><hr /><ol><li><p>Bonneau, J., Herley, C., Van Oorschot, P.C. and Stajano, F., 2012, May. The quest to replace passwords: A framework for comparative evaluation of web authentication schemes. In Security and Privacy (SP), 2012 IEEE Symposium on (pp. 553-567). IEEE. <a href="#fnref1">↩︎</a></p></li><li><p>Grassi, P. A., Fenton, J. L., Newton, E. M., Perlner, R. A., Regenscheid, A. R., Burr, W. E., Richer, J. P., Lefkovitz, N. B., Danker, J. M., Choong, Y.-Y., Greene, K. K., and Theofanos, M. F. (2017). NIST Special Publication 800-63B Digital Identity Guidelines, chapter Authentication and Lifecycle Management. National Institute of Standards and Technology, U.S. Department of Commerce. <a href="#fnref2">↩︎</a></p></li></ol> ]]></content:encoded>
            <category><![CDATA[Passwords]]></category>
            <category><![CDATA[Best Practices]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Salt]]></category>
            <guid isPermaLink="false">6lsrdeZvgI7O6CidQWI49j</guid>
            <dc:creator>Junade Ali</dc:creator>
        </item>
    </channel>
</rss>