Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Vulnerability Found #1

Open
porcupineyhairs opened this issue May 24, 2022 · 0 comments · May be fixed by #2
Open

Security Vulnerability Found #1

porcupineyhairs opened this issue May 24, 2022 · 0 comments · May be fixed by #2

Comments

@porcupineyhairs
Copy link

Authorization Bypass due to incorrect usage of PAM library

Not using pam_acct_mgmt after pam_authenticate to check the validity of a login can lead to an authorization bypass

Common Weakness Enumeration(CWE) category

CWE - 863

Root Cause Analysis

In this case, in the following PAM transaction, only a call to pam.Authenticate is used to login a user.

https://lgtm.com/projects/g/inoc603/go-sshd/snapshot/eefea551067cd1afd32494dc5e2c7392c9fc0866/files/auth/pam.go#xb39fd1d060bda134:1

This implies that a user with expired credentials can still login.

The bug can be verified easily by creating a new user account, expiring it with chage -E0 username and then trying to log in with the expired credentials.

Remediation

This can be fixed by invoking a call to pam.AcctMgmt after a successful call to pam.Authenticate

Common Vulnerability Scoring System Vector

Exploitability

The attack can be carried over the network. A complex non-standard configuration or a specialized condition is required for the attack to be successfully conducted. The attacker also requires access to a users credentials, be it expired, for an attack to be successful. There is no user interaction required for successful execution. The attack can affect components outside the scope of the target module.

Impact

Using this attack vector, an attacker may access otherwise restricted parts of the system. The attack can be used to gain access to confidential files like passwords, login credentials and other secrets. Hence, it has a high impact on confidentiality. It may also be directly used to affect a change on a system resource. Hence has a medium to high impact on integrity. This attack may not be used to affect the availability of the system. Taking this account an appropriate CVSS v3.1 vector would be

(AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N)[https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L&version=3.1]

This gives it a base score of 7.7/10 and a severity rating of high.

References

This bug was found using CodeQL by Github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant