{"slug": "ubuntu-26-04-s-sudo-can-grant-more-than-your-sudoers-file-says-a-free-pre-check", "title": "Ubuntu 26.04's sudo can grant more than your sudoers file says. A free pre-upgrade check", "summary": "Munim, Inc. released sudo-rs-check, a dependency-free Python script that reads a sudoers file and flags lines the sudo-rs parser skips or only partially reads, then reports which remaining rules become wider as a result. The tool targets Ubuntu 26.04 LTS, which ships sudo-rs 0.2.13, where unparseable statements are dropped silently and backslash continuations inside command arguments truncate a command to its binary, granting it with any arguments. The project notes its model of sudo-rs behavior is derived from source and issue trackers and has not yet been validated against real binaries.", "body_md": "*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.*\n\nUbuntu 26.04 LTS ships [sudo-rs](https://github.com/trifectatechfoundation/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.\n\nWhen 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:\n\n```\nHost_Alias  PROD = db1, db2, 10.20.0.0/16\n%devops     ALL, !PROD = (root) ALL\n```\n\nsudo-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`.\n\nWhen 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:\n\n```\ndeploy    ALL = (root) NOPASSWD: /usr/bin/systemctl \\\n          restart myapp.service\n```\n\nis kept as `/usr/bin/systemctl` with any arguments. This was reported in sudo-rs [#1619](https://github.com/trifectatechfoundation/sudo-rs/issues/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](https://github.com/trifectatechfoundation/sudo-rs/issues/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.\n\n[sudo-rs-check](https://github.com/munimtechnologies/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.\n\n```\ncurl -O https://raw.githubusercontent.com/munimtechnologies/sudo-rs-check/main/sudo_rs_check.py\npython3 sudo_rs_check.py /etc/sudoers\n```\n\nOn the continuation example above (abridged; this is real output, and the project's tests check it):\n\n```\nsudo-rs-check 0.2.0 (model of sudo-rs 0.2.13, as in Ubuntu 26.04 LTS)\n1 file(s), 3 statement(s), 0 skipped by sudo-rs, 2 read only in part\n\nRead only in part by sudo-rs\n  examples/continuation-trap.sudoers:2  deploy ALL = (root) NOPASSWD: /usr/bin/systemctl restart myapp.service\n      stops at line 3: a line continuation inside command arguments\n      kept: deploy ALL = (root) NOPASSWD: /usr/bin/systemctl\n...\nWhat that changes\n  WIDENS   examples/continuation-trap.sudoers:2  /usr/bin/systemctl is allowed with any arguments under sudo-rs (written: '/usr/bin/systemctl restart myapp.service')\n```\n\n`--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.\n\nThe 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](https://github.com/munimtechnologies/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](https://peculiarengineer.com/blog/sudo-rs-vs-gnu-sudo-ubuntu-26-04/) and [Frank Chu](https://dev.to/frankchu/11-of-25-sudo-checks-differ-i-ran-ubuntus-rust-sudo-2fj8). Bug reports with a sudoers snippet are welcome as GitHub issues.\n\nThis post and the tool were made with AI agents working for MV2 of Munim, Inc. Apache-2.0.\n\nMV2, Munim, Inc., [mv2@munimtech.com](mailto:mv2@munimtech.com)", "url": "https://wpnews.pro/news/ubuntu-26-04-s-sudo-can-grant-more-than-your-sudoers-file-says-a-free-pre-check", "canonical_source": "https://dev.to/munimv2/ubuntu-2604s-sudo-can-grant-more-than-your-sudoers-file-says-a-free-pre-upgrade-check-3kil", "published_at": "2026-12-03 04:13:06+00:00", "updated_at": "2026-12-03 04:16:46.961561+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools"], "entities": ["Munim, Inc.", "Ubuntu", "sudo-rs", "Trifecta Tech Foundation", "sudo-rs-check", "sudo-policy-diff"], "also_reported_by": [], "takeaway": "On Ubuntu 26.04's sudo-rs 0.2.13, a backslash continuation inside command arguments is kept as the bare binary with any arguments, and dropped aliases like !PROD silently exclude nothing, so run sudo-rs-check on sudoers files before upgrading.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/ubuntu-26-04-s-sudo-can-grant-more-than-your-sudoers-file-says-a-free-pre-check", "markdown": "https://wpnews.pro/news/ubuntu-26-04-s-sudo-can-grant-more-than-your-sudoers-file-says-a-free-pre-check.md", "text": "https://wpnews.pro/news/ubuntu-26-04-s-sudo-can-grant-more-than-your-sudoers-file-says-a-free-pre-check.txt", "jsonld": "https://wpnews.pro/news/ubuntu-26-04-s-sudo-can-grant-more-than-your-sudoers-file-says-a-free-pre-check.jsonld"}}