sudo-rs is vulnerable to Race Condition (TOCTOU)
64
Medium Risk
sudo-rs resolves the file paths passed to sudoedit through a lazily evaluated iterator that is consumed twice, so each argument is canonicalized once when it is checked against the sudoers policy and again when the file is opened. A local user who is permitted to edit a specific file can replace a path component with a symbolic link in the window between these two resolutions, so the location validated against the policy differs from the location actually opened. This time-of-check to time-of-use gap lets the edit be redirected to an arbitrary path such as a file under /etc/sudoers.d, which can be leveraged for local privilege escalation. The fix collects the resolved paths into a vector so canonicalization runs once and the checked path is the one that is opened.
You are affected if you are using a version that falls within the vulnerable range and your /etc/sudoers grants a user sudoedit access to specific file paths.
sudo-rs is vulnerable to Race Condition (TOCTOU) in versions 0.2.8 - 0.2.14.
Upgrade the sudo-rs library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.