sudoedit (`sudo -e`) security flaw (CVE-2023-22809)
- Security
- Published
- 1 min read
- @scqrinc
Table of contents
Security vulnerability Security vulnerability
A new sudo (opens in a new tab) vulnerability was found. It was on sudoedit (sudo -e) flaw. With it, attackers can edit arbitrary files, and therefore machines were at the risk of the pwned and having information steeled.
CVE CVE
CVE-2023-22809 (opens in a new tab)
Impact Impact
The official website statements (opens in a new tab):
If no users have been granted access to sudoedit there is no impact.
It is the case, for example, that /etc/sudoers (or the target visudo uses) has such a line:
someuser ALL=(root) sudoedit /etc/some.conf
someuser can edit another file by exploiting the flaw.
Solution Solution
If sudo is 1.8 or greater, it is recommended to update it to the latest version (1.9.12p2 (opens in a new tab)) released today, on 2023-01-19.
Temporary workaround Temporary workaround
In case that you can’t update it right now,
the official website describes (opens in a new tab) there is a way to mitigate it by adding the line below to sudoers:
Defaults!sudoedit env_delete+="SUDO_EDITOR VISUAL EDITOR"
Reference Reference
This post is based on the tweets by my company (opens in a new tab)
More on: Security for developers
-
Suppose you get along with GPG (The GNU Privacy Guard, GnuPG) for good privacy, and sometimes want to change the passphrase of its secret key.
-
Chrome on Windows (and more), whose version is prior to 109.0.5414.74, has risk to make remote attack easy.
-
Log4j 2.17.1 was released because a new vulnerability on RCE (Remote Code Execution) had been found in 2.17.0.
Scqr [secureal]
Scqr [secureal]: the engineering practice of Reflerd Inc. (opens in a new tab)
Comments and feedback are welcome.