CVE-2015-8325 in OpenSSHinfo

Summary

by MITRE

The do_setup_env function in session.c in sshd in OpenSSH through 7.2p2, when the UseLogin feature is enabled and PAM is configured to read .pam_environment files in user home directories, allows local users to gain privileges by triggering a crafted environment for the /bin/login program, as demonstrated by an LD_PRELOAD environment variable.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 05/26/2026

The vulnerability identified as CVE-2015-8325 represents a critical privilege escalation flaw within the OpenSSH implementation that affects versions through 7.2p2. This issue specifically targets the do_setup_env function in the session.c file of sshd, which handles environment variable setup during SSH session establishment. The vulnerability becomes exploitable when the UseLogin feature is enabled alongside PAM configuration that reads .pam_environment files from user home directories, creating a dangerous intersection of authentication mechanisms that can be manipulated by local attackers.

The technical exploitation of this vulnerability relies on the improper handling of environment variables during the login process, particularly when the LD_PRELOAD environment variable is manipulated. When sshd processes user sessions with UseLogin enabled, it invokes the /bin/login program with environment variables that are constructed from the user's home directory .pam_environment file. This creates an opportunity for local users to inject malicious environment variables that can be passed to the login program, allowing them to manipulate the execution environment of the login process. The flaw occurs because the system does not properly sanitize or validate the environment variables read from the .pam_environment file before passing them to the login program, enabling attackers to inject code execution vectors through carefully crafted environment variable definitions.

The operational impact of this vulnerability is severe as it allows local users to escalate their privileges from standard user level to root access without requiring authentication. Attackers can leverage this flaw to execute arbitrary code with elevated privileges, potentially leading to complete system compromise. The vulnerability is particularly dangerous because it operates at the session setup level where the system is already in the process of authenticating a user, making the attack vector more隐蔽 and harder to detect. This type of privilege escalation vulnerability directly maps to CWE-250, which covers "Execute Code with Unusual or Unanticipated Privileges," and aligns with ATT&CK technique T1068, "Exploitation for Privilege Escalation." The attack can be executed without requiring network access or authentication credentials, making it particularly concerning for systems where local access is possible.

Mitigation strategies for CVE-2015-8325 should focus on immediate patching of OpenSSH installations to versions that address this vulnerability, as well as implementing configuration changes that disable the problematic UseLogin feature when PAM is configured to read user environment files. System administrators should also consider disabling PAM environment file reading capabilities for user home directories or implementing strict validation of environment variables before they are passed to login programs. Additional defensive measures include monitoring for unusual environment variable patterns in system logs and implementing principle of least privilege configurations that limit local user capabilities. The vulnerability demonstrates the critical importance of proper environment variable sanitization in authentication systems and highlights the need for comprehensive security reviews of session management functions in network services. Organizations should also consider implementing runtime protections such as LD_PRELOAD restrictions and environment variable whitelisting to prevent exploitation of similar vulnerabilities in the future.

Reservation

11/24/2015

Disclosure

04/30/2016

Moderation

accepted

Entry

VDB-83062

CPE

ready

EPSS

0.00627

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!