# CVE-2021-23240: selinuxeditcopytfiles in sudoedit in Sudo before 1.9.5 allows a local unprivileged user to gain file ownership and escalate privileges by r…

- Severity: High 7.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.08%, higher than 66% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-01-12T08:17:44.000Z
- Modified: 2026-06-17T03:38:27.890Z
- Weaknesses: CWE-59
- Assigned by: mitre

## Description

selinux_edit_copy_tfiles in sudoedit in Sudo before 1.9.5 allows a local unprivileged user to gain file ownership and escalate privileges by replacing a temporary file with a symlink to an arbitrary file target. This affects SELinux RBAC support in permissive mode. Machines without SELinux are not vulnerable.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- sudo_project sudo: before 1.8.32; from 1.9.0 before 1.9.5
- netapp hci_management_node: no versions given
- netapp solidfire: no versions given
- fedoraproject fedora: 32; 33

## Every score

- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 4.4 Medium `AV:L/AC:M/Au:N/C:P/I:P/A:P`

## References

- <https://bugzilla.suse.com/show_bug.cgi?id=CVE-2021-23240> (exploit, issue-tracking, patch, third-party-advisory)
- <https://www.sudo.ws/stable.html#1.9.5> (release-notes, vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/EE42Y35SMJOLONAIBNYNFC7J44UUZ2Y6/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GMY4VSSBIND7VAYSN6T7XIWJRWG4GBB3/> (vendor-advisory)
- <https://security.gentoo.org/glsa/202101-33> (third-party-advisory, vendor-advisory)
- <https://security.netapp.com/advisory/ntap-20210129-0010/> (third-party-advisory)
- <https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3E> (mailing-list)
- <https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3E> (mailing-list)

## Sources

- CVE List: [CVE-2021-23240](https://www.cve.org/CVERecord?id=CVE-2021-23240), CVE Terms of Use, modified 2024-08-03
- NVD: [CVE-2021-23240](https://nvd.nist.gov/vuln/detail/CVE-2021-23240), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-23240 · Whole record: https://cve.day/CVE-2021-23240.json · Rebuilt by cve.day 2026-11-25T22:57:59.187Z
