CVE-2019-16729
High · 7.8CVSS
7.8
EPSS
0.4%
Published
Sep 24, 2019
CISA due date
—
Cloudanix analysis
A flaw in a common Linux authentication component lets anyone already logged into the computer take complete control of the whole system.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Privilege Gain
- Component
- Library
- Class
- Privilege Escalation
- Remediation
- Upgrade
- Effort
- Low
- Patch risk
- Low
What it actually does
The flaw permits a local authenticated user to supply malicious environment variables that Python's default handling loads during PAM module execution, resulting in arbitrary code execution with root privileges in vulnerable PAM configurations.
Why it matters to the business
Attackers with any local account can fully compromise the system, leading to data theft, persistence, and lateral movement with high urgency on widely deployed Linux distributions.
How an attack unfolds
An attacker with local shell access crafts environment variables that trigger unintended Python code paths when pam-python executes during authentication; the code runs with elevated privileges due to the PAM context, granting root access without further authentication bypass.
How to fix it
Upgrade pam-python to version 1.0.7-1 or later on all affected Debian and Ubuntu systems; review and harden PAM configurations that invoke Python modules; disable unnecessary pam-python usage where possible.
How to confirm the fix worked
Verify installed package versions against 1.0.7-1 or newer; test PAM stacks with pam-python to confirm environment isolation; run configuration audits for Python-invoking PAM entries.
Typical attack path
- Obtain local user shell access on an affected system
- Set crafted environment variables exploiting Python defaults
- Trigger a PAM-authenticated action such as su, sudo, or login
- Execute arbitrary code as root via the loaded Python module
How to detect it
Review authentication logs for unexpected Python process spawns during PAM events; inspect environment variable inheritance in PAM sessions; correlate with user-initiated privilege escalation attempts.
What your security team should do
- Immediately patch all systems running pam-python below 1.0.7-1
- Audit PAM configurations across the environment for Python module usage
- Restrict local user access on high-value systems pending remediation
- Monitor for post-authentication privilege changes in logs
The record
pam-python before 1.0.7-1 has an issue in regard to the default environment variable handling of Python, which could allow for local root escalation in certain PAM setups.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:10 | pam-python | 0 | 1.0.6-1.1+deb10u1 |
| Debian:11 | pam-python | 0 | 1.0.7-1 |
| Debian:12 | pam-python | 0 | 1.0.7-1 |
| Debian:13 | pam-python | 0 | 1.0.7-1 |
| Debian:8 | pam-python | 0 | 1.0.4-1.1+deb8u1 |
| Debian:9 | pam-python | 0 | 1.0.6-1.1+deb9u1 |
| Ubuntu:16.04:LTS | pam-python | 0 | 1.0.4-1.1+deb8u1build0.16.04.1 |
| Ubuntu:16.04:LTS | pam-python | 0 | 1.0.4-1.1+deb8u1ubuntu0.1 |
| Ubuntu:18.04:LTS | pam-python | 0 | 1.0.6-1.1+deb10u1build0.18.04.1 |
| Ubuntu:18.04:LTS | pam-python | 0 | 1.0.6-1.1+deb10u1ubuntu0.1 |
| Ubuntu:20.04:LTS | pam-python | 0 | 1.0.7-1 |