CVE-2021-3520
📋 TL;DR
CVE-2021-3520 is an integer overflow vulnerability in the LZ4 compression library that allows attackers to trigger out-of-bounds writes by submitting crafted files. This can lead to application crashes (availability impact) or potentially arbitrary code execution (confidentiality/integrity impact). Any application or system using vulnerable versions of LZ4 is affected.
💻 Affected Systems
- LZ4 library
- Applications using LZ4 compression
- Red Hat Enterprise Linux
- Oracle products
- NetApp products
📦 What is this software?
Communications Cloud Native Core Policy by Oracle
View all CVEs affecting Communications Cloud Native Core Policy →
Lz4 by Lz4 Project
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise, data theft, or ransomware deployment.
Likely Case
Application crashes causing denial of service, with potential for limited memory corruption.
If Mitigated
Application crashes with no data compromise if proper sandboxing and memory protections are in place.
🎯 Exploit Status
Exploitation requires submitting a crafted LZ4 file to a vulnerable application. No authentication is needed if the application accepts external files.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: LZ4 1.9.3 and later
Vendor Advisory: https://bugzilla.redhat.com/show_bug.cgi?id=1954559
Restart Required: Yes
Instructions:
1. Update LZ4 library to version 1.9.3 or later. 2. Rebuild any statically linked applications. 3. Restart affected services. 4. For OS packages, use your distribution's package manager (yum update lz4, apt upgrade liblz4).
🔧 Temporary Workarounds
Input validation
allImplement strict validation of LZ4 file inputs before processing
Memory protection
linuxEnable ASLR and other memory protection mechanisms
sysctl -w kernel.randomize_va_space=2
🧯 If You Can't Patch
- Isolate vulnerable systems from untrusted networks
- Implement strict file upload controls and scanning for LZ4 files
🔍 How to Verify
Check if Vulnerable:
Check LZ4 library version: lz4 --version or check package version (rpm -q lz4, dpkg -l liblz4)
Check Version:
lz4 --version 2>/dev/null | head -1 || rpm -q lz4 || dpkg -l liblz4* | grep ^ii
Verify Fix Applied:
Confirm LZ4 version is 1.9.3 or higher and test with known malicious LZ4 files
📡 Detection & Monitoring
Log Indicators:
- Application crashes with segmentation faults
- Memory corruption errors in application logs
- Unexpected process termination
Network Indicators:
- Unusual LZ4 file uploads to applications
- Traffic patterns indicating file upload exploitation
SIEM Query:
source="application.logs" AND ("segmentation fault" OR "SIGSEGV" OR "out of bounds")
🔗 References
- https://bugzilla.redhat.com/show_bug.cgi?id=1954559
- https://security.netapp.com/advisory/ntap-20211104-0005/
- https://www.oracle.com//security-alerts/cpujul2021.html
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://www.oracle.com/security-alerts/cpuoct2021.html
- https://bugzilla.redhat.com/show_bug.cgi?id=1954559
- https://security.netapp.com/advisory/ntap-20211104-0005/
- https://www.oracle.com//security-alerts/cpujul2021.html
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://www.oracle.com/security-alerts/cpuoct2021.html