Skip to content
Access control Write-up Intermediate

Vulnerability report: CVE-2025–3262

The sudo -h option, intended only for listing privileges, could be used when running commands, letting a user choose which host's sudoers rules were evaluated. A user listed for a different host could therefore run commands as root on the current host.

medium.com

Published on medium.com

The sudo -h (or - host) option was designed to work exclusively with the -l (or - list) option to display a user's sudo privileges for hosts other than the current one. However, due to a programming flaw, this restriction was not properly enforced, allowing the host option to be used when executing commands via sudo…

Jean-Baptiste Lapeyre, on medium.com

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

Likely the code that should have restricted the host option to the list mode did not enforce that restriction, so the host supplied by the user was used when evaluating sudoers rules for command execution.

Impact

A user listed in sudoers for another host could gain root on the current host; environments with host-specific rules, including LDAP-based sudoers, are most at risk, while single-host setups and rules using ALL as the host are less affected.

What the attacker needed

A local user account listed in sudoers; a sudoers rule naming a host other than the current one; affected sudo version 1.8.8 to 1.9.17

The fix

It was fixed in sudo 1.9.17p1, and distributions released patched packages; where patching is not possible, host-specific rules can temporarily be changed to use ALL.

How it was found

  1. Check that sudo refuses to run commands on the current host for the user.
  2. List privileges while specifying a different host, and see that rules for that host apply.
  3. Run a command as root while specifying that other host.

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 commands as the administrator (root). Its rules can say a user is allowed to do this only on a particular machine. Here, a user could tell sudo to pretend they were on a different machine, so rules meant for that other machine were applied and they got root on the machine they were actually using.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.