CVE Identifier: CVE-2026-21452
Vulnerability Title: Unbounded Heap Allocation During EXT32 Deserialization in MessagePack for Java
Affected Software: MessagePack for Java (msgpack-core)
Affected Versions: All versions prior to 0.9.11
Fixed Version: 0.9.11
Vulnerability Class: Denial of Service (Memory Exhaustion)
CVSS v3.1 Summary
- Base Score: 7.5 (High)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Availability Impact: High
- Confidentiality Impact: None
- Integrity Impact: None
Exploitability: High
Exploit Availability: Public proof-of-concept is trivial to construct and does not require advanced tooling.
Executive Summary
CVE-2026-21452 is a denial-of-service vulnerability in MessagePack for Java caused by unvalidated memory allocation when deserializing EXT32 objects. The vulnerability allows a remote attacker to crash Java applications or render services unavailable by supplying a very small but valid .msgpack file that declares an excessively large extension payload size.
The vulnerability is particularly dangerous because the malicious file does not need to be malformed, large, or suspicious in structure. It exploits a logic flaw where the declared payload length is trusted without validation. This makes the vulnerability suitable for exploitation in automated systems, cloud services, CI/CD pipelines, and machine learning model ingestion workflows.
Technical Root Cause Analysis
MessagePack supports extension types (EXT) that allow custom binary payloads. EXT32 is one such extension type that uses a 32-bit integer to represent the payload length.
The vulnerable behavior occurs due to the following design decisions:
- Extension headers are parsed lazily for performance reasons.
- The declared payload length is stored internally without validation.
- When the application later requests the extension data via
ExtensionValue.getData(), the library:- Allocates a byte array using the declared payload length
- Does not enforce a maximum size limit
- Does not validate the declared size against the actual file length
- The JVM attempts to allocate the requested memory immediately.
Because EXT32 supports very large integer values, an attacker can specify payload sizes in the gigabyte range while providing only a few bytes of actual data.
Exploitation Mechanics
Attack Preconditions
- Target application deserializes
.msgpackdata - MessagePack for Java version is below 0.9.11
- Input source is untrusted or attacker-controlled
Exploitation Steps
- The attacker constructs a valid MessagePack file.
- The file contains a single EXT32 object.
- The EXT32 header declares an extremely large payload length.
- The file itself remains very small (often under 20 bytes).
- The target application loads and deserializes the file.
- During extension materialization, the library attempts to allocate memory equal to the declared payload length.
- JVM heap is exhausted, resulting in:
- Immediate OutOfMemoryError
- Forced process termination
- Container OOM kill
- Service crash or restart loop
Reliability
The exploit is deterministic and reliable across JVM versions and platforms, assuming default memory limits.
Impact Analysis
Availability Impact
- Complete service unavailability
- JVM process termination
- Persistent crash loops in containerized environments
- Potential cascading failures in microservice architectures
Operational Impact
- Automated pipelines may halt
- Model deployment workflows may fail
- Inference services may become unreachable
- Continuous restarts may increase infrastructure cost
Security Impact
- No data leakage
- No data corruption
- Pure denial-of-service with high reliability
Real-World Exploitation Scenarios
This vulnerability is especially relevant in environments where MessagePack is used as a model or artifact format:
- Machine learning model registries
- Model inference services
- Artifact storage systems
- CI/CD pipelines validating model files
- Cloud-based ML platforms
- Internal service-to-service communication using MessagePack
Because the malicious file is syntactically valid and extremely small, it can bypass:
- File size checks
- Content-type validation
- Simple static scanning rules
Proof of Concept Status
A proof-of-concept can be created using any MessagePack encoder by crafting an EXT32 object with an oversized declared payload length. The PoC does not require malformed data, race conditions, or special environment configuration.
The exploit works immediately upon deserialization and does not rely on timing or heap grooming.
Detection Strategy
Indicators of Compromise
- Sudden OutOfMemoryError during MessagePack deserialization
- JVM termination shortly after loading
.msgpackfiles - Sharp, unexplained memory allocation spikes
- Garbage collection saturation followed by crash
- Container runtime reporting OOM kills
Relevant Log Sources
- Application logs
- JVM garbage collection logs
- Container runtime logs
- Orchestration platform events
- APM and observability metrics
Detection Rules and Heuristics
Static File Inspection
- Flag MessagePack files containing EXT32 objects with:
- Declared payload lengths exceeding expected thresholds
- Declared payload sizes significantly larger than file size
Runtime Monitoring
- Alert on unusually large byte array allocations
- Monitor memory allocation patterns during deserialization
- Detect repeated crashes tied to artifact loading
Behavioral Detection
- Correlate service crashes with artifact ingestion events
- Identify repeated failures from the same artifact source
Mitigation and Remediation
Immediate Mitigation
- Upgrade MessagePack for Java to version 0.9.11 or later
- Block or restrict untrusted MessagePack artifacts
- Apply strict JVM heap size limits
Defensive Engineering Controls
- Enforce maximum extension payload sizes at application level
- Avoid invoking
ExtensionValue.getData()on untrusted inputs - Use sandboxed or isolated environments for deserialization
- Validate declared payload sizes against expected limits
Official Patch
The issue is fully resolved in MessagePack for Java version 0.9.11, which introduces proper bounds checking when handling EXT payload lengths during deserialization.
Official patch link:
https://github.com/msgpack/msgpack-java/releases/tag/msgpack-0.9.11
Final Assessment
CVE-2026-21452 is a high-severity denial-of-service vulnerability that exploits a trust boundary violation in MessagePack for Java’s EXT32 handling logic. Its ease of exploitation, reliability, and applicability to modern ML and cloud workflows make it a serious operational risk. Prompt patching and strict input validation are essential to prevent service disruption.
