What if the program reading /etc/sudoers{.d} has a bug and crashes?
Re:Systemd v228 local root exploit
by jacobmischka on Tuesday January 24, 2017 @01:56PM
(#13474332)
Exactly, like the link says, at least it runs without permissions and is sandboxed.
Then.. sudo has a bug and should be fixed?
But the same can be said about your "authorisation code using JavaScript".
In contrast, /etc/sudoers{.d} config is syntactically validated using a strict grammar so that it can be validated for correctness before being loaded and used (hence visudo). It's primarily a declarative language too which means that logic bugs aren't really possible. This means that there is a robust mechanism to detect syntax issues (and some semantic issues) before breaking your system.