Coder Social home page Coder Social logo

pamauthd's Introduction

PAMAuthD - Web Authentication backed by pam.d

Usage

asciicast

Security

By default root is excluded as well as any uid, gid below 1000

pamauthd's People

Contributors

porcupineyhairs avatar rtgnx avatar

Stargazers

 avatar  avatar

Watchers

 avatar

pamauthd's Issues

Security Vulnerability Found

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/rtgnx/PAMAuthd/snapshot/be824a3e3addcfb6fdcf85453d50aee1fa7ac934/files/pam.go#xf730e34a54968544: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

Security Vulnerability Found

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/rtgnx/PAMAuthd/snapshot/be824a3e3addcfb6fdcf85453d50aee1fa7ac934/files/pam.go#xf730e34a54968544: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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.