Giter Site home page Giter Site logo

webappsec-change-password-url's Introduction

A Well-Known URL for Changing Passwords

Table of Contents

Currently, if the user of a password manager would like to change their password on example.com, basically all the password manager can do is load example.com in a browser tab and hope the user can figure out how to update their password themselves.

The goal of this specification is to do the simplest possible thing to improve this situation, by defining the /.well-known/change-password well-known resource.

Proposal

example.com provides a /.well-known/change-password resource which redirects to their change password form, wherever it happens to already be.

Password managers check for the existence of /.well-known/change-password on https://example.com.

If it's there (the response code is 2xx or 3xx), the password manager can cause the user's browser to navigate there when the user indicates they'd like to change their password.

That's it, really. It's a pretty simple idea.

Frequently Asked Questions

Why not allow sites to override this location with an HTTP Link header or an HTML link element?

Implementation complexity. (This would require keeping site-specific state client-side, verifying & invalidating said state periodically, etc.)

Why not serve a JSON resource with links to other account management functions?

Specification complexity. If we determine we need other account management well-known resources in the future, we can specify them then.

What tools have implemented this feature?

  • iCloud Keychain on iOS 12
  • Safari 12
  • 1Password (1Password 8 and 1Password for Chrome, Firefox, Edge and macOS Safari)
  • Chrome 86
  • Backdrop CMS, via the Well-known module.

What about servers whose HTTP response codes are unreliable?

Sometimes, HTTP servers are configured to respond 200 OK for resources that really aren't there. The Detecting the reliability of HTTP status codes draft attempts to address this problem.

webappsec-change-password-url's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webappsec-change-password-url's Issues

Be explicit that this specification is about "changing a password", not "resetting a password"

I have been implementing this specification for Backdrop CMS via the Well-known module. After reading the specification I was unsure of how I should be handling an anonymous user arriving at http://example.org/.well-known/change-password. Indeed, initially I mistakenly implemented this by redirecting them to the reset password page. This mistake has been corrected, but I think it would be would be nice if the specification was more explicit on this point.

I think it would add clarity if the specification distinguished between changing a password verses resetting a password; and that the expected behaviour for anonymous users is that a website should invite a user to login before redirecting them to the change password page.

There is a reference to this subject in issue #4 by @craigfrancis, so this issue could be considered a duplicate of that one. However, I think it would be helpful to be explicit about the change vs reset terms in the specification.

Pathway to W3C adoption

Hi,

I'm working on implementing the change-password well known URL in Drupal core (see this issue).

A maintainer has asked about the pathway to W3C adoption. They are concerned about the potential of the /.well-known/change-password URL changing when formally adopted by the W3C, resulting in Drupal core having to support a legacy URL.

Are you able to advise on the pathway for this standard to be adopted by W3C (if at all)?

Thanks!

What about a link relation type?

It's a good idea to have a well-known URI for this, even though as I understand it, the typical use cases for well-known are cases when it's impossible to use embedded links for identifying a URI.
In this case, at least there's also the case for making the change-password-url discoverable from a resource (such as the home page of a user). I am wondering whether it wouldn't be useful to have a link relation type as well?

Clarify that redirects should be followed to resolve the Change Password URL

Today, we have this:

Clients must handle such redirects when requesting a change password url.

We should better clarify that resolving the Change Password URL may require following more than one redirect. For instance:

https://example.com/.well-known/change-password
may redirect to
https://www.example.com/.well-known/change-password
which may redirect to
https://www.example.com/actual-change-password-page

If a client only followed a single redirect, they’d be misled. This came up in issue #14.

Broken reference for "Appropriate Use of Well-Known URIs"

In section 3:

Servers must not locate the actual change password page at the change password url, per RFC8615 §1.1 Appropriate Use of Well-Known URIs.

In PR #17, the reference was updated from the obsolete RFC 5785 to the current RFC 8615, leaving the section reference unchanged. However, 8615 does not contain a section 1.1, nor does it contain any section directly addressing the appropriate use of well-known URIs.

The best reference I can find in 8615 to support this spec prohibiting servers from locating the resource itself at the well-known URI is section 1, in which the RFC implies that well-known URIs are for metadata (only?): the penultimate paragraph includes "Future specifications that need to define a resource for such metadata [...]".

