Web Development

A Well-Known Change-Password URL - Give Password Managers One Stable Door

A Well-Known Change-Password URL - Give Password Managers One Stable Door

A password manager can warn that a saved password is weak or exposed, yet still face a basic navigation problem: where does this particular site let the user replace it? One application may put the form under /settings/security, another under /account/password, and a redesign may move it again. Guessing those routes is brittle.

/.well-known/change-password offers a small piece of indirection. Software starts at one predictable URL on an origin, and the server redirects the user to the site's actual password-change page. It is closer to a signpost than a security system: useful because it points to the right door, limited because it does not decide who may enter.

The stable URL is an origin-level signpost

The W3C Web Application Security Working Group draft defines the change-password URL for an origin by adding the path /.well-known/change-password. For example:

https://example.com/.well-known/change-password

The scheme, host, and port still matter. The endpoint on https://accounts.example.com describes that origin; it does not automatically speak for https://example.com or another subdomain. This follows the broader model in RFC 8615, which reserves the root-level /.well-known/ prefix for registered discovery mechanisms. A path such as /account/.well-known/change-password is not the same mechanism.

The draft also begins from a potentially trustworthy origin. For a public site, the practical example is HTTPS. Publishing an HTTP-only shortcut to a sensitive account route would undermine the confidence that the origin is the intended one.

Its standards status needs a careful label

This feature is real enough to deploy, but its status should not be inflated. The W3C document is an Editor's Draft dated January 28, 2021, and it explicitly describes itself as work in progress rather than a W3C Recommendation. The IANA Well-Known URIs registry lists change-password under W3C control, registered on March 13, 2023, with provisional status.

There is implementation history behind the idea. WebKit documented its use for Safari 13's weak-password workflow in 2019, and web.dev later documented a Chrome password-manager flow. Those examples establish practical use, not universal or permanent support in every browser and third-party password manager. The endpoint should therefore be treated as a low-cost interoperability affordance, not a compatibility guarantee.

Redirect; do not move the form into .well-known

The draft says the server should answer the well-known URL with a 302, 303, or 307 redirect and a Location header. It also says the actual password-change page must not live at the well-known URL. That separation is the point: the public signpost remains stable while the application route can reflect the site's own account structure.

For a site using NGINX, an exact-match location keeps the rule narrow:

location = /.well-known/change-password {
    return 302 /account/security/password;
}

The NGINX documentation for return supports the return code URL form used here. This configuration was also syntax-checked locally with nginx -t. The destination is deliberately relative, so the redirect stays on the current origin. If account management belongs on a deliberately separate origin, use a reviewed absolute HTTPS URL and make that boundary visible to users.

Why 302 rather than a permanent 301 or 308? The current draft names only temporary redirect codes. Temporary indirection also avoids teaching intermediaries that today's internal account route is permanent. Following the draft is simpler than inventing stronger caching semantics for a route whose destination may change.

The destination still has to handle application state

The redirect can lead directly to a password form when the user is authenticated. If the user is signed out, the application may need to authenticate first and then return to that form. That return path should be server-selected or strictly allowlisted; turning an arbitrary query parameter into a post-login destination can create an open redirect.

Multilingual sites need another deliberate choice. Because the well-known path belongs to an origin rather than a locale subtree, the endpoint might:

  • redirect to a language-neutral account route that chooses a locale from the authenticated profile or normal site preference;
  • redirect to the site's default language while offering an immediate language switch; or
  • preserve a trusted locale already known by the application, without accepting an unrestricted destination from the request.

There is no locale negotiation protocol hidden inside this endpoint. Its narrow job is to find the change-password experience. Session handling, locale selection, and post-login navigation remain application decisions.

Help the password manager after it reaches the form

Discovery gets software to the right page; form semantics help it understand the fields. The HTML autocomplete reference on MDN distinguishes the existing password from a replacement:

<label for="current-password">Current password</label>
<input id="current-password" name="current_password"
       type="password" autocomplete="current-password">

<label for="new-password">New password</label>
<input id="new-password" name="new_password"
       type="password" autocomplete="new-password">

<label for="confirm-password">Confirm new password</label>
<input id="confirm-password" name="confirm_password"
       type="password" autocomplete="new-password">

These values are hints to the user agent. They can support autofill and password generation, but they do not validate the current password, enforce password policy, compare the confirmation, or authorize the update. Server-side controls still carry those responsibilities.

What this endpoint does not secure

The name can make the feature sound more powerful than it is. A redirect from a predictable path does not replace:

  • authentication and recent-authentication checks for a sensitive account change;
  • authorization and CSRF protection on the password-change request;
  • password hashing, password policy, rate controls, session revocation, or audit records;
  • forgotten-password recovery and its expiring, single-use credential; or
  • TLS certificate validation and the user's judgment about the origin.

Password change and password reset are especially easy to merge in language. A change page normally asks an authenticated user, often with the current password or another recent-authentication signal, to replace a credential. A recovery flow serves someone who cannot use that credential and must prove control another way. The well-known endpoint points to the former. Sending it straight to an email-reset request page changes its meaning and can add unnecessary friction or account-enumeration exposure.

RFC 8615 also warns that well-known resources represent an origin and need controlled write access. A CMS route, static-file deployment, or reverse-proxy rule should not let an unrelated tenant silently take over this path. The redirect destination is security-relevant navigation even though the redirect itself grants no account authority.

Test the redirect and the negative path

A browser click confirms only the happy path. A small deployment check should inspect the response rather than merely noticing that a page eventually appeared:

curl -sS -D - -o /dev/null \
  https://example.com/.well-known/change-password

curl -sS -o /dev/null -w '%{http_code}\n' \
  https://example.com/.well-known/this-should-not-exist

The first request should expose one of the intended temporary statuses and the reviewed Location. Follow it separately with curl -L if the destination also needs checking. The second request should not become a generic 200 OK page. web.dev notes that soft-404 behavior makes feature detection unreliable because clients cannot tell a supported endpoint from an application shell or an error page that incorrectly returns success.

The final test is behavioral: signed-out users should reach authentication and then the intended account page without accepting an arbitrary return URL; signed-in users should reach the real change form; the form should retain its CSRF, recent-authentication, validation, and session policies. A correct redirect cannot compensate for a broken destination.

Conclusion

/.well-known/change-password solves one modest problem well: it gives password-management software a stable place to ask where a site's password-change page lives. The implementation can be a single exact-match redirect, while the application remains free to reorganize its internal routes.

Its limits are part of the design. The specification is still a draft, the IANA registration is provisional, client support is not universal, and the endpoint supplies discovery rather than security authority. With those caveats visible, it is a small and honest improvement: one durable signpost leading to a password-change flow that still has to defend itself.

References