Intel

AIKIDO-2026-102318

sudo-rs is vulnerable to Race Condition (TOCTOU)

Race Condition (TOCTOU)GHSA-f42v-x7gq-phc8 Published 3 days ago

64

Medium Risk

This Affects:

RUSTsudo-rs
0.2.8 - 0.2.14
Fixed in 0.2.15
Are you affected? Scan for Free

TL;DR

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.

Who does this affect?

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.

Background info

sudo-rs is vulnerable to Race Condition (TOCTOU) in versions 0.2.8 - 0.2.14.

How to fix this

Upgrade the sudo-rs library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform