cve.bz

CVE-2021-20316 Race Condition

6.8 mediumEPSS 1.1%

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

On this page
A flaw was found in the way Samba handled file/directory metadata. This flaw allows an authenticated attacker with permissions to read or modify share metadata, to perform this operation outside of the share.

Severity

CVSS 3.1

6.8 medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
EPSS
1.1% (unchanged from 1.1% a week ago; 1.0% 30 days ago) estimated probability of exploitation activity in the next 30 days; 67th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization (Race Condition)
OWASP Top 10
A06:2025 Insecure Design
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-20316 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-20316?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-20316?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-20316 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
samba:sambabefore 4.15.0
debian:debian_linux10.0
debian:debian_linux11.0
redhat:virtualization_host4.0
redhat:enterprise_linux8.0
redhat:enterprise_linux_aus8.6
redhat:enterprise_linux_eus8.6
redhat:enterprise_linux_tus8.6

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14samba2:4.16.0+dfsg-2DEBIAN-CVE-2021-20316
Ubuntu22.04:LTS, Pro:14.04:LTS, Pro:16.04:LTS and 2 moresambano fix listedUBUNTU-CVE-2021-20316
Red Hatenterprise_linux:8::appstreamctdb-debuginfo, samba-debuginfo, samba-debugsource and 18 more0:4.15.5-5.el8RHSA-2022:2074
Red Hatenterprise_linux:8::baseosctdb, samba, samba-libs and 38 more0:4.15.5-5.el8RHSA-2022:2074
Red Hatenterprise_linux:8::crbsamba-devel, ctdb-debuginfo, samba-debuginfo and 20 more0:4.15.5-5.el8RHSA-2022:2074
Red Hatstorage:3.5:samba:el8ctdb, samba, samba-libs and 39 more0:4.15.5-100.el8rhgsRHSA-2022:1756
SUSELinux Enterprise High Availability Extension 12 SP5, Linux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5 and 1 moresamba4.15.4+git.324.8332acf1a63-3.54.1SUSE-SU-2022:0323-1
SUSELinux Enterprise High Availability Extension 15 SP3, Linux Enterprise Module for Basesystem 15 SP3, Linux Enterprise Module for Python 2 15 SP3samba4.15.4+git.324.8332acf1a63-150300.3.25.3SUSE-SU-2022:0283-1
SUSELinux Enterprise Micro 5.1, Linux Enterprise Module for Basesystem 15 SP3ldb2.4.1-150300.3.10.1SUSE-SU-2022:0283-1
SUSELinux Enterprise Micro 5.1, Linux Enterprise Module for Basesystem 15 SP3libapparmor2.13.6-150300.3.11.1SUSE-SU-2022:0283-1
SUSELinux Enterprise Micro 5.1, Linux Enterprise Module for Basesystem 15 SP3sssd1.16.1-150300.23.17.3SUSE-SU-2022:0283-1
SUSELinux Enterprise Micro 5.1, Linux Enterprise Module for Basesystem 15 SP3talloc2.3.3-150300.3.3.2SUSE-SU-2022:0283-1
SUSELinux Enterprise Micro 5.1, Linux Enterprise Module for Basesystem 15 SP3tdb1.4.4-150300.3.3.2SUSE-SU-2022:0283-1
SUSELinux Enterprise Micro 5.1, Linux Enterprise Module for Basesystem 15 SP3tevent0.11.0-150300.3.3.2SUSE-SU-2022:0283-1
SUSELinux Enterprise Micro 5.1, Linux Enterprise Module for Basesystem 15 SP3, Linux Enterprise Module for Server Applications 15 SP3apparmor2.13.6-150300.3.11.2SUSE-SU-2022:0283-1
SUSELinux Enterprise Micro 5.1, Linux Enterprise Module for Basesystem 15 SP3, Linux Enterprise Module for Server Applications 15 SP3krb51.19.2-150300.8.3.2SUSE-SU-2022:0283-1
SUSELinux Enterprise Module for Basesystem 15 SP3talloc-man2.3.3-150300.3.3.1SUSE-SU-2022:0283-1
SUSELinux Enterprise Module for Basesystem 15 SP3tevent-man0.11.0-150300.3.3.1SUSE-SU-2022:0283-1
7 more for SUSE in the JSON and on SUSE's page.
openSUSELeap 15.3apparmor2.13.6-150300.3.11.2openSUSE-SU-2022:0283-1
openSUSELeap 15.3krb5, krb5-mini1.19.2-150300.8.3.2openSUSE-SU-2022:0283-1
openSUSELeap 15.3ldb2.4.1-150300.3.10.1openSUSE-SU-2022:0283-1
openSUSELeap 15.3libapparmor2.13.6-150300.3.11.1openSUSE-SU-2022:0283-1
openSUSELeap 15.3samba4.15.4+git.324.8332acf1a63-150300.3.25.3openSUSE-SU-2022:0283-1
openSUSELeap 15.3sssd1.16.1-150300.23.17.3openSUSE-SU-2022:0283-1
openSUSELeap 15.3talloc2.3.3-150300.3.3.2openSUSE-SU-2022:0283-1
openSUSELeap 15.3talloc-man2.3.3-150300.3.3.1openSUSE-SU-2022:0283-1
openSUSELeap 15.3tdb1.4.4-150300.3.3.2openSUSE-SU-2022:0283-1
openSUSELeap 15.3tevent0.11.0-150300.3.3.2openSUSE-SU-2022:0283-1
openSUSELeap 15.3tevent-man0.11.0-150300.3.3.1openSUSE-SU-2022:0283-1
AlmaLinux8ctdb, samba, samba-libs and 22 more4.15.5-5.el8ALSA-2022:2074
AlmaLinux8libwbclient-devel4.15.5-8.el8_6ALSA-2022:2074
Rocky Linux8samba0:4.15.5-5.el8RLSA-2022:2074
Azure Linux2sambano fix listedAZL-10652
Azure Linux3samba4.18.3-1AZL-37001

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; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

As per upstream, "Prior to Samba 4.15.0, patches for this are not possible due to the prior design of the Samba VFS layer, which used pathname-based calls for most meta-data operations.

A two and a half year effort was undertaken to completely re-write the Samba VFS layer to stop the use of pathname-based calls in all cases involving reading and writing of metadata returned to the client. This work has finally been completed in Samba 4.15.0."

Red Hat's mitigation

Do not enable SMB1 (please note SMB1 is disabled by default in Samba from version 4.11.0 and onwards). This prevents the creation of symbolic links via SMB1. If SMB1 must be enabled for backward compatibility then add the parameter:

unix extensions = no

to the [global] section of your smb.conf and restart smbd. This prevents SMB1 clients from creating symlinks on the exported file system.

However, if the same region of the file system is also exported using NFS, NFS clients can create symlinks that potentially can also hit the race condition. For non-patched versions of Samba, we recommend only exporting areas of the file system by either SMB2 or NFS, not both.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8samba-0:4.15.5-5.el8Fixed 2022-05-10RHSA-2022:2074
Red Hat Gluster Storage 3.5 for RHEL 8samba-0:4.15.5-100.el8rhgsFixed 2022-05-10RHSA-2022:1756
Red Hat Enterprise Linux 6sambaOut of support scope
Red Hat Enterprise Linux 6samba4Out of support scope
Red Hat Enterprise Linux 7sambaOut of support scope
Red Hat Enterprise Linux 9sambaNot 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-20316.

Attack patterns (CAPEC)

  • CAPEC-26 Leveraging Race Conditions Likelihood: High · Severity: High
  • CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions Likelihood: High · Severity: High

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

References

Check your stackJSON