# CVE-2021-3520: lz4-sys vulnerable to memory corruption via issue in liblz4

> An attacker can cause a crash or out-of-bounds write in applications using the LZ4 library by submitting a crafted file, impacting availability and integrity.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 2 Jun 2021
- **Updated:** 14 Oct 2026
- **Also known as:** ALPINE-CVE-2021-3520, ALSA-2021:2575, AZL-74241, CLSA-2023-1695326199, CLSA-2026-1777307383, CLSA-2026-1792171196, DEBIAN-CVE-2021-3520, DLA-2657-1, DSA-4919-1, GHSA-9q5j-jm53-v7vr, GHSA-gmc7-pqv9-966m, JLSEC-2026-532, MGASA-2021-0229, OESA-2021-1245, RHSA-2021:2575, RLSA-2021:2575, RUSTSEC-2022-0051, SUSE-SU-2021:1647-1, SUSE-SU-2021:1825-1, UBUNTU-CVE-2021-3520, USN-4968-1, USN-4968-2, openSUSE-SU-2021:0760-1, openSUSE-SU-2021:1825-1, openSUSE-SU-2024:11562-1, openSUSE-SU-2024:12902-1

## What is CVE-2021-3520?

CVE-2021-3520 is a critical vulnerability in Netapp Active Iq Unified Manager, published on 2 Jun 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

There's a flaw in lz4. An attacker who submits a crafted file to an application linked with lz4 may be able to trigger an integer overflow, leading to calling of memmove() on a negative size argument, causing an out-of-bounds write and/or a crash. The greatest impact of this flaw is to availability, with some potential impact to confidentiality and integrity as well.

Weakness: CWE-787 (Out-of-bounds Write), CWE-190 (Integer Overflow or Wraparound)

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

3 open source packages ship an affected version, including lz4-sys. It affects 7 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `lz4-sys` | crates.io | All versions | 1.9.4 |
| `lz4-sys` | crates.io | All versions | 1.9.4 |
| `lz4-sys` | crates.io | From 0.0.0-0 | 1.9.4 |
| `lz4` | AlmaLinux:8 | All versions | 1.8.3-3.el8_4 |
| `lz4-devel` | AlmaLinux:8 | All versions | 1.8.3-3.el8_4 |
| `lz4-libs` | AlmaLinux:8 | All versions | 1.8.3-3.el8_4 |
| `lz4` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.8.3-3.el8_4 |
| `lz4-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.8.3-3.el8_4 |
| `lz4-debugsource` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.8.3-3.el8_4 |
| `lz4-devel` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.8.3-3.el8_4 |
| `lz4-libs` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.8.3-3.el8_4 |
| `lz4-libs-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.8.3-3.el8_4 |
| `lz4` | Rocky Linux:8 | All versions | 0:1.8.3-3.el8_4 |
| `lz4` | SUSE:Enterprise Storage 6 | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Linux Enterprise High Performance Computing 15-LTSS | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Linux Enterprise Micro 5.0 | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Linux Enterprise Module for Basesystem 15 SP2 | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 1.9.2-3.3.1 |
| `lz4` | SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Linux Enterprise Server 15-LTSS | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Linux Enterprise Server for SAP Applications 15 | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Manager Proxy 4.0 | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Manager Retail Branch Server 4.0 | All versions | 1.8.0-3.8.1 |
| `lz4` | SUSE:Manager Server 4.0 | All versions | 1.8.0-3.8.1 |
| `lz4` | openSUSE:Leap 15.2 | All versions | 1.8.0-lp152.5.3.1 |
| `lz4-test` | openSUSE:Leap 15.2 | All versions | 1.8.0-lp152.5.3.1 |
| `lz4` | openSUSE:Leap 15.3 | All versions | 1.9.2-3.3.1 |
| `lz4` | openSUSE:Tumbleweed | All versions | 1.9.3-2.1 |

Products: Lz4 Project Lz4, Netapp Active Iq Unified Manager, Netapp Cloud Backup, Netapp Ontap Select Deploy Administration Utility, Oracle Communications Cloud Native Core Policy, Oracle Zfs Storage Appliance Kit, Splunk Universal Forwarder.

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

Upgrade lz4-sys to 1.9.4 or later.

## Is CVE-2021-3520 being exploited?

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

## Other vulnerabilities in Netapp Active Iq Unified Manager

- [CVE-2019-17543](https://insights.sbomify.com/CVE-2019-17543/): Memory corruption in n/a (high 8.1)

## Fix prompt for AI coding agents

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

What it is: CVE-2021-3520 is a critical vulnerability in Netapp Active Iq Unified Manager, published on 2 Jun 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-3520 in the wild and no public exploit code.

Affected packages and fixed versions:
- lz4-sys (crates.io): affected all versions; fixed in 1.9.4
- lz4-sys (crates.io): affected all versions; fixed in 1.9.4
- lz4-sys (crates.io): affected from 0.0.0-0; fixed in 1.9.4

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-3520/ (Markdown: https://insights.sbomify.com/CVE-2021-3520/index.md)
```

## Sources

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

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