Allow password-less accounts which cannot be looged into without a module authorizing #222

Closed
opened 2026-10-05 04:05:59 +02:00 by adam · 14 comments
Owner

Similar to the unix passwd -l account to only allow su logins. Need this to do my SSO system properly.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Similar to the unix passwd -l account to only allow su logins. Need this to do my SSO system properly. ## <bountysource-plugin> Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/286465-allow-password-less-accounts-which-cannot-be-looged-into-without-a-module-authorizing?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:13677864 -->
adam closed this issue 2026-10-05 04:05:59 +02:00
Author
Owner

Also, this could be used in conjunction with the certfile and cyrus modules.

Also, this could be used in conjunction with the certfile and cyrus modules. <!-- github-comment-id:17061272 -->
Author
Owner

Uhm, just do a big hack and set a "broken" password hash? E.g. pUser->SetPass("Disabled", CUser::HASH_MD5);

(A little less ugly approach would be to add a new value to that eHashType enum which means "disabled", dunno if that is worth it)

P.S.: passwd -l just does the same: It "breaks" the password hash by prefixing it with a "!".

Uhm, just do a big hack and set a "broken" password hash? E.g. pUser->SetPass("Disabled", CUser::HASH_MD5); (A little less ugly approach would be to add a new value to that eHashType enum which means "disabled", dunno if that is worth it) P.S.: passwd -l just does the same: It "breaks" the password hash by prefixing it with a "!". <!-- github-comment-id:17117156 -->
Author
Owner

I took a leaf from the Cyrus module and did just that. Would be nice to have the proper web/status hook.

I took a leaf from the Cyrus module and did just that. Would be nice to have the proper web/status hook. <!-- github-comment-id:17123779 -->
Author
Owner

@md-5 what did you do to accomplish your implementation?

The cyrusauth module does to SetPass on generic creations, the problem is that a user can still come back and set a password, thus invalidating the pass through.

https://github.com/znc/znc/blob/2b8e3f997f5d1a154e9c6e8c8efb9c115834afda/modules/cyrusauth.cpp#L137-L140

@md-5 what did you do to accomplish your implementation? The cyrusauth module does to SetPass on generic creations, the problem is that a user can still come back and set a password, thus invalidating the pass through. https://github.com/znc/znc/blob/2b8e3f997f5d1a154e9c6e8c8efb9c115834afda/modules/cyrusauth.cpp#L137-L140 <!-- github-comment-id:93785463 -->
Author
Owner

I did the same as cyrus above

I did the same as cyrus above <!-- github-comment-id:93842376 -->
Author
Owner

ok. so how are you preventing them from changing their passwords and thus bypassing your backend's password system

ok. so how are you preventing them from changing their passwords and thus bypassing your backend's password system <!-- github-comment-id:93983767 -->
Author
Owner

I'm not.

I'm not. <!-- github-comment-id:94059922 -->
Author
Owner

do you care? (bring serious, not snide)

do you care? (bring serious, not snide) <!-- github-comment-id:94086183 -->
Author
Owner

Not really, if they want to break their SSO that is their decision :p

Not really, if they want to break their SSO that is their decision :p <!-- github-comment-id:94112399 -->
Author
Owner

Logging in again with their SSO password will set their hash back to :: and make them require that pass.

Logging in again with their SSO password will set their hash back to :: and make them require that pass. <!-- github-comment-id:94112415 -->
Author
Owner

I wish that loging back in via SSO would reset it back to the ::, but it doesnt as far as i can see.

Also, it sounds nice to let breaking SSO be their decision, but typically your SSO system has enforced password policies, including change frequency. If they bypass it here they can 'make it easier' for their IRC config, while lowering your security posture.

I wish that loging back in via SSO would reset it back to the ::, but it doesnt as far as i can see. Also, it sounds nice to let breaking SSO be their decision, but typically your SSO system has enforced password policies, including change frequency. If they bypass it here they can 'make it easier' for their IRC config, while lowering your security posture. <!-- github-comment-id:94471623 -->
Author
Owner

I wish that loging back in via SSO would reset it back to the ::, but it doesnt as far as i can see.

My addon does

> I wish that loging back in via SSO would reset it back to the ::, but it doesnt as far as i can see. My addon does <!-- github-comment-id:94619504 -->
Author
Owner

I noticed i'm on 1.4 (i install from epel) and so I'm gonna eval the 1.6 release as soon as I can.

That being said, in the scenario i listed they would have to reason to log back in with their SSO password, and thus it would never reset, so that is a mute point. It seems that a better security posture would be achieved by disabling local auth explicitly if using external auth method.

I noticed i'm on 1.4 (i install from epel) and so I'm gonna eval the 1.6 release as soon as I can. That being said, in the scenario i listed they would have to reason to log back in with their SSO password, and thus it would never reset, so that is a mute point. It seems that a better security posture would be achieved by disabling local auth explicitly if using external auth method. <!-- github-comment-id:95416307 -->
Author
Owner

It seems that a better security posture would be achieved by disabling local auth explicitly if using external auth method.

Easily done with a small tweak to your SSO addon

> It seems that a better security posture would be achieved by disabling local auth explicitly if using external auth method. Easily done with a small tweak to your SSO addon <!-- github-comment-id:95469261 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#222