CVE-2026-28364

ocaml: OCaml: Remote code execution via buffer over-read in Marshal deserialization

Published Feb 27, 2026 CVSS 3.1 · 7.9 High EPSS < 1% KEV · Not listed
Description
In OCaml before 4.14.3 and 5.x before 5.4.1, a buffer over-read in Marshal deserialization (runtime/intern.c) enables remote code execution through a multi-phase attack chain. The vulnerability stems from missing bounds validation in the readblock() function, which performs unbounded memcpy() operations using attacker-controlled lengths from crafted Marshal data.

Analysis

AI-generated

Technical impact

The vulnerability originates from missing bounds checking in OCaml's readblock() routine used during Marshal deserialization. When an attacker supplies crafted Marshal data, the routine performs memcpy calls with lengths derived from that data, causing an out‑of‑bounds read and an unchecked memory copy. This flaw enables an attacker to execute arbitrary code with the privileges of the running OCaml process. The weakness is classified as a buffer over‑read (CWE‑125) and an unchecked memory copy (CWE‑126).

Affected Systems

OCaml versions before 4.14.3 and 5.x before 5.4.1 are impacted. The issue affects the runtime component that many applications rely on for deserializing data received from external sources. Any deployment that uses the default Marshal module to process untrusted input is at risk, regardless of the operating environment.

Risk and Exploitability

The CVSS score of 7.9 indicates a high severity, while the EPSS score indicates the likelihood of current exploitation is very low but not zero. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. Exfiltration requires an attacker to deliver a specifically crafted Marshal payload to the vulnerable application, typically through a network or file channel. The multi‑phase attack chain relies on the unchecked memory copy performed during deserialization, and a successful exploit would allow the attacker to run arbitrary code on the host with the same privileges as the OCaml runtime.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade OCaml to version 4.14.3 or later, or 5.4.1 or newer, to obtain the bound‑checking fix.
  • If a timely upgrade is not possible, ensure that the Marshal module is only used to deserialize data from fully verified and trusted sources; refuse to process data from external or untrusted inputs.
  • Apply a memory‑safety tool or compiler option (e.g., address sanitizer) to detect or prevent out‑of‑bounds reads during development and testing, and consider switching to an alternative serialization library that performs explicit bounds validation.

Generated by OpenCVE AI on April 17, 2026 at 14:03 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Title ocaml: OCaml: Remote code execution via buffer over-read in Marshal deserialization
Weaknesses CWE-125
References
Metrics threat_severity

None

threat_severity

Important

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description In OCaml before 4.14.3 and 5.x before 5.4.1, a buffer over-read in Marshal deserialization (runtime/intern.c) enables remote code execution through a multi-phase attack chain. The vulnerability stems from missing bounds validation in the readblock() function, which performs unbounded memcpy() operations using attacker-controlled lengths from crafted Marshal data.
First Time appeared Ocaml
Ocaml ocaml
Weaknesses CWE-126
CPEs cpe:2.3:a:ocaml:ocaml:*:*:*:*:*:*:*:*
Vendors & Products Ocaml
Ocaml ocaml
References
Metrics cvssV3_1

{'score': 7.9, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
Jul 15, 2026, 1:11 AM
Reserved
Feb 27, 2026, 3:54 AM
Status
Modified
Published
Feb 27, 2026, 4:16 AM
Modified
Jul 15, 2026, 2:19 AM
Severity
Important
Public date
Feb 27, 2026, 3:54 AM