Skip to content

Disabled LDAP accounts can still login into Rocket Chat #4554

Closed

Description

@doctorwho92

Your Rocket.Chat version: (0.41.0)

Two issues in one:

  1. Disabling an user account in Active Directory does not prevent that user from being able to login to Rocket Chat;
  2. Disabling an user account in Active Directory does not terminate any existing Rocket Chat session for that user. Each authenticated session should perform periodic re-authentication, or the server should have an ldap listener and terminate the session(s) for any account which is no longer valid in the directory.

Activity

  1. doctorwho92 commented on Oct 6, 2016

    @doctorwho92
    Author

    Would like to request that high priority be given to this issue, since it is a serious security issue.

    Thanks in advance.

  2. jamie-owen commented on Oct 7, 2016

    @jamie-owen

    @doctorwho92 Why did you close this? As you said, it's a pretty big problem for people using LDAP auth.

  3. doctorwho92 commented on Oct 7, 2016

    @doctorwho92
    Author

    I didn't close it, or certainly not deliberately.

  4. added this to the milestone on Oct 10, 2016
  5. qk4l commented on Nov 8, 2016

    @qk4l
    Contributor

    Have anybody tried to disable LDAP > Login Fallback to prevent this security issue?

  6. alexvranceanu commented on Dec 20, 2016

    @alexvranceanu

    Tested using latest develop branch, still happening. Login Fallback will prevent disabled users from logging on, but it will not allow local users (such as admin) to login (as designed).

  7. alexvranceanu commented on Dec 22, 2016

    @alexvranceanu

    We're using this filter for LDAP logins, this allows subtree search and logins with username or email, for enabled users only:
    {"filter": "(&(objectClass=person)(|(userAccountControl=512)(userAccountControl=66048))(|(mail=#{username})(sAMAccountName=#{username})))", "scope": "sub", "userDN": "SERVICE_ACCOUNTS@your-company.com", "password": "HIDDEN"}

    Details about userAccountControl values here:
    https://support.microsoft.com/en-us/kb/305144
    and here:
    http://jackstromberg.com/2013/01/useraccountcontrol-attributeflag-values/

    Perhaps this could be set as a default filter for a clean Rocket.Chat install? It will speed up adoption and ease the process of integrating with LDAP.

  8. localguru commented on Feb 25, 2017

    @localguru
    Contributor

    I can confirm the problem: a removed user from AD is still able to login as long as "LDAP/Login Fallback" is set to "True". If it's set to "False" the user can't login, but this disables the initial, local admin user too and one has to put another AD user to admin group the get admin access again:

    db.users.update({username:'otheruser'}, {$set: {'roles' : [ "admin" ]}});

    But what happens if one changes the LDAP configuration to something wrong and the LDAP connection is not working any more? In that case your are blocked completely.

    LDAP_Login_Fallback workaround?
    db.rocketchat_settings.update({'_id':'LDAP_Login_Fallback'}, {$set: { 'value':true }})

    If the LDAP/AD connection is fine and "Domain Search User" can log in, an user object that does not exist any more, to my mind this is not a case of LDAP_Login_Fallback.

    Ciao!

  9. gregs007 commented on Jun 13, 2017

    @gregs007

    I think doing what's suggested in #7235 should work for LDAP auth. Basically you would disable RC users that are disabled or missing in LDAP directory. This would be during regular LDAP database sync. I don't think regular re-auth is a good idea in the case of an unstable LDAP connection locking out users. Sync on the other hand, is more definitive--- If the user is disabled in the LDAP/AD database, it gets disabled in RC.

  10. doctorwho92 commented on Jun 13, 2017

    @doctorwho92
    Author
  11. 40 remaining items

  12. added this to the 3.2.0 milestone on Apr 20, 2020
  13. winstonrojas commented on Apr 26, 2020

    @winstonrojas

    I thank you (rocket chat team) and encourage you to keep forward and make rocket chat a real community worldwide people project. Unfortunately many of us still rely on closed monopolistic technologies like Microsoft Windows workstations (i'm grateful with windows, in a way i have benefited a lot from it and i enjoy some of their products, but in a philosophical way i can not agree ) and therefore Active Directory almost like the natural method for administration.

  14. Shaverdoff commented on Apr 26, 2020

    @Shaverdoff
  15. modified the milestones: 3.2.0, 3.3.0 on May 9, 2020
  16. modified the milestones: 3.3.0, 3.4.0 on May 25, 2020
  17. modified the milestones: 3.4.0, 3.5.0 on Jul 3, 2020
  18. moonwolf-github commented on Oct 21, 2020

    @moonwolf-github

    Looks like in 3.5.3 it still doesn't work as it should.

  19. Nikk-0 commented on Jul 1, 2021

    @Nikk-0

    Hi,

    Any news about this ?

  20. eengstrom commented on May 5, 2023

    @eengstrom
    Sponsor

    So, it's been another three years since @engelgabriel said:

    Rocketeers, after consideration, we will merge the code to fix these LDAP issues into the main repository. I am reopening a few of the LDAP issues to be resolved this week.

    To me, that implied the required features to enable proper LDAP sync and (I inferred) automatic user disabling during said sync. Perhaps I misunderstood, but if not, those features are still not working in the CE version. Both appear to be enterprise only features.

    ... notably, the following obviously useful features:

    • Advanced Sync
      • Sync User Active State: Determine if users should be enabled or disabled on Rocket.Chat based on the LDAP status.
    • Auto Logout Deactivated Users
      • Enable Auto Logout: Set true to enable auto-logout.
      • Auto Logout Interval: Allows you to set the interval for auto-logout.
    • Background Sync
      • Background Sync: Enable periodic background sync.
      • Background Sync interval: The interval between synchronizations

    While I totally understand the financial need to break out some features into the enterprise version so that the company may generate revenue, I completely disagree that any security-related capabilities should not be automatic, and in the community edition, especially if the contributions made came from the community.

    If not, and without the ability to automatically and periodically update user "disabled" status and auto-logout (newly) disabled users, RocketChat has decided that the security of users using the community edition version is not of their concern.

    Moreover, having the bug/feature reports remain open implies that it's still a possibility, when in fact there is no intention to "fix", since it's already working, if one is using Enterprise mode. Someone should at least acknowledge the "enterprise only" decision and close the issue.

  21. caskelly commented on May 5, 2023

    @caskelly

    Thanks for your comment,

    You are correct that after Gabriel’s comment which you quoted we refactored LDAP code including addressing a number of open issues. At that time we made the updated functionality part of the enterprise offering. We will close the associated issues.

    Regards,
    Chris Skelly

  22. eengstrom commented on May 6, 2023

    @eengstrom
    Sponsor

    @caskelly - I appreciate the acknowledgement here (and #6174 and #7235), but I encourage you to read my entire post again. While I get the motivation for revenue, I would encourage you to consider any features that affect the security of deployments and not put those behind paywalls. In this case, there is an implicit expectation that an account disabled in some LDAP / AD system would be forbidden from logging into RC, but that's not true.

    While I don't know the extent to which the code that implements the LDAP integration came from CE contributions, I completely believe that security related code should never be behind a paywall. Other stuff that makes life better? Sure. But don't endanger contributing CE users by putting features like the LDAP sync and auto-disable in the enterprise only version. That's just asking for people to be impacted negatively, which will reflect poorly on your product when incidents occur. Oh, and blaming the user? That's not an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions