pam_succeed_if: prevent logging unknown user names in plaintext#985
Open
lzwind wants to merge 1 commit into
Open
pam_succeed_if: prevent logging unknown user names in plaintext#985lzwind wants to merge 1 commit into
lzwind wants to merge 1 commit into
Conversation
When a user accidentally types their password at the username prompt, pam_succeed_if logs the password in plaintext via pam_syslog. This happens because evaluate_ingroup, evaluate_notingroup, evaluate_innetgr, and evaluate_notinnetgr return PAM_AUTH_ERR or PAM_SUCCESS for non-existent users instead of PAM_USER_UNKNOWN, bypassing the existing log guard. Add pam_modutil_getpwnam() checks in these four functions to return PAM_USER_UNKNOWN when the user does not exist, so the existing logging guard (ret != PAM_USER_UNKNOWN) correctly suppresses the output. Fixes: linux-pam#559
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pam_succeed_iflogs the password in plaintext viapam_syslog. This happens becauseevaluate_ingroup,evaluate_notingroup,evaluate_innetgr, andevaluate_notinnetgrreturnPAM_AUTH_ERRorPAM_SUCCESSfor non-existent users instead ofPAM_USER_UNKNOWN, bypassing the existing log guard (ret != PAM_USER_UNKNOWN).pam_modutil_getpwnam()checks in these four functions to returnPAM_USER_UNKNOWNwhen the user does not exist, so the existing logging guard correctly suppresses the output.Fixes: #559
Test plan
pam_succeed_if.so user ingroup <group>, it no longer appears in logsingroup,notingroup,innetgr,notinnetgrqualifiers all behave correctly