JustAppSec
Back to news

OCaml patches Marshal deserialization buffer over-read enabling RCE

1 min readPublished 27 Feb 2026Updated 27 Feb 2026Source: CVE Project (cvelistV5)

TL;DR — A missing bounds check in OCaml's Marshal deserialization enables a buffer over-read that can be chained into remote code execution.

What happened

OCaml is a general-purpose programming language with an emphasis on safety and performance, used in finance, systems programming, and formal verification tooling. MITRE published CVE-2026-28364 describing a buffer over-read in OCaml's Marshal deserialization (runtime/intern.c). Missing bounds validation in readblock() allows unbounded memcpy() operations using attacker-controlled lengths from crafted Marshal data, enabling a multi-phase attack chain to RCE.

While OCaml's Marshal module has long documented that unmarshalling untrusted data is unsafe, this CVE demonstrates a concrete exploit chain with a CVSS 3.1 score of 7.9 (High) — making it worth patching even in environments that believe they only marshal trusted data.

Who is impacted

  • OCaml versions < 4.14.3 (4.x line).
  • OCaml 5.x versions >= 5.0.0 and < 5.4.1.

What to do now

  • Follow vendor remediation guidance and apply the latest patched release available at the time of writing.
  • Review any components that deserialize Marshal data and ensure untrusted inputs are never passed to it.

Content is AI-assisted and reviewed by our team, but issues may be missed and best practices evolve rapidly, send corrections to [email protected]. Always consult official documentation and validate key implementation decisions before making design or security choices.

Need help?Get in touch.