Skip to main content
No exploitation reportedFix available

CVE-2021-23240

No exploitation reported by the sources we read.

  • Published2021-01-12
  • WeaknessCWE-59

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2021-01-1209:15CVE publishedNVD

Versions per branch

NVD
Fedoraproject fedora
BranchAffectedFixed in
32.x= 32no fix published
33.x= 33no fix published
Sudo project sudo
BranchAffectedFixed in
1.9≥ 1.9.0, < 1.9.51.9.5
1.8< 1.8.321.8.32
Netapp hci management node
BranchAffectedFixed in
—all versionsno fix published

1 more product in the sources.

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • sudoUbuntu:Pro:20.04:LTSall versions · no fixed version listed
  • sudoUbuntu:Pro:18.04:LTSall versions · no fixed version listed
  • sudoUbuntu:Pro:16.04:LTSall versions · no fixed version listed
  • sudoUbuntu:Pro:14.04:LTSall versions · no fixed version listed
  • sudoTuxCare:Ubuntu:18.04all versions · fixed in 1.8.21p2-3ubuntu1.6+tuxcare.els1and 1 other package
  • sudoTuxCare:Ubuntu:16.04all versions · fixed in 1.8.16-0ubuntu1.11and 1 other package
  • sudoTuxCare:RHEL:7all versions · fixed in 1.8.23-10.0.3.el7_9.3.tuxcare.els1and 1 other package
  • sudoTuxCare:OracleLinux:7all versions · fixed in 1.8.23-10.0.3.el7_9.3.tuxcare.els1and 1 other package

60 more package ranges on OSV.dev

Vendor advisories

  • CVE-2021-23240 Red Hat Product Security13 products fixed · 7 known affected

    sudo: symbolic link attack in SELinux-enabled sudoedit

    sudo.src as a component of Red Hat Enterprise Linux 5 · sudo as a component of Red Hat Enterprise Linux 6 · sudo-devel as a component of Red Hat Enterprise Linux 6 · +4 more

  • RHSA-2021:1723 Red Hat Product Security13 products fixed

    Red Hat Security Advisory: sudo security and bug fix update

Full record on NVD

Fix

  1. Vendor fix Red Hat Product Security RHSA-2021:1723 · 13 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
  2. Workaround from the vendor Red Hat Product Security RHSA-2021:1723 · 13 products* Enable SELinux in enforcing mode. * Enable the symbolic link protection (/proc/sys/fs/protected_symlinks set to 1). * Remove the `sesh` binary (/usr/libexec/sudo/sesh or /usr/lib/sudo/sesh) if SELinux RBAC support is not needed.
  3. No fix planned, says the vendor Red Hat Product Security CVE-2021-23240 · 7 productsOut of support scope

Advisories and patches

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Published
2021-01-12
Last Modified
2026-06-17
NVD status
Modified
GitHub Advisory
GHSA-q7hf-7qcc-gmg8

Frequently asked questions

What is CVE-2021-23240?

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.

Is CVE-2021-23240 actively exploited?

Active exploitation of CVE-2021-23240 has not been confirmed. Its EPSS score was 1.1% on 2026-11-18, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2021-23240?

CVE-2021-23240 has a CVSS v3 base score of 7.8 (HIGH severity), with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.

Running sudo? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record