Maybe Passwords are the Future
Tags: passwords, security, ux
Published: 2022-04-07 21:39:51

---
title: Maybe Passwords are the Future
published: true
date: 2022-04-07 15:25:00 UTC
tags: Passwords,Security,UX
canonical_url: https://kevincox.ca/2022/04/07/passwords/
---

<main><p>Most security experts seem to agree that passwords are on the way out. There is good reason for this:</p>
<ol>
<li>Users pick awful passwords, making brute force attacks easy.</li>
<li>Users reuse passwords, making <a href="https://en.wikipedia.org/wiki/Credential_stuffing">credential stuffing</a> effective.</li>
<li>Users can’t remember good, unique passwords for more than a few sites.</li>
<li>Passwords can easily be <a href="https://en.wikipedia.org/wiki/Phishing">phished</a>.</li>
<li>Passwords are exposed to the server. This makes reuse worse and offline phishing possible.</li>
</ol>
<p>A wide variety of new approaches are vying for popularity. <a href="https://en.wikipedia.org/wiki/WebAuthn">WebAuthn</a> removes passwords and instead uses keys that are managed by the browser. Email “magic links” use the ability to receive email as authentication. SSO delegates the problem to another provider. However these approaches all have major downsides. Let’s take a quick look at some of these and try to squeeze them into a pass/fail score, ignoring most of the nuance.</p>
<dl>
<dt>No Memorization</dt>
<dd>This means that the user doesn’t need to remember anything. Or at worst only remember a single, relatively short, thing for all sites. (Like an SSO URL or a master password)</dd>
<dt>No Third Party</dt>
<dd>This means that only the user and the service are involved. No third party needs to be available, and no third party can impersonate the user. (The WebPKI is excluded here)</dd>
<dt>Decentralized</dt>
<dd>This means that all third parties can be arbitrarily selected by the user.</dd>
<dt>No PKI</dt>
<dd>This means that WebPKI is not relied upon.</dd>
<dt>Unphishable</dt>
<dd>This means that the user can’t be tricked into giving someone else access to their account when they try to log into their account.</dd>
<dt>Syncable</dt>
<dd>The user can easily log in on all of <strong>their</strong> devices that are set up with their tools and config.</dd>
<dt>Transferable</dt>
<dd>The user can easily log in on a <strong>new</strong> device that doesn’t have their tools or config available.</dd>
<dt>Mutual</dt>
<dd>The user also verifies the server.</dd>
<dt>Leak-Proof</dt>
<dd>The server never learns enough information to authenticate as you to someone else.</dd>
</dl>
<table>
<thead><tr>
<th>Method</th>
<th>No Memorization</th>
<th>No Third Party</th>
<th>Decentralized</th>
<th>No PKI</th>
<th>Unphishable</th>
<th>Syncable</th>
<th>Transferable</th>
<th>Mutual</th>
<th>Leak-Proof</th>
</tr></thead>
<tbody>
<tr>
<td>Passwords</td>
<td>❌</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>❌</td>
<td>✅</td>
<td>✅</td>
<td>❌</td>
<td>❌</td>
</tr>
<tr>
<td>WebAuthn</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>1</td>
<td>❌</td>
<td>❌</td>
<td>✅</td>
</tr>
<tr>
<td>Magic Link</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>❌</td>
<td>❌</td>
<td>✅</td>
<td>2</td>
<td>❌</td>
<td>✅</td>
</tr>
<tr>
<td>SSO</td>
<td>3</td>
<td>❌</td>
<td>4</td>
<td>❌</td>
<td>✅</td>
<td>3</td>
<td>❌</td>
<td>❌</td>
<td>✅</td>
</tr>
<tr>
<td>TLS Client Certificate</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>❌</td>
<td>5</td>
<td>❌</td>
<td>❌</td>
<td>✅</td>
</tr>
</tbody>
</table>
<ol>
<li>Possible but not currently available. Can be blocked by the server if desired.</li>
<li>It is transferable if and only if you have an already-logged-in device available and the service allows following the link on a different device than the one that is trying to log in.</li>
<li>SSO just shifts the end-user authentication to someone else, so the method that the someone-else uses you determines these features.</li>
<li>Possible, but generally just a couple whitelisted options are available. (RIP <a href="https://openid.net/specs/openid-authentication-2_0.html">OpenID</a>)</li>
<li>Possible but not widely available.</li>
</ol>
<p>Personally I prefer to use passwords wherever possible. With a password manager (I use Firefox’s built in one) I know that I have strong passwords, they are synced across all of my devices, and they are only auto-filled on the correct sites. I don’t depend on any third party service (other than Firefox Sync which gracefully degrades if offline or down and has no access to my passwords) and can relatively easy copy a password into another device manually if required. It is also incredibly convenient, I don’t need to leave my browser or redirect to any other sites, I only need to click the login button because my credentials are autofilled.</p>
<p>So a password manager that integrates with the browser solves password problems 1-4. The only remaining flaw is that the server still sees my password. What if we could make passwords more secure rather than replacing them? One solution is a <a href="https://en.wikipedia.org/wiki/Password-authenticated_key_agreement">Password Authenticated Key Exchange (PAKE)</a>. If added to the above table and used with a password manager all boxes would be checked!</p>
<h2 id="possible-implementation"><a href="https://kevincox.ca/2022/04/07/passwords/#possible-implementation">Possible Implementation</a></h2>
<p>A very simplistic approach would look like follows:</p>
<div><pre><code><span>&lt;form</span> <span>action=</span><span>/login</span><span>&gt;</span>
	<span>&lt;input</span> <span>type=</span><span>text</span> <span>name=</span><span>username</span><span>&gt;</span>
	<span>&lt;input</span> <span>type=</span><span>password</span> <span>pake</span><span>&gt;&lt;/input&gt;</span>
	<span>&lt;button&gt;</span>Login<span>&lt;/button&gt;</span>
