OCaml Buffer Over-Read Vulnerability in Marshal Deserialization Allows Remote Code Execution

Vulnerability

A buffer over-read vulnerability has been identified in OCaml versions prior to 4.14.3 and in the 5.x series prior to 5.4.1. This vulnerability occurs in the Marshal deserialization process, specifically within the 'runtime/intern.c' file. The issue arises from inadequate bounds validation in the 'readblock()' function, which enables unbounded memory copy operations using lengths controlled by attackers, derived from manipulated Marshal data. This flaw can be exploited to execute remote code through a multi-phase attack chain.

Impact

Exploitation of this vulnerability leads to remote code execution on the affected system.

Remediation

OCaml has released fixed versions that include additional bounds checks in the runtime, raising exceptions on bad input. Third-party libraries can also harden their custom Marshal deserialization code by following the example fix for bigarrays from the standard library.

Added: Feb 27, 2026, 4:18 AM
Updated: Feb 27, 2026, 4:18 AM

Vulnerability Rating

Custom Algorithm
spread
2.4
impact
7.5
exploitability
2.7
remediation
7.7
relevance
3.3
threat
0.0
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.