Skip to content

[10.0.4] Sessions created from application passwords result in "Login failed" errors when used #30157

Closed

Description

@SamuAlfageme

Context:

Prior to 10.0.4, there was a problem with application password and the sessions left behind after deletion (see #28553). This is most likely a collateral of the new logic for the fix on #28879 (lacking a migration strategy maybe)

The clients send 2 auth. methods (required) on the headers for all their requests: Authorization: Basic and Cookies.

Steps to reproduce

  1. Setup lockout mechanism
  2. Create an application password on a 10.0.4 installation
  3. Use it to log in to the Desktop client
  4. Observe the server logs

Expected behavior

Everything goes smooth

Actual behavior

See #30157 (comment); each client request results in 2 entries on the logs:

owncloud_1  | {"reqId":"b5PoKuAGyNkriyfFAMbG","level":2,"time":"2018-01-30T16:06:51+00:00","remoteAddr":"172.19.0.1","user":"admin","app":"core","method":"PROPFIND","url":"\/remote.php\/dav\/files\/admin\/","message":"Login failed: 'admin' (Remote IP: '172.19.0.1')"}
owncloud_1  | 172.19.0.1 - admin [30/Jan/2018:16:06:51 +0000] "PROPFIND /remote.php/dav/files/admin/ HTTP/1.1" 207 1551 "-" "Mozilla/5.0 (Macintosh) mirall/2.3.4 (build 8537)"
  • One successful, for the Authorization header.
  • One that causes a Login failed in core, that can be attributed to the Cookie -> the issue here; this makes password lockout mechanisms to trigger if present (see 0)

Cause:

#29525

Related Issues:

I'm assigning @IljaN since he's familiar with the #28879 patch, feel free to change assignment.

Activity

  1. ownclouders commented on Jan 16, 2018

    @ownclouders
    Contributor

    GitMate.io thinks the contributor most likely able to help you is @PVince81.

  2. added this to the development milestone on Jan 16, 2018
  3. added
    p1-urgent
    on Jan 25, 2018
  4. davitol commented on Jan 25, 2018

    @davitol
    Contributor

    Using Version 2.3.0-nightly20160929 (build 3715) OSX Desktop Client

    1. oC 10.0.3 --> create app password A and app password B
    2. Log in in Desktop Client with both app password.
    3. Delete Password A
    4. Via updater, update to 10.0.4

    Result:

    When I deleted the app password A, that account should have logged out, but it didn't

    If I manually log out from both accounts and I try to log in again. B app password wokrs fine but A (that was the one deleted) is no longer valid
    But the ticket says: #30157 (comment)

    Actual behavior
    
    Both A and B don't work as application passwords (no account can be logged in with them, even when B is still present in the DB)
    
  5. davitol commented on Jan 25, 2018

    @davitol
    Contributor

    Other scenario tested:

    Using Android 2.5.0 app

    1. oC 10.0.4. Create 2 password Apps and log in android client with password app A
    2. Update to 10.0.5.
    3. Check Android App. It keeps logged after the update
  6. added
    p3-medium
    and removed
    p1-urgent
    on Jan 25, 2018
  7. SamuAlfageme commented on Jan 25, 2018

    @SamuAlfageme
    Author

    It's unclear just yet how to reproduce this. I believe my original repro steps were conditioned on using a sync client pre-2.4: without owncloud/client#5830, same accounts on the client got just one entry on the keychain storage, leaving the last one used there (shadowing the one that was not removed on the webUI). I'm dropping sev. because of this.

    So one thing I think this might be is yet another display of #29779 i.e. (application password) basic auth replies include cookies, client storing these cookies & uses them as headers for next requests. And either core gives priority to Cookie headers over Authorization or uses them as fallback mechanism (like it also happens in owncloud/oauth2#103).

    Session cookies are removed on client logout/close - owncloud/client#5383 - this together with previous facts is the reason why the accounts are still connected even when the app password was removed (Authorization: Basic ... is no longer valid while client-stored Cookie: oc_sessionPassphrase=... is).

    I'm also reopening #28553.

    This behavior together with owncloud/updater#457 (running clients during server upgrades) might have something to do with the "Related Issues" in #30157 (comment).

  8. PVince81 commented on Jan 25, 2018

    @PVince81
    Contributor

    Note: my upgrade was done with distro packages and proper maintenance mode, not updater

  9. PVince81 commented on Jan 25, 2018

    @PVince81
    Contributor

    If someone ever manages to reproduce this, we need the logs from the password failure.

    If this is something like the CSRF issue here owncloud/android#1964 (comment), it might look like the password expired when it fact it's something else that is just getting in the way of authentication. To the user, the password prompt let them believe that the app password is not valid any more. In the case of my wife (in that ticket), she tried logging in with her regular password on the Android app and it didn't work either.

  10. changed the title [-]10.0.4 upgrade invalidates all application passwords[/-] [+][10.0.4] Sessions created from application passwords result in "Login failed" errors when used[/+] on Jan 30, 2018
  11. 18 remaining items

  12. modified the milestones: development, QA on Feb 13, 2018
  13. PVince81 commented on Feb 26, 2018

    @PVince81
    Contributor

    #30591 was merged now, close ?

  14. DeepDiver1975 commented on Feb 26, 2018

    @DeepDiver1975
    Contributor

    #30591 was merged now, close ?

    ❓

  15. bcutter commented on Feb 26, 2018

    @bcutter

    I implemented it manually (2 files, without test file) on OC v10.0.6.1 a few seconds ago. I´m paying attention to the clients and OC log file, will report soon if it fixed the issue.

    Update: Log empty regarding those issue for more than 30 minutes now, so: cautious all-clear signal.

  16. Emil-G commented on Feb 27, 2018

    @Emil-G

    Seems to have solved the issue of getting kicked out of LDAP here. Cheers 👍

  17. bcutter commented on Feb 27, 2018

    @bcutter

    Update: Nope. Even all the

    Warning core Login failed: 'Username' (Remote IP: '192.168.178.24') a day ago

    are gone now, there still are

    Warning	core	Login failed: 'xdXOt13JKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' (Remote IP: '192.168.178.24')	an hour ago
    Warning	core	Login failed: 'xdXOt13JKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' (Remote IP: '192.168.178.24')	2 hours ago
    Warning	core	Login failed: 'xdXOt13JKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' (Remote IP: '192.168.178.24')	3 hours ago
    

    every hour.

  18. DeepDiver1975 commented on Feb 27, 2018

    @DeepDiver1975
    Contributor

    I am working on a solution to fix the last log entries.

  19. DeepDiver1975 commented on Mar 1, 2018

    @DeepDiver1975
    Contributor

    I am working on a solution to fix the last log entries.

    #30421

  20. lock commented on Jul 30, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  21. locked as resolved and limited conversation to collaborators on Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type:Bugblue-ticketp1-urgentsecurity

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions