Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. sudo-rs
  4. ›
  5. CVE-2023-42456

CVE-2023-42456: sudo-rs Session File Relative Path Traversal vulnerability

September 21, 2023 (updated June 10, 2026)

An issue was discovered where usernames containing the . and / characters could result in the corruption of specific files on the filesystem. On some operating systems usernames are not limited as to the characters they can contain, so a username appearing to be a relative path can be constructed. For example we could add a user to the system containing the username ../../../../bin/cp. When logged in as a user with that name, that user could run sudo -K to clear their session record file. The session code then constructs the path to the session file by concatenating the username to the session file storage directory, resulting in a resolved path of /bin/cp. The code then clears that file, resulting in the cp binary effectively being removed from the system.

An attacker needs to be able to login as a user with a constructed username. Given that such a username is unlikely to exist on an existing system, they will also need to be able to create the users with the constructed usernames.

References

  • ferrous-systems.com/blog/sudo-rs-audit
  • github.com/advisories/GHSA-2r3c-m6v7-9354
  • github.com/memorysafety/sudo-rs/commit/bfdbda22968e3de43fa8246cab1681cfd5d5493d
  • github.com/memorysafety/sudo-rs/security/advisories/GHSA-2r3c-m6v7-9354
  • github.com/trifectatechfoundation/sudo-rs/security/advisories/GHSA-2r3c-m6v7-9354
  • nvd.nist.gov/vuln/detail/CVE-2023-42456
  • rustsec.org/advisories/RUSTSEC-2023-0069.html

Code Behaviors & Features

Detect and mitigate CVE-2023-42456 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 0.2.1

Fixed versions

  • 0.2.1

Solution

Upgrade to version 0.2.1 or above.

Impact 3.3 LOW

CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:L/A:L

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-23: Relative Path Traversal

Source file

cargo/sudo-rs/CVE-2023-42456.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:41 +0000.