# CVE-2021-43566: Race condition in n/a

> A race condition in Samba allows malicious clients to create directories outside exported shares if SMB1 or NFS is enabled.

- **Severity:** Low 2.5 (`CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 11 Jan 2022
- **Updated:** 4 Aug 2024
- **Also known as:** ALPINE-CVE-2021-43566, AZL-37006, AZL-7489, CLSA-2026-1780064574, CLSA-2026-1780070780, CLSA-2026-1780134251, DEBIAN-CVE-2021-43566, ECHO-d69c-9803-2415, GHSA-rcx2-p86p-53w9, OESA-2022-1507, RHBA-2021:4438, UBUNTU-CVE-2021-43566

## What is CVE-2021-43566?

CVE-2021-43566 is a low-severity vulnerability in Samba Samba, published on 11 Jan 2022. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

All versions of Samba prior to 4.13.16 are vulnerable to a malicious client using an SMB1 or NFS race to allow a directory to be created in an area of the server file system not exported under the share definition. Note that SMB1 has to be enabled, or the share also available via NFS in order for this attack to succeed.

Weakness: CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization)

## Which versions are affected by CVE-2021-43566?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ctdb-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `libsmbclient-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `libwbclient-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `python3-samba-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-client-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-client-libs-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-common-libs-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-common-tools-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-krb5-printing-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-libs-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-test-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-test-libs-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-vfs-iouring` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-vfs-iouring-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-winbind-clients-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-winbind-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-winbind-krb5-locator-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-winbind-modules-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `samba-winexe-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.5-2.el8 |
| `ctdb` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `ctdb-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `libsmbclient` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `libsmbclient-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `libwbclient` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `libwbclient-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `python3-samba` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `python3-samba-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `python3-samba-test` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `samba` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `samba-client` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `samba-client-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `samba-client-libs` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `samba-client-libs-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `samba-common` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `samba-common-libs` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `samba-common-libs-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `samba-common-tools` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |
| `samba-common-tools-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.5-2.el8 |

Products: Samba Samba.

## How do I fix CVE-2021-43566?

Upgrade to a fixed version.

## Is CVE-2021-43566 being exploited?

There is no known exploitation of CVE-2021-43566 in the wild and no public exploit code.

## Other vulnerabilities in Samba Samba

- [CVE-2012-1182](https://insights.sbomify.com/CVE-2012-1182/): Integer overflow in n/a (critical 10.0)
- [CVE-2007-2446](https://insights.sbomify.com/CVE-2007-2446/): Memory corruption in n/a (critical 10.0)
- [CVE-2004-0600](https://insights.sbomify.com/CVE-2004-0600/): Memory corruption in n/a (critical 10.0)
- [CVE-1999-0810](https://insights.sbomify.com/CVE-1999-0810/): Denial of service in n/a (critical 10.0)
- [CVE-1999-0182](https://insights.sbomify.com/CVE-1999-0182/): Memory corruption in n/a (critical 10.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-43566 and fix it if it is affected.

What it is: CVE-2021-43566 is a low-severity vulnerability in Samba Samba, published on 11 Jan 2022. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-43566 in the wild and no public exploit code.

Affected product: Samba Samba. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-43566/ (Markdown: https://insights.sbomify.com/CVE-2021-43566/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-43566
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-43566
- OSV: https://osv.dev/vulnerability/CVE-2021-43566

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-43566/
Summaries are generated and may contain mistakes; the official description above is the record.
