# CVE-2021-44142: Memory corruption in Samba

> Remote attackers with write access to extended file attributes can execute arbitrary code as root via heap corruption in the Samba vfs_fruit module.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Feb 2022
- **Updated:** 23 Apr 2025
- **Also known as:** ALPINE-CVE-2021-44142, AZL-37008, AZL-8611, CLSA-2022-1643914257, CLSA-2022-1643917481, CLSA-2022-1644501113, DEBIAN-CVE-2021-44142, DSA-5071-1, ECHO-8dd7-1492-d324, GHSA-mpfw-9wp5-hfff, OESA-2022-1524, RHSA-2022:0328, RHSA-2022:0329, RHSA-2022:0330, RHSA-2022:0331, RHSA-2022:0332, RHSA-2022:0457, RHSA-2022:0458, RHSA-2022:0663, RHSA-2022:0664, RLSA-2022:0332, SUSE-SU-2022:0251-1, SUSE-SU-2022:0252-1, SUSE-SU-2022:0271-1, SUSE-SU-2022:0284-1, SUSE-SU-2022:0287-1, UBUNTU-CVE-2021-44142, USN-5260-2, USN-5260-3

## What is CVE-2021-44142?

CVE-2021-44142 is a high-severity memory corruption vulnerability in Canonical Ubuntu Linux, published on 21 Feb 2022. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

The Samba vfs_fruit module uses extended file attributes (EA, xattr) to provide "...enhanced compatibility with Apple SMB clients and interoperability with a Netatalk 3 AFP fileserver." Samba versions prior to 4.13.17, 4.14.12 and 4.15.5 with vfs_fruit configured allow out-of-bounds heap read and write via specially crafted extended file attributes. A remote attacker with write access to extended file attributes can execute arbitrary code with the privileges of smbd, typically root.

Weakness: CWE-787 (Out-of-bounds Write), CWE-125 (Out-of-bounds Read)

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

It affects 23 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libsmbclient` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `libsmbclient-devel` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `libwbclient` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `libwbclient-devel` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-client` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-client-libs` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-common` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-common-libs` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-common-tools` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-dc` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-dc-libs` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-debuginfo` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-devel` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-krb5-printing` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-libs` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-pidl` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-python` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-python-test` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-test` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-test-libs` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-vfs-glusterfs` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-winbind` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-winbind-clients` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-winbind-krb5-locator` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `samba-winbind-modules` | Red Hat:enterprise_linux:7::client | All versions | 0:4.10.16-18.el7_9 |
| `libsmbclient-devel` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `libwbclient-devel` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba-dc` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba-dc-libs` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba-debuginfo` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba-devel` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba-krb5-printing` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba-pidl` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba-python` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba-python-test` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba-test` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba-test-libs` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |
| `samba-vfs-glusterfs` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.10.16-18.el7_9 |

Products: Canonical Ubuntu Linux, Debian Debian Linux, Fedoraproject Fedora, Redhat Codeready Linux Builder, Redhat Enterprise Linux, Redhat Enterprise Linux Desktop, Redhat Enterprise Linux Eus, Redhat Enterprise Linux for Ibm Z Systems, Redhat Enterprise Linux for Ibm Z Systems Eus, Redhat Enterprise Linux for Power Big Endian, Redhat Enterprise Linux for Power Little Endian, Redhat Enterprise Linux for Power Little Endian Eus, Redhat Enterprise Linux for Scientific Computing, Redhat Enterprise Linux Resilient Storage, Redhat Enterprise Linux Server, Redhat Enterprise Linux Server Aus, Redhat Enterprise Linux Server Tus, Redhat Enterprise Linux Server Update Services for Sap Solutions, Redhat Enterprise Linux Workstation, Redhat Gluster Storage and 3 more.

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

Upgrade to a fixed version.

## Is CVE-2021-44142 being exploited?

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

Public exploit code:

- https://github.com/horizon3ai/CVE-2021-44142 (github_poc): https://github.com/horizon3ai/CVE-2021-44142
- CVE-2021-44142 vulnerable lab (github_poc): https://github.com/Nxvh1337/CVE-2021-44142-vulnerable-lab
- https://github.com/gudyrmik/CVE-2021-44142 (github_poc): https://github.com/gudyrmik/CVE-2021-44142
- https://github.com/hrsman/Samba-CVE-2021-44142 (github_poc): https://github.com/hrsman/Samba-CVE-2021-44142

## Other vulnerabilities in Canonical Ubuntu Linux

- [CVE-2020-11651](https://insights.sbomify.com/CVE-2020-11651/): SaltStack Salt Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2020-7247](https://insights.sbomify.com/CVE-2020-7247/): OpenSMTPD Remote Code Execution (critical 9.8, exploited in the wild)
- [CVE-2019-16928](https://insights.sbomify.com/CVE-2019-16928/): Exim Out-of-bounds Write (critical 9.8, exploited in the wild)
- [CVE-2018-6789](https://insights.sbomify.com/CVE-2018-6789/): Exim Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2015-2590](https://insights.sbomify.com/CVE-2015-2590/): Oracle Java SE and Java SE Embedded Remote Code Execution (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

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

What it is: CVE-2021-44142 is a high-severity memory corruption vulnerability in Canonical Ubuntu Linux, published on 21 Feb 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-44142 in the wild and no public exploit code.

Affected product: Canonical Ubuntu Linux. 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-44142/ (Markdown: https://insights.sbomify.com/CVE-2021-44142/index.md)
```

## Sources

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

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