Cyber Security News

Researchers Publish Technical Analysis of Linux Sudo Privilege Escalation

A team of security researchers has released an in-depth technical report on CVE-2025-32463, a critical local privilege escalation flaw in the widely used Linux sudo utility.

The vulnerability, which affects sudo versions 1.9.14 through 1.9.17, allows a local attacker with standard sudo access to gain full root privileges by abusing the tool’s –chroot feature.

At the heart of the issue is a logic error in the –chroot (or -R) option. Normally, chroot confines a process to a specified directory, but sudo applies this confinement before checking user permissions and before loading Name Service Switch (NSS) modules.

By placing a malicious /etc/nsswitch.conf file inside a user-controlled chroot directory, an attacker can force sudo to load a rogue shared library (.so) with root privileges via NSS’s dynamic module loading.

The flaw stems from the sequence of operations in sudo’s source code. After invoking chroot() on the target directory, sudo still runs as root.

It then calls functions like getpwuid() to verify user credentials. NSS reads the chrooted /etc/nsswitch.conf and, based on its contents, performs dlopen() on libraries such as libnss_malicious.so.2.

Because these modules load in the root context, an attacker’s specially crafted library can execute arbitrary root-level code in its constructor.

This method requires only local file write access and a writable directory like /tmp, making the attack both simple and devastating.

Researchers demonstrated the exploit in several steps:

  1. Environment Setup: Create a directory structure under /tmp/my_chroot with etc and lib/x86_64-linux-gnu subdirectories and set appropriate permissions.
  2. NSS Configuration: Add a fake /tmp/my_chroot/etc/nsswitch.conf that instructs NSS to load a “malicious” module.
  3. Malicious Library: Compile a shared library with a constructor function that spawns a root shell when loaded.
  4. Triggering the Bug: Run sudo -R /tmp/my_chroot /usr/bin/id to force chroot, NSS parsing, and library loading, resulting in a root shell.

Proof-of-concept code and detailed assembly-level analysis are available on GitHub, illustrating each stage from system call tracing with strace to the final shell spawn.

Affected systems include Ubuntu 24.04+, Red Hat 8/9, SUSE, Amazon Linux, and macOS Ventura/Sonoma when using vulnerable sudo releases.

The flaw is especially dangerous in containerized environments (Docker, Podman), where chroot escapes can lead to host compromise.

To defend against this attack:

  • Patch Immediately: Upgrade to sudo 1.9.17p1 or later, where the chroot feature is deprecated and permission checks occur before NSS loading.
  • Disable chroot: Add Defaults !chroot in /etc/sudoers via visudo.
  • Harden Temporary Directories: Mount /tmp with noexec,nosuid,nodev options.
  • Enforce MAC Policies: Use SELinux or AppArmor to restrict NSS module loading.
  • Audit chroot Calls: Employ auditd to log chroot system calls for suspicious activity.

CVE-2025-32463 highlights how seemingly protective features can introduce critical security gaps. System administrators are urged to apply updates and mitigations immediately to prevent unauthorized root access.

Continuous code reviews and responsible disclosure remain vital to securing essential system utilities.

Follow us on Google News, LinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

1 day ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

1 day ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

1 day ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

1 day ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

1 day ago