Skip to content
High 7.9

Vulnerability in OCaml

CVE-2026-28364 First seen on SecPulse

AI summary

Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.

A vulnerability tracked as CVE-2026-28364 has been found in OCaml.
Confidential information can be exposed externally. CVSS score: 7.9/10.
What to do: apply the vendor's official patched release.
If unsure, ask your IT team or search "OCaml CVE-2026-28364" on the vendor's site.

CVE-2026-28364 (OCaml) — CWE-126 / CVSS v3 7.9
Attack vector: local / unauthenticated / no user interaction
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

What is the problem

A vulnerability (CWE-126) exists in OCaml.

Affected scope

Check the vendor advisory for the affected versions of OCaml.

Severity

Severity: High (CVSS 7.9/10). Confidential information can be exposed externally.

How to fix

Update to the patched release per vendor advisory.

Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'OCaml' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposureidentify
    grep -r 'OCaml' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で OCaml を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Post-deployment verificationverify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

PackageAffected → Fixed
opamocaml
< 4.14.4→ 4.14.4
≥ 5.0.0, < 5.5.1→ 5.5.1

Fix status by distribution

Records published by each distribution for this CVE. Fixed versions differ by release; check each link.

Original description The description as published by the source.

An integer overflow in the length-validation logic of OCaml's Marshal deserializer allows a crafted serialized object to bypass all bounds checks added by the CVE-2026-28364 fix, producing heap out-of-bounds reads from Marshal.from_bytes / Marshal.from_string (and the C API caml_input_value_from_block).

Root cause

runtime/intern.c validates declared data length against the input buffer with unsigned 64-bit addition that can wrap:

/* caml_input_val_from_bytes, intern.c:1038 */
if (ofs + h.header_len + h.data_len > caml_string_length(str))
  caml_failwith("input_val_from_string: bad length");

h.data_len is fully attacker-controlled (8-byte field read straight from the stream for Intext_magic_number_big). With data_len >= 2^64 - (ofs + h.header_len), the sum wraps to a small value and the check passes.

The CVE-2026-28364 fix introduced:

/* intern.c:1043 (added by the fix) */
s->intern_src_end = s->intern_src + h.data_len;   /* wraps to a pointer BEFORE the buffer */

intern_src_end wraps to a location before intern_src, so every intern_check_read() bound added by the fix (len > end - src with a negative diff promoted to a huge uintnat) evaluates false for any realistic length. The parser (intern_rec) then honors attacker-controlled read lengths (readblock up to Max_wosize bytes) against memory far beyond the input buffer.

The OCaml-side wrapper validation in stdlib/marshal.ml is bypassed by the same wrap, via…

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details