Skip to content

ldap: pwd_expire_policy_warn does not overwrite errors - #9393

Open
sumit-bose wants to merge 4 commits into
SSSD:masterfrom
sumit-bose:CVE-2026-92821
Open

sumit-bose wants to merge 4 commits into
SSSD:masterfrom
sumit-bose:CVE-2026-92821

Conversation

@sumit-bose

Copy link
Copy Markdown
Contributor

Make sure the 'pwd_expire_policy_warn' access check does not overwrite
any access denied or other errors.

:fixes: CVE-2026-92821

:expectedresults:
1. SSH is successful and shows 'Your password has expired.' on standard error
2. Config change is successful
3. SSH fails because the 'expire' policy rejects the locked user

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLM comment:
"""
The test sets only ldap_pwd_policy = shadow and never ldap_account_expire_policy (default NULL), so the expire rule denies through the "Missing account expire policy. Access denied" branch (sdap_access.c:725-728) — not shadow expiry. Concrete failure mode: the denial is incidental; if a default for ldap_account_expire_policy were ever introduced, the test could stop denying and silently stop guarding the CVE. The docstring ("the expire policy rejects the locked user") is also misleading. Make the denial intentional (real shadowExpire, or a non-matching filter per finding 1). The IPA test is clean by contrast (genuine nsAccountLock).
"""

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

makes sense, I created SSSD/sssd-test-framework#284 to allow to set shadowExpired as well to create a properly expired shadow user object.

bye,
Sumit

@alexey-tikhonov

Copy link
Copy Markdown
Member

Fixes per see look good to me.
There is a test related comment from LLM that looks plausible to me.

@danlavu danlavu left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are great, one nitpick and... these tests should be moved to test_ldap.py, since this file contains parametrized ad_access_filter and ldap_access_filter tests. Would expect any test in here to have that configurable.

I know the name is confusing, because ad_access_filter and ldap_access_filter, is access control with ldap filtering, explains the thought process.

f"-l {user.name} localhost whoami",
raise_on_error=False,
)
assert result.rc == 0, "SSH with pubkey failed"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick, ! at the end of these assert messages, all assert messages.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exclamations marks added.

Make sure the 'pwd_expire_policy_warn' access check does not overwrite
any access denied or other errors.

:fixes: CVE-2026-92821
Verify fix for CVE-2026-92821 and make sure the 'pwd_expire_policy_warn'
access check does not overwrite any access denied or other errors.
If the shadow scheme is used to determine if a password is expired or
not the user currently does not see a message that the password is
expired if the shadow attribute sp_lstchg is missing or 0. With this
patch the message is shown in this case as well.
Verify fix for CVE-2026-92821 and make sure the 'pwd_expire_policy_warn'
access check does not overwrite any access denied or other errors.
@sumit-bose

Copy link
Copy Markdown
Contributor Author

These tests are great, one nitpick and... these tests should be moved to test_ldap.py, since this file contains parametrized ad_access_filter and ldap_access_filter tests. Would expect any test in here to have that configurable.

I know the name is confusing, because ad_access_filter and ldap_access_filter, is access control with ldap filtering, explains the thought process.

Hi,

I move the test to test_ldap.py.

bye,
Sumit

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants