CVE-2025-32462:
Sudoers Host Escape
CVE-2025-32462 is a logic flaw in sudo where host-based rules in sudoers can be bypassed: by abusing the --host (-h) behavior, a user who is allowed sudo on one host can end up running commands even when the rule’s host field doesn’t match the current machine. This can cause unauthorized command execution and privilege escalation in environments that rely on hostname restrictions (especially with shared/centralized sudoers policies).
Below are general examples of techniques, methods, and proof-of-concept approaches used to demonstrate this vulnerability in a controlled environment.
In order to exploit this sudo host parameter we need a domain. Search the system for local domains you can use and try the following:
Matching Defaults entries for $USER on $DOMAIN:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, use_pty
User $USER may run the following commands on offramp:
(root) NOPASSWD: ALL
This shows us we can run anything as root within that host like:
# whoami root
References
-
Sudo 1.9.17 Host Option - Elevation of Privilegewww.exploit-db.com/exploits/52354 (opens in new tab)
-
Sudo host option elevation of privilegewww.stratascale.com/resource/cve-2025-32462-sudo-host-option-vulnerability (opens in new tab)
8
High risk
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Compexity
high
Privileges
low