See also issue #9.

Who supports this?

Hi, WICG chairs are just going through the repos and checking status... I seem to recall Safari supports this feature (and twitter was using it, right?)? Did other browser vendors get behind it? If yes, should we consider moving it to the W3C or WHATWG?

Punycode?

Origins have an ASCII domain, meaning that a host like example.إختبار will show up as example.xn-kgbechtv in the origin, and therefore in the change-password well-known URL. Is that what we'd like?

Malicious subdomain concern

This was raised on public-webappsec:

I am also concerning that draft is not considering 3rd level domains take over and how an attacker could advertise a password change URL to get a Beef kind of hooking of clients in a bot fashion.

Restrict redirection status codes to temporary ones

The spec accepts all redirect status codes, as listed in the fetch spec, including the permanent ones: 301 and 308.

Since 301 and 308 inform clients that the redirection is permanent, they might cache the URL found in the Location header, and stop calling the URL that triggered the redirection (here, the well-known URL)
I remember Firefox doing this at some point, and some proxies might also do this.

We can't be sure that website maintainers will not change the URL of their "change password" page. With permanent redirect status codes, some users might land on the old page, or on a 404.

This could be avoided by limiting the redirection status code to 302, 303, and 307.

response-code-reliability checking for OK Status

The response-code-reliability proposal says: If response’s status is an ok status, reject p. Otherwise, resolve p.

Is this ideal? E.g. error codes like 502 Bad Gateway or 503 Service Unavailable don't positively indicate that /.well-known/resource-that-should-not-exist-whose-status-code-should-not-be-200 behaves like expected.

Should we change the spec to look for /.well-known/resource-that-should-not-exist-whose-status-code-should-be-404 ?

Consider ways of differentiating implementation and poor error pages

I've been experimenting with the .well-known/change-password route on a number of sites. On some, such as https://twitch.tv/, it's currently impossible to detect programatically that the route does not exist.

There are two reasons why this problem occurs:

  • You see a redirect, as Twitch redirect users from their "naked" domain to the www subdomain.
  • Twitch is a SPA, and doesn't seem to set status codes consistently. You see a 200 on the page you're redirected to, even though it's a 404.
    Requests occasionally go to the cache, and a 404 is correctly returned, so you may need to visit a number of times to observe this behaviour.

While in this example the server is setup incorrectly, for clients wishing to implement this spec, this is still a problem. It would be nice if servers were expected to exhibit additional behaviour (setting a header perhaps) so that more reliable detection could be done.

For my use case, I'm actually making CORS requests, so only know the status code and if we were redirected. It might not be possible for a solution to work for my use case - I certainly can't read headers - but am mentioning in case there is a CORS compatible option here.

Consider adding a bit more detail to the generation algorithm.

I'd suggest being a bit more pedantic about the URL generation algorithm. Perhaps something like:

1.  If |origin| is not a [=potentially trustworthy origin=], return failure.

2.  Assert: |origin| is a [=tuple origin=].

3.  Let |url| be a new [=URL=] with values set as follows:
    
    :   [=url/scheme=]
    ::  |origin|'s [=origin/scheme=]
    :   [=url/host=]
    ::  |origin|'s [=origin/host=]
    :   [=url/port=]
    ::  |origin|'s [=origin/port=]
    :   [=url/path=]
    ::  « "`.well-known`", "`change-password`" ».

4.  Return |url|.  

@annevk might have opinions about whether it's better to generate URLs this way or by feeding strings into the parser (if the latter, you'll need to serialize the origin before parsing it). This seems clearer to me?

Specifying navigations affected by .well-known/change-password

We noticed that the current draft does not specify which navigations should be affected by .well-known/change-password. I can think of several possibilities:

  1. All navigations
  2. All navigations in the main frame
  3. Only navigations triggered by the browser (e.g. via a "Change password" button") - but not those triggered by a user-typed URL nor from links nor site-initiated navigations.

My intuition would go with 2 as this allows a website like https://passwords.google.com to just redirect to example.com/.well-known/change-password in the assumption that the user won't be greeted by a 404.

I can also see a reason for 3: In this case there would be less special casing for site-initiated navigations. Also browser extensions would probably have more control.

I don't see a lot of value in 1 (supporting the spec for iframes).

WDYT? @rmondello @hober

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.