Exploited now
Vulnerability WatchVulnerabilities, exploits & advisories — updated every 15 minutes
Alerts

Home › CVE › Java

CVE-2026-126366 — msgpack-ruby JRuby decoder makes uncapped header-count allocations; a 5-byte message forces multi-GiB OOM

High · CVSS 7.5EPSS 0.6% First seen November 12, 2026
JavaRubyLinuxWebOperating systemsCloud & containers

Research article

msgpack-ruby JRuby decoder: header-declared sizes drive uncapped allocation and memory exhaustion (CVE-2026-126366)

CVECVE-2026-126366
Vendor and productrubygems:msgpack; msgpack msgpack-ruby
PublishedNovember 21, 2026 08:50 UTC
Research cut-offNovember 21, 2026 08:45 UTC
Sources reviewed4: NVD record (last modified 2026-11-13); CISA KEV catalog; GitHub advisory (2026-11-12); FIRST EPSS (2026-11-20)

Executive summary

CVE-2026-126366 is a resource-exhaustion flaw in the pure Java msgpack decoder shipped in the java-platform build of the msgpack-ruby gem under JRuby, where array and byte-buffer sizes declared in a message header are allocated before the data arrives [1, 3]. The CVSS 3.1 score is 7.5 (High) with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, but the advisory describes that score as the reporter's proposal, so the scoring provenance is inconsistent across sources [1, 3]. The NVD record lists versions below 1.8.7 as affected, while the advisory lists 1.8.6 and earlier, and the reporter states the released 1.8.6 java build is unfixed [1, 3]. Exploitation requires a JRuby application that passes untrusted msgpack data to the unpacking methods, and the reporter states no authentication or user interaction is needed; the stated impact is availability only, such as out-of-memory errors or destabilisation of a shared JVM [3]. No in-the-wild exploitation or public exploit is reported, the issue is absent from the CISA KEV catalog as of 2026-11-21, and the FIRST EPSS estimate is 0.0053 for 30 days, which is a statistical estimate rather than evidence of exploitation [2, 3, 4]. The most important immediate action is to identify JRuby hosts running the java-platform msgpack gem that decode untrusted input, stop decoding that input on the java build, and upgrade to msgpack 1.8.7 only after confirming the fix is present in the java build [1, 3].

Key points

  • CVE-2026-126366 is an availability flaw in the pure Java msgpack decoder of the msgpack-ruby java-platform build under JRuby, where header-declared sizes trigger allocation before data arrives [1, 3].
  • CVSS 3.1 7.5 High, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H; the advisory calls this the reporter's proposed scoring, so provenance is inconsistent [1, 3].
  • Affected range is listed as less than 1.8.7 in NVD and up to and including 1.8.6 in the advisory; 1.8.7 is the listed fixed version, but the reporter says the released 1.8.6 java build is unfixed [1, 3].
  • No confidentiality, integrity or code execution impact is reported; the reported impact is memory exhaustion and possible destabilisation of a shared JVM [3].
  • No in-the-wild exploitation or public exploit is reported; the issue is not in CISA KEV as of 2026-11-21, and the EPSS estimate is 0.0053 [2, 3, 4].

Vulnerability identification

FieldValue
CVE IDCVE-2026-126366 [1]
Vendor / productmsgpack / msgpack-ruby [1]
ComponentPure Java msgpack decoder in the java-platform build of the gem, used under JRuby [3]
Tested platformJRuby 9.4.12.0, OpenJDK 25.0.4.1, Linux x86-64 [3]
Published / last modified (NVD)2026-11-13 00:20:12 / 2026-11-13 23:17:16 [1]
Record statusReceived, meaning the NVD record is not yet analyzed [1]
CWECWE-770 Allocation of Resources Without Limits or Throttling; CWE-1325 Improperly Controlled Sequential Memory Allocation [1, 3]
CVSS 3.1 base score7.5 High; vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H; NVD lists GitHub as secondary scorer [1]
CVSS provenanceThe GitHub advisory lists the same score and vector as GitHub-scored, yet its text calls the 7.5 score the reporter's own proposal, not an official score [3]
Related identifiersGHSA-73v3-wf97-vpgj [1, 3]; release tags v1.8.6 and v1.8.7 [1]; commit c8d42d8 for the C-implementation buffered-bytes cap [3]
EPSS0.0053 (0.53%), percentile 0.4554, dated 2026-11-20 [4]
CISA KEVNot listed as of 2026-11-21 [2]

The CWE-770 class covers software that reserves resources without any upper limit or throttle. CWE-1325 covers memory allocation sequences that are not properly controlled. The advisory itself states that it was published before a CVE had been assigned [3].

Vulnerability description

The flaw affects availability. The Java decoder can be made to reserve large amounts of heap memory based on a size value in a message header, before the corresponding elements or bytes have been received [3]. The reported consequences are Java OutOfMemoryError conditions or destabilisation of a shared JVM [3]. The reporter describes the cost as unbounded allocation rather than a memory leak, though one test observed heap usage that persisted after unpacker reset and garbage collection [3].

The conditions that matter are a JRuby application that passes untrusted msgpack data to the unpacking methods, and no authentication or user interaction according to the reporter [3]. The reporter states no confidentiality, integrity or code execution impact [3]. Those statements are not verified by any other source in the pack, so they should be treated as the reporter's findings.

Root cause analysis

Reported, from the advisory's technical analysis: the Java decoder sizes arrays, and byte buffers for strings and binaries, from the declared count or length in the header before the data has been received [3]. The C implementation of the same gem has a per-container size cap since 1.7.3 and a buffered-bytes cap in 1.8.6, whereas the Java decoder has neither [3].

Analyst assessment: the decoder appears to treat header metadata as a trusted allocation budget. Its only bound on declared counts is the rejection of values with the top bit set, so declared counts between the available heap size and 2^31 pass unbounded [3]. Existing hardening in the C path therefore did not carry over to the Java path, which is the most likely reason the control failed. No vendor analysis in the pack confirms this root cause.

Technical mechanics

  1. The application hands a msgpack byte sequence to the unpacker running under JRuby on the Java platform.
  2. The decoder reads the type marker and the declared count or length from the header.
  3. For an array32 header, the decoder sizes the array from the declared count before any elements arrive [3].
  4. For str32 and bin32 headers, the decoder sizes the byte buffer from the declared length before the bytes arrive [3].
  5. If the requested size exceeds the VM array limit, the JVM raises an OutOfMemoryError citing the array size limit. If the size is within that limit but larger than the heap, the JVM attempts the real allocation and raises a heap space OutOfMemoryError [3].
  6. The missing control is a cap relative to bytes actually received, as the C implementation applies [3]. The advisory states that map32 headers do not pre-allocate and did not reproduce the issue [3].

The reporter's proposed fix caps initial allocation by bytes received, grows containers as elements arrive, and reads strings and binaries in bounded chunks; the advisory does not state that this fix has been released [3].

Attack surface and exploitation prerequisites

FactorStatusSource
Network accessReachable where the application decodes msgpack from network input. The advisory describes the prerequisite as an application feeding untrusted data, not a specific network service[3]
Adjacent, local or physical accessNot stated[1, 3]
AuthenticationReporter states none is needed[3]
User interactionReporter states none is needed[3]
RuntimeJRuby with the java-platform msgpack gem; CRuby is not affected per the advisory's Fluentd statement[3]
Heap sizeReporter's tests used a 512 MiB heap for one reproduction; behaviour on production heap sizes is not established[3]
Privileges requiredReporter states none, consistent with the PR:N vector component[1, 3]

The vector components AV:N, AC:L, PR:N and UI:N reflect the scorer's assessment and do not confirm that a given application is reachable. Whether a specific application decodes attacker-controlled msgpack is a question for its own code review. The advisory states that Fluentd is not affected because it ships only with CRuby, and that no Fluentd advisory should cover this issue [3].

Impact analysis

Security propertyTechnically demonstrated (per reporter)Plausible downstream consequence (analyst assessment)
ConfidentialityNone reported [3]None expected from this flaw alone
IntegrityNone reported [3]None expected from this flaw alone
AvailabilityMemory exhaustion, OutOfMemoryError, destabilisation of a shared JVM [3]Outage or degradation of other workloads sharing the same JVM
Authentication and authorizationNo impact reported [3]None identified
Privilege boundariesNot statedA shared JVM can mean one input path affects other tenants or components in the same process
Data and privacyNone reported [3]Not established
Regulatory or contractualNot established by the sourcesDepends on service-level commitments of the affected service

Affected products and versions

VendorProduct / componentAffected versionsPlatformFixed versionSource and qualification
msgpackmsgpack-ruby, java-platform buildLess than 1.8.7 per the NVD record [1]; up to and including 1.8.6 per the advisory [3]JRuby on OpenJDK1.8.7 listed as fixed [1, 3]The two boundaries describe the same range, but whether the 1.8.7 java build contains the fix is not verified
msgpackmsgpack-ruby, releases before 1.8.6Treated as affected by the reporter, not individually tested [3]JRubyNot statedUnverified lower bound
msgpackmsgpack-ruby, C implementation (CRuby)Not listed as affected; per-container cap since 1.7.3 and buffered-bytes cap in 1.8.6 [3]CRubyNot applicableDerived from the advisory; no explicit not-affected statement from the vendor

The reporter states that the released 1.8.6 java build is unfixed [3]. The advisory describes a proposed fix but does not state that it has been released [3]. The NVD record references the v1.8.7 release tag [1]. Taken together, the sources do not establish that the 1.8.7 java-platform build removes the flaw; this is the most important open point for remediation.

Exploitation and threat intelligence status

  • Confirmed in-the-wild exploitation: none reported. The advisory states there is no known exploitation and no public exploit [3].
  • CISA KEV: not listed as of 2026-11-21. The catalog listing is not evidence that the CVE has not been exploited [2].
  • EPSS: 0.0053 (0.53%) probability of exploitation activity within 30 days, percentile 0.4554, dated 2026-11-20. EPSS is a statistical estimate and not evidence of exploitation [4].
  • Public proof of concept: the reporter describes a local, header-only test used for verification, and the advisory states no public exploit exists [3].
  • Threat actors, campaigns and targeted sectors: none attributed in the pack.

Detection and exposure assessment

  1. Inventory: on every JRuby host, image or build, run gem list msgpack in the same environment as the application. Expected output lists installed msgpack versions; the installed version is 1.8.6 or earlier if the host is exposed. Analyst assessment: confirm locally whether the output shows the java platform suffix, because the pack does not document the output format.
  2. Lockfile: run grep -n msgpack Gemfile.lock in each application repository. Confirm the resolved version and whether a java platform entry is present.
  3. Code review: run grep -rn -i 'unpack' app lib in each JRuby application to find decoding call sites, then determine whether any of them receives input from outside the trust boundary of the service. The advisory identifies the unpacking methods as the entry point but does not name them [3].
  4. Telemetry: search JVM application logs for OutOfMemoryError entries whose messages mention an array size exceeding the VM limit or a Java heap space error. The advisory reports these messages for array32, str32 and bin32 inputs [3]. Limitation: such errors have other causes, and an absence of these entries does not show that the system was not exposed.
  5. Validation after changes: confirm that the installed version and the lockfile both show 1.8.7 and that the JVM has been restarted. Any functional or memory regression test should run in an isolated environment with heap monitoring, not in production.

Remediation

Immediate mitigation (analyst assessment, based on the documented C-versus-Java difference [3]):

  • Route untrusted msgpack decoding to a CRuby process rather than the java-platform build. This removes the Java decoder from the exposed path. Verify by checking the runtime of the decoding process reports CRuby. Side effect: a deployment change and a process boundary to maintain.
  • Run untrusted decoding in an isolated worker JVM with an explicit heap limit so that an out-of-memory condition does not reach shared services. This limits blast radius but does not remove the flaw.
  • Do not rely on byte-length input caps alone. The advisory shows that a short header can declare a very large count, so limiting input size does not bound the allocation [3].

Permanent fix:

  • Upgrade the msgpack gem to 1.8.7, which the NVD record and advisory both list as the fixed version [1, 3]. Before relying on the upgrade, confirm with the release notes or the maintainer's diff that the java-platform decoder changed. The reporter states the released 1.8.6 java build is unfixed and that the proposed fix has no stated release [3].
  • Restart the JVM hosting the application after updating the gem so that the new code is loaded. Analyst assessment: a restart is the standard requirement for a JVM to load a replaced gem.
  • Keep the previous Gemfile.lock to allow rollback. Schedule the change in a maintenance window if the decoder is on a shared JVM.

Recommended hardening, not a vendor-confirmed fix: separating untrusted decoding into a bounded worker process, and monitoring heap usage on JRuby services.

Remediation checklist

  1. Inventory every JRuby host, container image and application repository that depends on the msgpack gem: run gem list msgpack in each runtime and grep -n msgpack Gemfile.lock in each repository, recording the resolved version and whether a java platform entry is present [1, 3].
  2. Identify each call site where the application unpacks msgpack data from outside its trust boundary, using grep -rn -i 'unpack' app lib as a starting search; the advisory identifies the unpacking methods as the affected entry point [3].
  3. Immediately stop decoding untrusted msgpack data on the java-platform build by routing that input to a CRuby process, since the advisory states the C implementation carries size caps the Java decoder lacks [3]; verify with the runtime check of the decoding process.
  4. Isolate any remaining untrusted decoding in a worker JVM with an explicit heap limit so that an out-of-memory condition cannot reach shared services; verify the limit with the JVM startup configuration [3].
  5. Do not rely on input byte-length caps alone, because the advisory shows a small header can declare a very large count [3].
  6. Upgrade the msgpack gem to 1.8.7 in the Gemfile and lockfile, as listed by the NVD record and advisory [1, 3]; before deployment, confirm from the release notes or source diff that the java-platform decoder was changed, since the reporter says the released 1.8.6 java build is unfixed [3].
  7. After the upgrade, verify the installed and locked version both show 1.8.7 and restart the JVM so the new code is loaded; keep the previous lockfile to allow rollback.
  8. Search JVM application logs for OutOfMemoryError entries mentioning an array size beyond the VM limit or a Java heap space error, as reported in the advisory, and correlate any hits with the input source; treat the absence of hits as inconclusive [3].
  9. Track NVD analysis of CVE-2026-126366, because the record status is Received and the affected range and scoring may change [1].

Evidence gaps

  • Not established by the reviewed sources: whether the msgpack 1.8.7 java-platform build actually contains the decoder fix. The NVD record and advisory list 1.8.7 as fixed, while the reporter states the released 1.8.6 java build is unfixed and describes the proposed fix without a release statement [1, 3]. This would be settled by the maintainer release notes or source diff of the java decoder in 1.8.7.
  • Not established by the reviewed sources: the lowest affected java-platform version. Releases before 1.8.6 were not individually tested [3]. This would be settled by testing the java build across earlier releases.
  • Not established by the reviewed sources: a vendor-confirmed root cause. The root-cause description comes from the reporter's analysis [3]. This would be settled by the maintainer's advisory or commit analysis.
  • Not established by the reviewed sources: the CVSS score provenance. NVD and the GitHub advisory attribute the score to a scorer, while the advisory text calls the score the reporter's proposal [1, 3]. This would be settled by the NVD analysis once the record moves past Received [1].
  • Not established by the reviewed sources: the vendor's release date for the fixed version and any maintainer advisory text for CVE-2026-126366 [1, 3].
  • Not established by the reviewed sources: any indicators of compromise, file hashes, network indicators or in-the-wild telemetry. None are given in the pack [2, 3].
  • Not established by the reviewed sources: exploitation in the wild or threat actor attribution. The advisory reports no known exploitation and no public exploit; the KEV listing is absent as of 2026-11-21 [2, 3].
  • Not established by the reviewed sources: how the heap-size dependence observed in one 512 MiB test behaves on production heap sizes, or whether other msgpack bindings on other platforms are affected [3].
  • Not established by the reviewed sources: the output format of gem list on java-platform installs, so the version check should be confirmed locally [3].

References

  1. CVE-2026-126366 record. NIST National Vulnerability Database (NVD), 2026-11-13. https://nvd.nist.gov/vuln/detail/CVE-2026-126366. Accessed 2026-11-21. CVE record details: NVD status Received, publication and modification dates, CVSS 3.1 score and vector with GitHub as secondary scorer, CWE-770 and CWE-1325 mappings, the vendor-published affected range below 1.8.7, and release tags v1.8.6 and v1.8.7.
  2. Known Exploited Vulnerabilities Catalog. Cybersecurity and Infrastructure Security Agency (CISA), 2026-11-21. https://www.cisa.gov/known-exploited-vulnerabilities-catalog. Accessed 2026-11-21. CISA KEV status: CVE-2026-126366 not listed as of 2026-11-21, with the note that absence is not evidence of no exploitation.
  3. GHSA-73v3-wf97-vpgj / CVE-2026-126366 — msgpack-ruby JRuby decoder makes uncapped header-count allocations; a 5-byte message forces multi-GiB OOM. GitHub Security Advisory Database, 2026-11-12. https://github.com/advisories/GHSA-73v3-wf97-vpgj. Accessed 2026-11-21. GitHub advisory GHSA-73v3-wf97-vpgj: the java-platform decoder root cause as described by the reporter, affected and fixed versions, the C-versus-Java cap comparison, reproduction conditions and reported impact, the reporter's CVSS proposal, the absence of known exploitation, the Fluentd statement,
  4. EPSS score for CVE-2026-126366. FIRST, 2026-11-20. https://api.first.org/data/v1/epss?cve=CVE-2026-126366. Accessed 2026-11-21. FIRST EPSS estimate of 0.0053 (0.53%) for 30 days, percentile 0.4554, dated 2026-11-20, qualified as a statistical estimate and not evidence of exploitation.

Written with AI assistance from the 4 sources listed above, as of the research cut-off; each fact is cited to its source. Check the vendor's advisory before acting.

Severity breakdown

High · 7.5 CVSS 3.1 base score from the CNA (github.com)

An attacker without an account can exploit this over the network, without any user action.

Attack from
the network (remotely)
Attack complexity
low (no special conditions)
Login needed
no
User action needed
no
Scope
stays within the vulnerable component
Impact
high on availability, none on confidentiality and integrity

Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Weakness

  • CWE-770: Allocation of Resources Without Limits or Throttling
  • CWE-1325: Improperly Controlled Sequential Memory Allocation

Affected and fixed versions

ProductAffected versionsFixed in
msgpack (RubyGems)≤ 1.8.61.8.7
msgpack msgpack-ruby< 1.8.7—

From the GitHub Advisory Database and the vendor's CVE record; confirm with the vendor advisory before relying on a version number.

References by type

Vendor advisories

Patches and fixed releases

Other references

Details from NVD (public domain), the GitHub Advisory Database (CC BY 4.0).

Details

Summary

The JRuby implementation of msgpack (msgpack gem, java platform — pure Java decoder under ext/java/) sizes containers directly from the element count written in the message header, with no cap at all: no equivalent of the C unpacker's SHRT_MAX clamp (since 1.7.3) and none of the buffered-bytes cap that commit c8d42d8 added for CRuby in 1.8.6. A single 5-byte message decides how much memory a JVM process tries to allocate:

  • array32 header declaring 0x7FFFFFFF elements → new IRubyObject[0x7FFFFFFF] (~8 GiB of reference slots) attempted immediately → java.lang.OutOfMemoryError: Requested array size exceeds VM limit.
  • Counts below the VM's max-array-size but above available heap (e.g. 5×10⁸ with a 512 MiB heap) produce a real allocation attempt — OutOfMemoryError: Java heap space — the JVM genuinely tries to take the memory before failing.
  • str32/bin32 headers declaring 0x7FFFFFFF bytes do the same via readBytes(size) → new byte[size].
  • Below the failure threshold there is a silent band: one streaming unpacker fed only an array32 header with count 2×10⁷ (5 wire bytes, zero elements) grows used heap +78 MiB immediately, no exception (each swallows the underflow), and the footprint stays elevated after Unpacker#reset + full GC. Linear in declared count (~4 B/element); nothing bounds it — not delivered bytes, not a per-container cap.

Only counts ≥ 2³¹ are refused (a clean MessagePack::UnderflowError from getUnsignedInt()), and only maps are safe (consumeHash grows per element instead of pre-sizing). Verified on the released gem msgpack 1.8.6 java, JRuby 9.4.12 / OpenJDK 25, 2026-10-30 — i.e. unfixed in the current release. Proposed fix mirrors c8d42d8: cap initial allocation by bytes actually buffered and grow as data arrives; read strings in bounded chunks instead of allocating the declared length up front.

Details

1. The four dispatch arms, and which pre-allocate (line numbers at tag v1.8.6 — current release; ext/java has no commits after it)

headerdispatch (Decoder.java)behaviour on the declared countmeasured (released 1.8.6-java, Xmx512m)
array32 \xdd:296 → consumeArray(int size) :139-145new IRubyObject[size] immediately, before reading any elementcount 0x7FFFFFFF: OOME "Requested array size exceeds VM limit"; count 5×10⁸: OOME "Java heap space" (real allocation attempt); count 2×10⁷: +78 MiB, silent
str32 \xdb:294 → consumeString :129 → readBytes(int size) :186-190new byte[size] immediatelylen 0x7FFFFFFF: OOME "array size exceeds VM limit"
bin32 \xc6:269 → same consumeString/readBytessamelen 0x7FFFFFFF: OOME "array size exceeds VM limit"
map32 \xdf:298 → consumeHash(int size) :147+no pre-allocation — inserts per element, underflows on first missing bytecount 0x7FFFFFFF: no exception (swallowed), no large allocation

The only guard is getUnsignedInt() :88-94: counts with the top bit set (≥ 2³¹) raise MessagePack::UnderflowError: Size too large (limited to 2**31 for the Java version). That bounds the value but leaves the entire positive band (available heap, 2³¹) unbounded — and that band is where real allocation attempts happen.

2. Contrast with the C implementation (same repo)

The CRuby unpacker has had a per-container cap since 1.7.3 (INITIAL_BUFFER_CAPACITY_MAX = SHRT_MAX) and, since c8d42d8 in 1.8.6, additionally caps initial size by bytes actually buffered ("an element needs at least one byte…"). Strings on C are bounded too (read_raw_body_cont allocates min(remaining, buffered)). The Java decoder has neither generation of cap — it is strictly behind the CRuby behaviour this repo already considers correct enough to ship.

3. Silent retention + mechanism control (measured 2026-10-30, released gem)

One MessagePack::Unpacker per process, fed only a header ("\xdd" + [count].pack('N')), zero elements; heap = Runtime.total_memory - free_memory after GC.start on both sides:

declared countused heap before → afterdeltaexception?
1,000,00026.4 → 31.1 MiB+4.7none (each swallows the underflow)
5,000,00053.3 → 74.0 MiB+20.7none
20,000,00051.3 → 129.3 MiB+78.0none

Mechanism control: after the feed, Unpacker#reset + three GC.start cycles left used heap at +79.4 MiB above baseline (2×10⁷ arm) — the elevation is not unpacker-held state; it is JVM heap already spent on header-declared allocation and not returned. Either way the process footprint grows per attack and stays grown; the peak cost is paid synchronously during parsing regardless of GC behaviour afterwards. (Honest scope note: this is unbounded allocation, not a memory leak.)

4. Why JVM makes availability impact worse than the CRuby analogue

In CRuby, allocation failure raises NoMemoryError/fails inside one worker process. In a JVM, an OOME raised on the parser thread can land anywhere in the host application's shared runtime — long-lived JRuby servers (Rails, Logstash-class pipelines, JDBC apps) share heap across all threads and connections; a single crafted message can destabilize or kill the whole JVM, not just the request. The silent band means no exception at all is even required to spend memory.

5. Not claimed / scope

  • Fluentd is NOT affected (and this report deliberately does not involve it): Fluentd ships CRuby-only — CI pins engine: cruby, gemspec requires ruby >= 3.3 while JRuby 9.4 implements Ruby 3.1 semantics, and there are zero JRUBY guards in lib/. This is an upstream msgpack-ruby report only.
  • Maps (map32) do not pre-allocate — measured; the class applies to array32/str32/bin32.
  • Counts ≥ 2³¹ are cleanly refused — measured; no claim there.
  • Older java-gem releases were not individually probed; <= 1.8.6 means "every release up to the current one carries this code".

Proof of concept

Verified on the released gem msgpack 1.8.6 java, JRuby 9.4.12.0, OpenJDK 25.0.4.1, Linux x86-64 (artifacts in evidence_186_recheck/). Always run with a small -Xmx so oversized requests fail fast instead of wrecking the box.

Setup

$ curl -fsSLO https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.4.12.0/jruby-dist-9.4.12.0-bin.tar.gz
$ tar xzf jruby-dist-9.4.12.0-bin.tar.gz && export PATH=$PWD/jruby-9.4.12.0/bin:$PATH
$ jruby -S gem install msgpack --no-document      # resolves the java-platform gem: "msgpack (1.8.6 java)"

1. Header shapes (fresh process per arm, -Xmx512m)

array32 count=0xFFFFFFFF       -> MessagePack::UnderflowError: Size too large (limited to 2**31 for the Java version)
array32 count=0x7FFFFFFF       -> Java::JavaLang::OutOfMemoryError: Requested array size exceeds VM limit
array32 count=500000000        -> Java::JavaLang::OutOfMemoryError: Java heap space   # real allocation attempt
str32   len=0x7FFFFFFF         -> Java::JavaLang::OutOfMemoryError: Requested array size exceeds VM limit
bin32   len=0x7FFFFFFF         -> Java::JavaLang::OutOfMemoryError: Requested array size exceeds VM limit
map32   count=0x7FFFFFFF       -> no exception, no large allocation (consumeHash grows per element)

Each payload is five bytes, e.g. "\xdd" + [count].pack('N') fed to MessagePack::Unpacker#feed_each. Scripts: jr_probe.rb, jr_probe_extra.rb (attached in kit).

2. Silent band — retention from one header (Xmx1g)

$ for n in 1000000 5000000 20000000; do jruby -J-Xmx1g jr_one.rb $n; done
count=  1000000 heap 26.4 -> 31.1 MiB (delta 4.7)   | no exception (underflow swallowed)
count=  5000000 heap 53.3 -> 74.0 MiB (delta 20.7)  | no exception (underflow swallowed)
count= 20000000 heap 51.3 -> 129.3 MiB (delta 78.0) | no exception (underflow swallowed)

$ jruby -J-Xmx1g jr_reset_control.rb 20000000
count=20000000 heap base=49.9 after_feed=129.3 (delta 79.4) after_reset_gc=129.3 (retained_vs_base 79.4)

A streaming server that keeps one unpacker per connection (the pattern any socket-fed msgpack service uses) pays this per connection with five wire bytes each and produces no exception, no log line.

3. Fix verification path

Apply the C-side idea from c8d42d8: in consumeArray, cap the initial array by bytes actually buffered (an element needs ≥ 1 byte) and grow as elements arrive; in readBytes/consumeString, read in bounded chunks instead of allocating the declared length up front. Then re-run this PoC: the silent band should track delivered bytes, and oversized declarations should raise UnderflowError-class errors without touching multi-GiB allocations. msgpack-ruby CI runs jruby-9.4/truffleruby, so a patch is verifiable as-is; I can prepare one against ext/java/org/msgpack/jruby/Decoder.java.

Impact

Type. Uncontrolled resource consumption driven by declared sizes rather than delivered bytes — CWE-770 (Allocation of Resources Without Limits or Throttling), precisely CWE-1325 (Independent Resource Usage Limiting Not Applied). Availability only; no confidentiality/integrity impact, no code execution.

Who is impacted. Any JRuby application that feeds untrusted msgpack to MessagePack.unpack/Unpacker — the java-platform gem's whole user base (JRuby-based services, log/RPC pipelines, JVM polyglot stacks using this gem). For them: remote OOM of a shared-heap JVM from a 5-byte message, or silent heap spend below the exception band.

Severity. Proposed High / 7.5, CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H — remote, trivially crafted, default settings, process death; same metric string as the accepted fluentd OOM family (e.g. GHSA-h3xv-5jpx-r4j2) and as this repo's own C-side analogue (reported separately, patched at 1.8.6). If triage weighs the platform scope (java gem only), lower framings read against that — we flag it honestly; the maintainers' call on scope shouldn't delay the patch.

Relationship to the C-side report. Same flaw class, different implementation and fix state: CRuby's pre-allocation was capped by c8d42d8 (released 1.8.6, separate advisory with affected <= 1.8.5, patched 1.8.6). This JRuby variant is unfixed in 1.8.6 and needs its own patch + CVE. Cross-reference both ways once filed.

What this is not. Not a Fluentd issue (Fluentd is CRuby-only — CI pins cruby, gemspec ruby >= 3.3 vs JRuby's Ruby 3.1 semantics); no fluentd advisory should carry this. Not a memory leak (measured: footprint elevation persists after reset+GC without retained objects). Not exploitable via maps or counts ≥ 2³¹ (both measured safe/cleanly refused).

Source: GHSA-73v3-wf97-vpgj / CVE-2026-126366, GitHub Advisory Database, licensed CC BY 4.0.

Affected

  • rubygems:msgpack
  • msgpack msgpack-ruby

Frequently asked questions

What is CVE-2026-126366?

CVE-2026-126366 is a resource-exhaustion flaw in the pure Java msgpack decoder shipped in the java-platform build of the msgpack-ruby gem under JRuby, where array and byte-buffer sizes declared in a message header are allocated before the data arrives. Weakness type: Allocation of Resources Without Limits or Throttling (CWE-770).

How severe is CVE-2026-126366?

CVE-2026-126366 has a CVSS 3.1 base score of 7.5 (high), from the CNA (github.com). An attacker without an account can exploit this over the network, without any user action.

Is CVE-2026-126366 being exploited?

Not as far as is known: CVE-2026-126366 is not in CISA's Known Exploited Vulnerabilities catalog as of November 26, 2026. EPSS estimates a 0.6% chance that it is exploited in the next 30 days.

Which versions are affected by CVE-2026-126366?

msgpack (RubyGems) ≤ 1.8.6 (fixed in 1.8.7); msgpack msgpack-ruby < 1.8.7.

How do I fix CVE-2026-126366?

Inventory every JRuby host, container image and application repository that depends on the msgpack gem: run gem list msgpack in each runtime and grep -n msgpack Gemfile.lock in each repository, recording the resolved version and whether a java platform entry is present. Identify each call site where the application unpacks msgpack data from outside its trust boundary, using grep -rn -i 'unpack' app lib as a starting search; the advisory identifies the unpacking methods as the affected entry point. Immediately stop decoding untrusted msgpack data on the java-platform build by routing that input to a CRuby process, since the advisory states the C implementation carries size caps the Java decoder lacks; verify with the runtime check of the decoding process.

Timeline & sources

References

Related vulnerabilities & news