CVE Deep Dive : CVE-2025–32462
A flaw in sudo allowed a user to supply a hostname with the -h option when running commands, bypassing host-based restrictions in sudoers and executing commands as root on unintended systems. An attacker with a valid sudoers entry could therefore gain root access on hosts where they were not permitted.
medium.com
Published on medium.com
The sudo -h ( — host) option was designed for use only with -l ( — list) to view privileges across hosts. A bug allows users to specify the hostname used when evaluating sudoers rules, effectively bypassing all hostname-based restrictions during command execution.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The -h option, intended only for listing privileges with -l, was accepted during command execution and its value was used when evaluating host-based sudoers rules.
Impact
An attacker with a valid sudoers entry could run commands as root on systems where host-based rules should have prevented it, potentially leading to lateral movement and data exfiltration; the text notes the CVSS score is low but argues the risk is high in enterprise environments with centralised sudoers files.
What the attacker needed
Valid user account listed in sudoers; sudo version 1.8.8 through 1.9.17; host-specific restrictions in sudoers
The fix
The vulnerability was fixed in sudo 1.9.17p1, which rejects the -h option unless it is used with -l.
How it was found
- Obtain a valid user account that is listed in sudoers with host-specific restrictions.
- Run sudo with the -h option naming a permitted host, followed by the restricted command.
- The command executes as root even though the current host does not match the sudoers rule.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Sudo is a program that lets a normal user run certain commands as a more powerful user, often root. Administrators can write rules saying a user may only run a command on a particular machine. This bug let the user name a different machine when running the command, so the rule was checked against the wrong machine and the command ran as root anyway.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.