<span>&lt;/form&gt;</span>
</code></pre></div>
<p>A browser that supports the <code>pake</code> attribute would treat this very differently from a regular password field.</p>
<ul>
<li>The value can not be accessed by the page in any way.</li>
<li>When the form is submitted the browser will not send the password to the server. Instead, it will do a PAKE exchange with the server. Probably using <a href="https://datatracker.ietf.org/doc/html/draft-sullivan-tls-opaque-00">OPAQUE with TLS</a> or a similar mechanism.</li>
<li>The browser will remember that this password is PAKE-protected and refuse to autofill it in any way that is accessible to the website.</li>
<li>The UX will probably be subtly different. For example the browser would push harder for password-manager use (either built-in or extension based) and random password generation. Eventually non-PAKE password fields will probably show warnings.</li>
</ul>
<h3 id="unanswered-questions"><a href="https://kevincox.ca/2022/04/07/passwords/#unanswered-questions">Unanswered Questions</a></h3>
<ol>
<li>Need a solution for signup. For aPAKE algorithms this should never expose the password to the server. Maybe new a new form field? Switching behaviour on <code>autocomplete=new-password</code> seems wrong. Maybe <code>pake=login</code> vs <code>pake=register</code>?</li>
<li>Need to negotiate the algorithm used with the server.</li>
<li>Need to support upgrading passwords to better algorithms over time.</li>
<li>Should we specify the algorithm in the HTML, or just let the browser and server negotiate the best algorithm?</li>
<li>How do we know what the <code>username</code> field is? It needs to be transmitted before password validation and the rest of the form (which should probably only be transfered after authentication).</li>
<li>What if someone manages to MITM or otherwise compromise the service? I think a lot of phishing concerns need to be considered here, but at the end of the day, the password manager loudly protesting and requiring explicit warning dismissal before filling a previously-PAKE password into a non-PAKE location should sufficiently prevent this.</li>
<li>Does it make sense to have older browsers that don’t understand the attribute fall back to plain-text? Or would it be better to use a new element that wouldn’t work on browsers that don’t support it? I think that allowing the graceful upgrade is probably the better option.</li>
<li>Is a JavaScript API needed? Maybe the JS could manage the credential behind an opaque reference and make an API call with it. However this means that the page before authentication can see the results so is somewhat trusted. For best security a full page reload on a new, authenticated connection should be required. What if a “client” site wants to use PAKE authentication to two backend APIs (for example a Matrix client with multi-account support)?</li>
</ol>
<h2 id="tldr"><a href="https://kevincox.ca/2022/04/07/passwords/#tldr">TL;DR</a></h2>
<p>It seems to me that we are trying to get rid of passwords with solutions that miss some basic UX, flexibility, decentralization and security properties. I find myself often wondering if it would be better to stick with passwords as the user-visible authentication method but improve the underlying protocol to provide better security.</p></main>