Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2025-6018 PoC — Pam-config: lpe from unprivileged to allow_active in pam

Source
Associated Vulnerability
Title: Pam-config: lpe from unprivileged to allow_active in pam (CVE-2025-6018)
Description:A Local Privilege Escalation (LPE) vulnerability has been discovered in pam-config within Linux Pluggable Authentication Modules (PAM). This flaw allows an unprivileged local attacker (for example, a user logged in via SSH) to obtain the elevated privileges normally reserved for a physically present, "allow_active" user. The highest risk is that the attacker can then perform all allow_active yes Polkit actions, which are typically restricted to console users, potentially gaining unauthorized control over system configurations, services, or other sensitive operations.
Description
CVE-2025-6018
Readme
# 🔒 CVE-2025-6018: Linux PAM to Root Privilege Escalation 🔒

---

### 🔍 Overview

* **CVE-2025-6018** is a **local privilege escalation (LPE)** vulnerability affecting **openSUSE Leap 15**, **SUSE Linux Enterprise 15**, and potentially other Linux distributions with misconfigured **PAM** (Pluggable Authentication Modules).
* It allows a local user (e.g., via SSH) to **impersonate a physically present/console user** by spoofing environment variables. This grants **`allow_active` privileges** via **Polkit**, which are normally reserved for GUI or logged-in physical users.

---

### 🧠 Technical Details

1. **PAM module `pam_env.so`** reads a user-controlled file: `~/.pam_environment`.
2. If this module is placed **before** `pam_systemd.so` in the PAM stack (e.g., `/etc/pam.d/sshd`), then a user can inject environment variables **before** the system determines the session type.
3. By injecting:

   * `XDG_SEAT=seat0`
   * `XDG_VTNR=1`
     The user tricks the system into thinking they are an active desktop session user.
4. As a result, **Polkit** treats the user as a **"local active user"** and grants elevated permissions via `allow_active=yes`.

---

### 🔗 Combined Exploit Chain with CVE-2025-6019

When combined with **CVE-2025-6019** (a separate LPE in **udisks2/libblockdev**), an attacker can escalate to **full root access**:

* Using `allow_active`, the attacker mounts a malicious disk image.
* Due to insecure mount options, they can execute a **SUID binary** or similar payload.
* This results in full root shell access.

---

### ⚠️ Impact

* **Attack requires local access** (e.g., a valid user account).
* No special privileges are required—just the ability to SSH or log in.
* Once exploited, attacker can:

  * Mount drives,
  * Install rootkits,
  * Disable system defenses,
  * Move laterally within a network.

---

### 🧮 CVSS Scores

| Source  | CVSS v3.1 Score | Vector                                      |
| ------- | --------------- | ------------------------------------------- |
| Red Hat | 7.8 (High)      | AV\:L/AC\:L/PR\:L/UI\:N/S\:U/C\:H/I\:H/A\:H |
| SUSE    | 8.4 - 8.6       | Depending on PAM config and assumptions     |

---

### 🛠️ Mitigation

1. **Update your system**:

   * SUSE and others have released patches.
   * Update `pam`, `pam-config`, `udisks2`, and `libblockdev`.

2. **PAM configuration fix**:

   * Move `pam_env.so` **after** `pam_systemd.so` in `/etc/pam.d/sshd` and similar files.
   * Or **disable** `user_readenv=1` to prevent reading user environment files.

3. **Polkit policy hardening**:

   * Change default `allow_active` actions (like disk mounting) to require `auth_admin`.
   * Modify `/etc/polkit-1/rules.d/` as needed.

4. **Detection**:

   * Monitor logs for:

     * Unusual Polkit permission requests.
     * Mount operations from non-admin users.
     * XDG\_SEAT or XDG\_VTNR environment variables in SSH sessions.

---

### 📌 Summary

| Item             | Description                                                  |
| ---------------- | ------------------------------------------------------------ |
| CVE              | CVE-2025-6018                                                |
| Type             | Local Privilege Escalation (via PAM & Polkit)                |
| Affected Systems | openSUSE Leap 15, SUSE Linux Enterprise 15 (and others)      |
| Combined with    | CVE-2025-6019 (udisks2/libblockdev bug → full root)          |
| Privilege Gained | `allow_active` → can become root via chained vulnerabilities |
| Fix              | Patch PAM, review pam\_env order, update Polkit rules        |
| Risk             | High – attacker can fully compromise the system locally      |

---

### 🛑 Disclaimer !!!

This information is provided for **educational and defensive security purposes only**.
Any attempt to exploit vulnerabilities without **explicit authorization** is **illegal** and may result in **criminal charges**.
Always test in **controlled, legal environments** such as labs or CTF platforms.
Use responsibly.


File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →