Ocaml: Marshal integer overflow leads to out-of-heap read (CVE-2026-28364)
An integer overflow vulnerability in OCaml's Marshal deserialization logic allows crafted serialized objects to bypass bounds checks, leading to out-of-heap reads. This can cause heap memory disclosure or denial of service via crashes. The flaw exists in the length validation of the deserializer, where an unsigned 64-bit addition can wrap, causing pointer calculations to underflow and bypass safety checks. The vulnerability affects multiple OCaml versions prior to 5.5.1 and was fixed in OCaml 5.5.1.
AI Analysis
Technical Summary
CVE-2026-28364 is an integer overflow in OCaml's Marshal deserializer's length-validation logic. The vulnerability arises because the sum of offset, header length, and data length is computed using unsigned 64-bit addition that can wrap around, allowing an attacker-controlled data length field to bypass bounds checks. This causes the internal pointer 'intern_src_end' to wrap to a location before the input buffer, invalidating all subsequent read boundary checks. As a result, the deserializer can read heap memory beyond the input buffer, leading to out-of-bounds reads. The vulnerability affects the OCaml functions Marshal.from_bytes, Marshal.from_string, and the C API caml_input_value_from_block. Exploits include heap information disclosure and denial of service via crashes. The issue was reported on 2026-08-15, patched by 2026-09-05 in OCaml 5.5.1, and affects many versions prior to 5.5.1.
Potential Impact
Successful exploitation allows an attacker to cause out-of-bounds heap reads during deserialization, potentially leaking sensitive heap memory contents (information disclosure). It can also cause denial of service through crashes (SIGBUS/SIGSEGV). There is no indication of code execution or privilege escalation. The vulnerability impacts confidentiality and availability but not integrity.
Mitigation Recommendations
A patch is available and was released in OCaml version 5.5.1. Users should upgrade to OCaml 5.5.1 or later to remediate this vulnerability. The vendor advisory confirms the fix was merged into the 5.5, 4.14, and trunk branches. No additional mitigations are indicated or required beyond applying the official patch.
Ocaml: Marshal integer overflow leads to out-of-heap read (CVE-2026-28364)
Description
An integer overflow vulnerability in OCaml's Marshal deserialization logic allows crafted serialized objects to bypass bounds checks, leading to out-of-heap reads. This can cause heap memory disclosure or denial of service via crashes. The flaw exists in the length validation of the deserializer, where an unsigned 64-bit addition can wrap, causing pointer calculations to underflow and bypass safety checks. The vulnerability affects multiple OCaml versions prior to 5.5.1 and was fixed in OCaml 5.5.1.
CVSS v3.1
Score 6.8medium
Affected software
pkg:opam/ocamlRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-28364 is an integer overflow in OCaml's Marshal deserializer's length-validation logic. The vulnerability arises because the sum of offset, header length, and data length is computed using unsigned 64-bit addition that can wrap around, allowing an attacker-controlled data length field to bypass bounds checks. This causes the internal pointer 'intern_src_end' to wrap to a location before the input buffer, invalidating all subsequent read boundary checks. As a result, the deserializer can read heap memory beyond the input buffer, leading to out-of-bounds reads. The vulnerability affects the OCaml functions Marshal.from_bytes, Marshal.from_string, and the C API caml_input_value_from_block. Exploits include heap information disclosure and denial of service via crashes. The issue was reported on 2026-08-15, patched by 2026-09-05 in OCaml 5.5.1, and affects many versions prior to 5.5.1.
Potential Impact
Successful exploitation allows an attacker to cause out-of-bounds heap reads during deserialization, potentially leaking sensitive heap memory contents (information disclosure). It can also cause denial of service through crashes (SIGBUS/SIGSEGV). There is no indication of code execution or privilege escalation. The vulnerability impacts confidentiality and availability but not integrity.
Mitigation Recommendations
A patch is available and was released in OCaml version 5.5.1. Users should upgrade to OCaml 5.5.1 or later to remediate this vulnerability. The vendor advisory confirms the fix was merged into the 5.5, 4.14, and trunk branches. No additional mitigations are indicated or required beyond applying the official patch.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- OSEC-2026-18
- Osv Schema Version
- 1.7.4
- Aliases
- ["CVE-2026-28364"]
- Ecosystems
- ["opam"]
- Database Specific Severity
- null
- Cvss Version
- 3.1
Threat ID: 6aa2af59acd9273b4925a31a
Added to database: 09/10/2026, 13:23:37 UTC
Last enriched: 09/10/2026, 13:26:52 UTC
Last updated: 09/10/2026, 16:41:05 UTC
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.