CVE-2021-37136

7.5 HIGH

📋 TL;DR

CVE-2021-37136 is a denial-of-service vulnerability in Netty's Bzip2Decoder that allows attackers to trigger out-of-memory errors by sending specially crafted Bzip2 compressed data. The vulnerability affects all users of Netty's Bzip2Decoder component. Attackers can cause service disruption by exhausting system memory through uncontrolled decompression.

💻 Affected Systems

Products:
  • Netty
  • Apache Druid (uses Netty)
  • Other applications using Netty's Bzip2Decoder
Versions: Netty versions 4.1.0 through 4.1.65.Final
Operating Systems: All operating systems running affected Netty versions
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using Netty's Bzip2Decoder without custom size restrictions is vulnerable. Apache Druid versions before 0.22.0 are affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service outage due to out-of-memory conditions causing application crashes and system instability.

🟠

Likely Case

Service disruption and degraded performance as systems struggle with memory exhaustion from malicious decompression requests.

🟢

If Mitigated

Controlled memory usage with proper input validation and size restrictions preventing successful exploitation.

🌐 Internet-Facing: HIGH - Attackers can send malicious payloads directly to exposed services using Bzip2 decompression.
🏢 Internal Only: MEDIUM - Internal attackers or compromised systems could exploit this, but requires access to services using vulnerable Netty components.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending specially crafted Bzip2 data to vulnerable endpoints. The vulnerability is well-documented in public advisories.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Netty 4.1.66.Final and later

Vendor Advisory: https://github.com/netty/netty/security/advisories/GHSA-grg4-wf29-r9vv

Restart Required: Yes

Instructions:

1. Update Netty dependency to version 4.1.66.Final or later. 2. For Apache Druid, update to version 0.22.0 or later. 3. Rebuild and redeploy affected applications. 4. Restart services using the updated libraries.

🔧 Temporary Workarounds

Implement custom decompression size limits

all

Add size restrictions to Bzip2Decoder usage in application code

// Java example: new Bzip2Decoder(maxLength)

Disable Bzip2 decompression

all

Remove or disable Bzip2Decoder usage if not required

Remove Bzip2Decoder from pipeline configuration

🧯 If You Can't Patch

  • Implement network-level controls to filter or limit Bzip2 compressed data
  • Deploy memory monitoring and alerting to detect out-of-memory conditions

🔍 How to Verify

Check if Vulnerable:

Check Netty version in dependencies: grep -r 'netty.*4\.1\.[0-6][0-5]' pom.xml build.gradle

Check Version:

java -cp netty-all-*.jar io.netty.util.Version

Verify Fix Applied:

Verify Netty version is 4.1.66.Final or later: mvn dependency:tree | grep netty

📡 Detection & Monitoring

Log Indicators:

  • OutOfMemoryError in application logs
  • High memory usage spikes
  • Application crashes during decompression

Network Indicators:

  • Unusually large Bzip2 compressed payloads
  • Multiple decompression requests to vulnerable endpoints

SIEM Query:

source="application.logs" AND ("OutOfMemoryError" OR "java.lang.OutOfMemoryError") AND process="*netty*"

🔗 References

📤 Share & Export