cve.bz

CVE-2021-23240 Link Following

7.8 highExploit referenceEPSS 1.1%Fix available

High (7.8). EPSS 1.1% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

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
EPSS
1.1% (unchanged from 1.1% a week ago; 1.1% 30 days ago) estimated probability of exploitation activity in the next 30 days; 66th percentile. Scored 2026-11-21. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-59 Improper Link Resolution Before File Access (Link Following)
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-23240 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-23240?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-23240?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-23240 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
sudo_project:sudobefore 1.8.32
sudo_project:sudofrom 1.9.0 before 1.9.5
fedoraproject:fedora32
fedoraproject:fedora33

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14sudo1.9.5-1DEBIAN-CVE-2021-23240
UbuntuPro:14.04:LTS, Pro:16.04:LTS, Pro:18.04:LTS and 1 moresudono fix listedUBUNTU-CVE-2021-23240
Red Hatenterprise_linux:8::baseossudo, sudo-debuginfo, sudo-debugsource0:1.8.29-7.el8RHSA-2021:1723
SUSEEnterprise Storage 5, HPE Helion OpenStack 8, Linux Enterprise Server 12 SP3-BCL and 8 moresudo1.8.20p2-3.20.1SUSE-SU-2021:0226-1
SUSEEnterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 12 moresudo1.8.22-4.15.1SUSE-SU-2021:0227-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5, Linux Enterprise Software Development Kit 12 SP5sudo1.8.27-4.6.1SUSE-SU-2021:0225-1
openSUSELeap 15.1sudo1.8.22-lp151.5.12.1openSUSE-SU-2021:0169-1
openSUSELeap 15.2sudo1.8.22-lp152.8.6.1openSUSE-SU-2021:0170-1
openSUSETumbleweedsudo1.9.7p2-1.4openSUSE-SU-2024:11413-1
Rocky Linux8sudo0:1.8.29-7.el8RLSA-2021:1723
Alpinev3.10, v3.11sudo1.9.5p2-r0ALPINE-CVE-2021-23240
Alpinev3.12, v3.13, v3.14 and 10 moresudo1.9.5-r0ALPINE-CVE-2021-23240

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

SELinux enforcing mode is the default and recommended mode of operation in Red Hat Enterprise Linux. Moreover, the symbolic link protection is enabled by default, thus preventing this issue from being exploited. Therefore, this flaw has been rated as having a security impact of Low for Red Hat Enterprise Linux.

Red Hat's mitigation

* 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.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8sudo-0:1.8.29-7.el8Fixed 2021-05-18RHSA-2021:1723
Red Hat Enterprise Linux 5sudoOut of support scope
Red Hat Enterprise Linux 6sudoOut of support scope
Red Hat Enterprise Linux 7sudoOut of support scope
Red Hat Enterprise Linux 9sudoNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-23240.

Attack patterns (CAPEC)

  • CAPEC-17 Using Malicious Files Likelihood: High · Severity: Very High
  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-132 Symlink Attack Likelihood: Low · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON