Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
ocaml-marshal-vulnerability — I found an integer overflow that defeats OCaml's fix for CVE-2026-28364: heap memory disclosure and SIGBUS crashes via Marshal deserialization. PoCs, advisory, and proposed patch — fixed in OCaml 5.5.1 (OSEC-2026-18). | Kitploit
Tools/GitHubGitHub/akshay-m-singh/ocaml-marshal-vulnerability
Memory ForensicsVulnerability AnalysisExploitationReverse EngineeringBinary AnalysisPapers & ResearchLearning & Education
GitHub
Share
akshay-m-singh/ocaml-marshal-vulnerability

ocaml-marshal-vulnerability

I found an integer overflow that defeats OCaml's fix for CVE-2026-28364: heap memory disclosure and SIGBUS crashes via Marshal deserialization. PoCs, advisory, and proposed patch — fixed in OCaml 5.5.1 (OSEC-2026-18).

View RepositoryWebsite
1 month agoNot yet reviewed

I found a bug in OCaml's fix for CVE-2026-28364

While working on an OCaml project that deserializes data with Marshal, a malformed input took the process down with a SIGBUS instead of a clean exception. I pulled the OCaml runtime and started reading runtime/intern.c. The earlier CVE-2026-28364 fix had added bounds checks to make Marshal safe against malicious input - but the checks were bypassable. The length arithmetic still wrapped, and the fix's own intern_src_end = intern_src + data_len wraps to a pointer before the buffer, defeating every check the fix added. I wrote minimal PoCs (a heap info leak and a crash), confirmed the leak under AddressSanitizer, proposed a fix, and reported it to [email protected]. Xavier Leroy's fix landed upstream and shipped in OCaml 5.5.1 as OSEC-2026-18.

  • Severity: 6.8 (Medium) - CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
  • Affected: all OCaml releases before 5.5.1
  • Fixed: OCaml 5.5.1 (2026-09-05); merged into trunk, 5.5, and 4.14 branches
  • Official advisory: https://osv.dev/vulnerability/OSEC-2026-18
  • OCaml release notes: https://discuss.ocaml.org/t/ocaml-5-5-1-released/18510
  • Reporter: Akshay M Singh

Yes - the bug is in the fix

The CVE-2026-28364 fix added this bound:

s->intern_src_end = s->intern_src + h.data_len;   /* intern.c:1043 */

but h.data_len is fully attacker-controlled. Set it to 2^64 - 16 and:

  1. ofs + h.header_len + h.data_len wraps in the validation (intern.c:1038), so the check passes.
  2. The fix's intern_src_end wraps to a location before the buffer.
  3. Every intern_check_read the fix added compares against a negative diff promoted to a huge uintnat, so they all pass.
  4. intern_rec then reads attacker-chosen lengths from past the input: heap bytes leak into the returned string, or the process dies with SIGBUS.

The full write-up is in advisory/OCAML-MARSHAL-ADVISORY.md.

Where it's tracked

  • OSV advisory OSEC-2026-18 -

  • OCaml 5.5.1 release announcement - discuss.ocaml.org/t/ocaml-5-5-1-released/18510 - lists the fix (PR #15019)

Repository contents

PathDescription
advisory/OCAML-MARSHAL-ADVISORY.mdReporter's original advisory: root cause, exploit path, impact, suggested fix, verification evidence
advisory/disclosure-timeline.mdCoordinated disclosure timeline and links
poc/leak.mlHeap information-disclosure PoC
poc/crash.mlDenial-of-service PoC (SIGBUS, exit 138)
poc/controls.mlBenign-input controls (must fail cleanly)
poc/asan-driver.cC driver used with an ASan-instrumented runtime
poc/asan-report.txtAddressSanitizer heap-buffer-overflow report
patch/intern-overflow-suggested.patchReporter's suggested fix (upstream's merged fix is authoritative)
docs/tools-used.mdTools and environment used

Reproducing

The PoCs demonstrate the bug on OCaml <= 5.5.0 (tested on 5.5.0, macOS arm64):

ocamlopt -o leak poc/leak.ml
ocamlopt -o crash poc/crash.ml
ocamlopt -o controls poc/controls.ml
  • ./leak prints a string containing heap bytes read from beyond the input buffer (contents vary between runs).
  • ./crash terminates with SIGBUS (exit 138).
  • ./controls must print three OK lines.

poc/asan-driver.c requires an OCaml 5.5.0 runtime built from source with AddressSanitizer (-fsanitize=address); see docs/tools-used.md. It drives the vulnerable path via caml_input_value_from_block.

On OCaml >= 5.5.1, the crafted inputs fail cleanly with Failure("Marshal.data_size: object too large to be read back on this platform") (the merged upstream fix, verified against the 5.5.1 tag), and the controls still pass. The reporter's suggested patch in patch/ raises Failure("Marshal.data_size: object too large") for the same inputs; the merged fix is authoritative.

Timeline

Discovered 2026-08-12, reported 2026-08-15, fixed upstream 2026-09-03, released in 5.5.1 on 2026-09-05, advisory published 2026-09-10. Details: advisory/disclosure-timeline.md.

Responsible use

These materials are published for defensive and educational purposes after coordinated disclosure with the OCaml Security Response Team. The PoCs are minimal research artifacts. Do not use them against systems you do not own or have permission to test.

Credits

  • Akshay M Singh - reporter
  • Xavier Leroy - remediation developer
  • Nicolás Ojeda Bär, Antonin Décimo - remediation reviewers
  • Hannes Mehnert - coordinator

License

Code (poc/, patch/) is licensed under the MIT License (see LICENSE). Documentation (README.md, advisory/, docs/) is licensed under CC BY 4.0.

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    795
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    520
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    439
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    346
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    267
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    264

Explore all tools

Browse our collection of tools

View all tools →