Ubuntu 26.04's sudo can grant more than your sudoers file says. A free pre-upgrade check
Made with AI agents working for MV2 of Munim, Inc. The tool's model of sudo-rs has not yet been checked against the real binaries; see Limits.
Ubuntu 26.04 LTS ships sudo-rs 0.2.13 as its default sudo. It is a careful rewrite, and most sudoers files mean the same thing under it. Some do not, and two of the differences can make a rule grant more than it did before the upgrade.
1. A skipped line can empty an exclusion
When sudo-rs meets a statement it cannot parse, it prints an error, drops the whole statement and uses the rest of the file. Most write-ups describe the side where you lose access. The other side:
Host_Alias PROD = db1, db2, 10.20.0.0/16 %devops ALL, !PROD = (root) ALL sudo-rs does not accept networks in host lists, so it drops the Host_Alias line. It then skips the undefined alias PROD without a word, so !PROD excludes nothing and %devops is root on production too. visudo -c reports the error on line 1. Nothing tells you that line 2 now means something else. The same happens with a +netgroup in a User_Alias used as !CONTRACTORS, or a Cmnd_Alias with a wildcard inside arguments used as !FIREWALL_OFF.
2. A line read only in part can lose its arguments
When a statement parses but text is left over on the line, sudo-rs prints "garbage at end of line" and keeps the part it read. In 0.2.13, the version in Ubuntu 26.04, a backslash line continuation inside command arguments ends the command:
deploy ALL = (root) NOPASSWD: /usr/bin/systemctl \ restart myapp.service is kept as /usr/bin/systemctl with any arguments. This was reported in sudo-rs #1619, and continuations work from 0.2.14 on. In 0.2.13 and 0.2.14 a tab between arguments does the same (#1669, fixed in 0.2.15). The sudo-rs maintainers treat this as a compatibility issue rather than a vulnerability, because only the administrator writes sudoers and the warning appears every time sudo runs. That is fair. But the warning does not say which grant just got wider.
A check you can run before the upgrade
sudo-rs-check reads a sudoers file (following @include and @includedir) and reports both the lines sudo-rs skips or reads in part and what that does to the rules that remain. It is one Python file with no dependencies, it only reads, and it works on any machine, so you can run it on a config-management repo before any server is upgraded.
curl -O https://raw.githubusercontent.com/munimtechnologies/sudo-rs-check/main/sudo_rs_check.py python3 sudo_rs_check.py /etc/sudoers On the continuation example above (abridged; this is real output, and the project's tests check it):
sudo-rs-check 0.2.0 (model of sudo-rs 0.2.13, as in Ubuntu 26.04 LTS) 1 file(s), 3 statement(s), 0 skipped by sudo-rs, 2 read only in part Read only in part by sudo-rs examples/continuation-trap.sudoers:2 deploy ALL = (root) NOPASSWD: /usr/bin/systemctl restart myapp.service stops at line 3: a line continuation inside command arguments kept: deploy ALL = (root) NOPASSWD: /usr/bin/systemctl ... What that changes WIDENS examples/continuation-trap.sudoers:2 /usr/bin/systemctl is allowed with any arguments under sudo-rs (written: '/usr/bin/systemctl restart myapp.service') --sudo-rs 26.10 (or 0.2.15, main) models the newer versions. On a machine that already has sudo-rs, pass the output of its own visudo -c with --visudo-errors. The tool then takes the real parser's verdicts and only works out the consequences. Exit status 2 means something can grant more under sudo-rs, so it fits in CI.
Limits
The sudo-rs behaviour is a model read from the sudo-rs source and issue tracker. It has not yet been checked against the real binaries; that test is pre-registered in sudo-policy-diff and waiting for compute. No sudo maintainer has reviewed the tool. The [...] difference it also reports was described first by peculiarengineer.com and Frank Chu. Bug reports with a sudoers snippet are welcome as GitHub issues.
This post and the tool were made with AI agents working for MV2 of Munim, Inc. Apache-2.0.
MV2, Munim, Inc., mv2@munimtech.com