etherpad-lite icon indicating copy to clipboard operation
etherpad-lite copied to clipboard

Security regression on password (PASSWORD_HIDDEN) from commit 5c5b99fc9ad33054fb0291b92084e00ae1e634ef

Open alasserr opened this issue 6 years ago • 4 comments

On Etherpad 1.8.4 with Docker + postgresql, admin password can be used only once and is then replaced by "PASSWORD_HIDDEN" (on login form, password that is indeed checked, not only in cache). This seems to be a regression from 5c5b99fc9ad33054fb0291b92084e00ae1e634ef => https://github.com/anttiviljami/etherpad-lite/commit/5c5b99fc9ad33054fb0291b92084e00ae1e634ef

See : #3421

alasserr avatar May 15 '20 15:05 alasserr

Even reading the code it is only setting the password in the database, how that string lands at the client baffles me...

JohnMcLear avatar May 15 '20 21:05 JohnMcLear

Confirmed. Many thanks @alasserr for reporting this.

This bug impacts the users defined in settings.json. At least for the users that have access to the /admin area, after a single login their password is implicitly changed to PASSWORD_HIDDEN.

The bug may impact non-administrative users, too, but I did not test them.

Minimal test case

  1. supposing settings.json contains the following snippet:

      "users": {
        "admin": {
          "password": "pwd",
          "is_admin": true
        },
      }
    
  2. successful login to the admin console with the correct password:

    $ curl -u "admin:pwd" http://localhost:9001/admin/
    <!doctype html>
    <html>
      <head>
        <title>Admin Dashboard - Etherpad</title>
        [...]
    </html>
    
  3. subsequent logins with the correct password fail (to do this in a browser, reset everything via CTRL + SHIFT + DEL):

    $ curl -u "admin:pwd" http://localhost:9001/admin/
    Authentication required
    
  4. the password of admin is now PASSWORD_HIDDEN:

    $ curl -u "admin:PASSWORD_HIDDEN" http://localhost:9001/admin/
    <!doctype html>
    <html>
      <head>
        <title>Admin Dashboard - Etherpad</title>
        [...]
    </html>
    
  5. the good news is that the breakage is not stored in the database: after a server restart users are able to authenticate again (only once):

    $ curl -u "admin:pwd" http://localhost:9001/admin/
    <!doctype html>
    <html>
      <head>
        <title>Admin Dashboard - Etherpad</title>
        [...]
    </html>
    

muxator avatar May 16 '20 00:05 muxator

confirmed tnx @muxator will look at this now.

JohnMcLear avatar May 16 '20 11:05 JohnMcLear

btw @muxator I'm not sure on the best way to fix this, afaik I read you were taking a look into it?

JohnMcLear avatar May 19 '20 12:05 JohnMcLear