Skip to main content
Mallory
HighPublic exploitVulnerability

CVE-2025-32462: Sudo Host Restriction Bypass via --host

Published Jun 30, 2025 · Updated today
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days1 mention · peak 1 in a dayToday
CVSS8.8High · v3.1
EPSS4.9%93rd percentile
CISA KEVNoNot listed
In the wildNonePublic exploit, no exploitation reported
Vendor
Sudo
IdentifiersCVE-2025-32462CWE-863 · Incorrect Authorization

CVE-2025-32462 is an authorization flaw in Sudo's enforcement of sudoers host restrictions, affecting versions 1.8.8 through 1.8.32 and 1.9.0 through 1.9.17. The -h/--host option, intended to support listing privileges for another host, is also accepted during command execution. A local user can supply a hostname matching a sudoers rule and execute commands on the current machine even when that rule authorizes execution only on a different host. This can permit local privilege escalation to root, subject to the rule's command and target-user permissions.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

An attacker controlling an account covered by an applicable host-restricted sudoers rule can cross the intended host authorization boundary. Commands authorized only on another machine may execute locally with elevated privileges, including root. Depending on the commands permitted, exploitation can compromise system confidentiality, integrity, and availability. The flaw does not inherently grant unrestricted command execution or bypass sudo authentication.

Mitigation

If you can’t patch tonight, do this now.

Until patched, remove sudoers rules for other hosts from the policy available on each affected machine, retaining only locally applicable, least-privilege rules. In LDAP/SSSD environments, narrow the sudo-rule search scope so irrelevant rules for other machines are not returned. Restrict access to Sudo where operationally feasible. Do not replace host restrictions with ALL as a workaround, because doing so broadens authorization.

Remediation

Patch, then assume compromise.

Upgrade Sudo to version 1.9.17p1 or later, or install the operating-system vendor's package containing the backported fix for CVE-2025-32462. For products bundling Sudo, deploy the corresponding vendor security update or fixed image.

Public exploits

Exploits

8 exploits validated by Mallory's analysis. Hidden: 5 rejected by Mallory's analysis as not a working exploit; 3 not yet analyzed, such as Exploit-DB entries.

