Sudo · Sudo · CVE-2023-22809
**Name of the Vulnerable Software and Affected Versions**
Sudo versions 1.8.0 through 1.9.12p1
**Description**
The issue is related to the sudoedit feature in Sudo, which mishandles extra arguments passed in user-provided environment variables, such as `SUDO EDITOR`, `VISUAL`, and `EDITOR`. This allows a local attacker to append arbitrary entries to the list of files to process, leading to privilege escalation. The problem exists because a user-specified editor may contain a "--" argument that defeats a protection mechanism. For example, an `EDITOR` value like `'vim -- /path/to/extra/file'` can be used to exploit this issue.
**Recommendations**
For versions 1.8.0 through 1.9.12p1, update to a version newer than 1.9.12p2 to resolve the issue. As a temporary workaround, consider restricting the use of the `sudoedit` feature or limiting the environment variables that can be used with it. Additionally, avoid using the `EDITOR` variable with arguments that could defeat the protection mechanism, such as those containing "--".