View more in app →
CVE-2025-32462This repository contains a Bash exploit script (exploit.sh) and a README.md for CVE-2025-32462, a privilege escalation vulnerability in sudo on Linux. The exploit targets systems where sudo's '-h' (host) option is permitted with NOPASSWD rights, allowing a user to bypass host restrictions and execute commands as root on a specified host alias (TARGET_HOST). The script provides a pseudo-root shell by reading user commands and executing them as root via 'sudo -h <host> -- bash -c <cmd>'. For a full interactive shell, the user is advised to run 'bash' or use 'vim' to break into a real TTY shell. The repository is simple, with one exploit script and a README, and is intended for educational or CTF use. No network endpoints or external IPs are hardcoded; the main fingerprintable element is the TARGET_HOST variable, which must be set to a valid host alias configured in sudoers.j3r1ch0123 · Disclosed Jul 28, 2025 · bash · localOperationalCVE-2025-32462-CVE-2025-32463-PoC-LabRepository purpose: a small container-based lab plus an automated local privilege escalation PoC for sudo vulnerabilities CVE-2025-32462 and CVE-2025-32463. Structure (actual files present): - Dockerfile: builds an Ubuntu 24.04 container and compiles/installs sudo 1.9.16p2 from source (downloaded from sudo.ws). Creates a non-root user `pwn` for testing. - README.md: explains both CVEs and provides manual lab steps. It includes example Docker networking/hostnames to demonstrate CVE-2025-32462 (host matching bypass using `sudo -h highpriv.test.local ...`) and outlines the CVE-2025-32463 technique (NSS injection via `sudo -R` chroot). - auto_cve_2025_32463.sh: the main exploit automation. It creates a temporary staging directory, writes a C shared-library payload, builds it as a fake NSS module (libnss_/cve_2025_32463.so.2), creates a minimal chroot tree with a crafted `etc/nsswitch.conf` that references the custom NSS service name, then triggers the vulnerability with `sudo -R cve_2025_32463 cve_2025_32463`. When sudo loads the NSS module, the constructor sets uid/gid to 0 and execs /bin/bash, yielding a root shell. Exploit capabilities: - Local EoP to root (CVE-2025-32463) by achieving arbitrary code execution as root during sudo initialization in a chroot, via attacker-controlled NSS configuration and library loading. - The repo also documents (but does not provide a dedicated script for) CVE-2025-32462 exploitation: bypassing sudoers Host_Alias restrictions by supplying a spoofed hostname with `-h`, enabling unauthorized root command execution when host-based rules are in use. Notes on completeness: README describes additional directories (exploit/, lab/) that are not present in the provided file listing; the functional PoC in this archive is the single script auto_cve_2025_32463.sh plus the Docker lab build.yonathanpy · Disclosed Mar 5, 2026 · dockerfile · bash · localOperationalcve-2025-32462-analysisThis is a standalone educational exploit and reproducible Docker lab for CVE-2025-32462, not an exploit-framework module. The 14 supplied files comprise an MIT license, French and English READMEs, five French security-analysis/reference documents, an exploitation guide, three Bash scripts, a Dockerfile, and a Compose configuration. Four files contain executable or build logic; Compose supplies YAML orchestration configuration. The Dockerfile downloads and compiles sudo 1.9.17, creates lowpriv with the lab password 'password', and installs a host-dependent sudoers policy. Compose assigns the container the hostname prod.test.local. lowpriv is denied privileges for that hostname but granted NOPASSWD: ALL for dev.test.local and ci.test.local. The main Bash script displays environment information, tests local denial, enumerates the alternate-host permissions, then exploits sudo's acceptance of -h during command execution. Execution remains local: the alternate hostname changes policy evaluation rather than directing a command to another machine. On success, the script verifies root, reads the first /etc/shadow line, and opens a root login shell. On failure, it opens an ordinary Bash shell for manual investigation. start-environment.sh builds and launches the lab through docker-compose; stop-environment.sh removes the Compose environment. No published ports, host bind mounts, reverse shell, persistence mechanism, or network exfiltration are configured. The sudo source download is a build dependency. Dockerfile rm -rf commands remove package lists and temporary source files and are normal cleanup, not evidence of a fake exploit. Static inspection supports a genuine operational demonstration, but execution was not verified. There are documentation caveats: the English README gives incorrect fixed-version guidance; the upstream fix is sudo 1.9.17p1, and distribution backports require vendor-specific verification. Other version claims should not be treated as an authoritative affected-version inventory. The recommendations also describe broadening host access to ALL as secure, which can remove intended authorization boundaries. The README's direct invocation of the demonstration runs it in the current environment, whereas the guide correctly places it inside the container using docker exec. The source-archive fallback is commented out, and no archive is included in the supplied file list. No repository URL, Git reference, or archive byte size was supplied; corresponding metadata is left empty or zero.ceraz02 · Disclosed Nov 18, 2026 · bash · dockerfile · localOperationalCVE-2025-32462-ExploitThis repository contains a proof-of-concept (PoC) exploit for CVE-2025-32462, a local privilege escalation vulnerability in sudo (versions < 1.9.17) related to hostname-based restrictions. The exploit is implemented as a Bash script ('matrix-sudo-escape.sh') and is accompanied by a detailed README.md. The script interactively demonstrates the vulnerability by: 1. Checking if the system is vulnerable (sudo version < 1.9.17). 2. Creating a demo user ('trinity') and setting a password. 3. Temporarily changing the system hostname to a whitelisted value and configuring sudoers to allow the demo user sudo access only from that hostname. 4. Switching to a restricted hostname and confirming the user cannot use sudo. 5. Exploiting the vulnerability by using 'sudo -h <whitelisted_hostname>' to bypass the hostname restriction and gain root access. 6. Optionally cleaning up by restoring the original hostname, removing the user, and restoring the sudoers file. The exploit requires local access and is intended for demonstration and educational purposes. The only code file is the Bash script, which automates the setup, exploitation, and cleanup processes. The main fingerprintable endpoints are the '/etc/sudoers' file (modified and restored) and the use of hostnames ('zion-core', 'matrix-node') in the sudoers configuration. No network endpoints are involved; the attack vector is purely local.cybersentinelx1 · Disclosed Jul 3, 2025 · bash · markdown · localPoCCVE-2025-32462This repository contains a single C file, 'Exploit.c', which implements a proof-of-concept (PoC) exploit for CVE-2025-32462, a vulnerability in the 'sudo' utility's '-h' option. The exploit is interactive: it prompts the user for a target host and a command to execute as root. It then constructs and runs a 'sudo -h <targetHost> <command>' command, attempting to exploit the vulnerability to execute the specified command with root privileges. The exploit is local, requiring the attacker to have access to a system with a vulnerable version of 'sudo'. No network endpoints or remote services are directly targeted; the only fingerprintable endpoint is the 'sudo' binary itself. The code is straightforward and serves as a PoC, not a weaponized exploit.mylovem313 · Disclosed Jul 3, 2025 · c · localPoCCVE-2025-32462-POCRepository contains a single Bash proof-of-concept exploit script plus README and MIT license. - Primary exploit file: `CVE-2025-32462.sh` (Bash, ~379 bytes). It is a local privilege escalation PoC that attempts to exploit CVE-2025-32462 by invoking `sudo -h <local_hostname> <cmd>` (default cmd: `id`). It suppresses stderr and checks stdout for `uid=0(root)` to determine success. On success, it launches an interactive root shell using `sudo -h <hostname> /bin/bash -p`. - README: documents the claimed affected sudo versions (<= 1.9.17), an example sudoers misconfiguration, usage examples, and mitigation guidance (upgrade to 1.9.17p1+; restrict -h/--host). No network exploitation is present; the only external URLs are README badge/reference links. The exploit’s capability is limited to local root shell acquisition under specific sudo/sudoers conditions.0p5cur · Disclosed Jul 4, 2025 · bash · markdown · localPoCCVE-2025-32462-POCThis repository contains a proof-of-concept (PoC) exploit for CVE-2025-32462, a local privilege escalation vulnerability in sudo (versions <= 1.9.17). The exploit is implemented as a single Bash script (CVE-2025-32462.sh) that attempts to leverage a logic flaw in sudo's -h/--host argument handling. If the target system is running a vulnerable version of sudo and is misconfigured (e.g., with a sudoers rule like '(ALL, !root) NOPASSWD: ALL'), the script can spawn a root shell by running 'sudo -h localhost /bin/bash -p'. The repository also includes a README.md with detailed usage instructions, requirements, mitigation advice, and references, as well as a LICENSE file. No network endpoints or remote attack vectors are present; the exploit is purely local and targets misconfigurations in sudo's local privilege management.cyberpoul · Disclosed Jul 4, 2025 · bash · localPoCCVE-2025-32462_32463-LabThis repository provides a Docker-based lab and proof-of-concept (PoC) exploits for two sudo vulnerabilities: CVE-2025-32462 (host matching logic bypass) and CVE-2025-32463 (chroot NSS library escape). The structure includes a Dockerfile for setting up a vulnerable Ubuntu 24.04 environment with sudo 1.9.16p2, a README.md with detailed exploitation steps, and an automated bash script (auto_cve_2025_32463.sh) to exploit CVE-2025-32463. The exploit for CVE-2025-32463 works by creating a malicious NSS shared library that, when loaded in a chrooted environment via sudo's -R option, escalates privileges and spawns a root shell. The PoC is operational in a controlled lab environment and demonstrates local privilege escalation. No network endpoints are targeted; all actions are local to the container. The repository is intended for educational and research purposes.MAAYTHM · Disclosed Jul 7, 2025 · bash · dockerfile · localPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
SudoSudoapplication
FAQ

Frequently asked questions

Is CVE-2025-32462 exploited in the wild?
As of Nov 27, 2026, Mallory has no reports of CVE-2025-32462 being exploited in the wild. It is not listed in CISA KEV.
Is there a public exploit for CVE-2025-32462?
Yes. Mallory tracks 8 public exploits or proofs of concept for CVE-2025-32462, the earliest disclosed Jul 3, 2025.
Is there a patch for CVE-2025-32462?
Upgrade Sudo to version 1.9.17p1 or later, or install the operating-system vendor's package containing the backported fix for CVE-2025-32462. For products bundling Sudo, deploy the corresponding vendor security update or fixed image.
What products are affected by CVE-2025-32462?
Sudo.
How severe is CVE-2025-32462?
CVE-2025-32462 has a CVSS v3.1 score of 8.8 (High) and an EPSS score of 4.9% (93rd percentile) as of Nov 27, 2026.
Activity feed

Recent activity

81 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
+19 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity49Community discussion across Reddit, Mastodon, and other social sources.