OSEC-2026-25

See a problem?
Import Source
https://github.com/ocaml/security-advisories/blob/generated-osv/2026/OSEC-2026-25.json
JSON Data
https://api.osv.dev/v1/vulns/OSEC-2026-25
Published
2026-10-23T21:30:00Z
Modified
2026-11-06T19:14:06Z
Severity
  • 4.5 (Medium) CVSS_V4 - CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P CVSS Calculator
Summary
Heap buffer overflow in the OCaml `runtime_events` consumer when parsing an oversized custom user event
Details

ANT-2026-0JXJVEVY

Custom events maintains a cache of user events, it is possible to have a corrupt stream that has a valid message with one message type (which can be custom/unit/span/int) and then has the same event with a different message type.

This would never be encountered in a real program but can lead to a crash.

Fix

Check message lengths for all runtime event types, report a corrupt stream on mismatch.

Am I affected?

If the runtime events producer and consumer run in separate processes, and the producer can be tricked into producing malformed data.

Timeline

  • 2026-08-24: vulnerability was found
  • 2026-08-27: forwarded report to security@ocaml.org
  • 2027-09-05: fix merged to trunk
Database specific
{
    "cwe": [
        "CWE-20",
        "CWE-122"
    ],
    "human_link": "https://github.com/ocaml/security-advisories/tree/main/advisories/2026/OSEC-2026-25.md",
    "osv": "https://github.com/ocaml/security-advisories/tree/generated-osv/2026/OSEC-2026-25.json"
}
Credits
    • Anthropic - REPORTER
    • Hannes Mehnert - COORDINATOR
    • Edwin Török - COORDINATOR
    • Olivier Nicole - REMEDIATION_REVIEWER
    • Edwin Török - REMEDIATION_REVIEWER
    • Sadiq Jaffer - REMEDIATION_DEVELOPER

Affected packages

opam / ocaml

Package

Name
ocaml
Purl
pkg:opam/ocaml

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5
Fixed
5.5.2

Affected versions

5.*
5.0.0
5.0.1
5.1.0
5.1.1
5.1.2
5.2.0
5.2.1
5.2.2
5.3.0
5.3.1
5.4.0
5.4.1
5.4.2
5.5.0
5.5.1

Ecosystem specific

{
    "affected_bindings": [
        "Runtime_events.read_poll"
    ],
    "opam_constraint": "ocaml {>= \"5\" & < \"5.5.2\"}"
}

Database specific

source
"https://github.com/ocaml/security-advisories/blob/generated-osv/2026/OSEC-2026-25.json"

Git / github.com/ocaml/ocaml

Affected ranges

Type
GIT
Repo
https://github.com/ocaml/ocaml
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed
Type
GIT
Repo
https://github.com/ocaml/ocaml
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed

Affected versions

5.*
5.5.0
5.5.0-alpha1
5.5.0-alpha2
5.5.0-alpha3
5.5.0-beta1
5.5.0-rc1
5.5.1
Other
flambda_fork_point

Database specific

source
"https://github.com/ocaml/security-advisories/blob/generated-osv/2026/OSEC-2026-25.json"
vanir_signatures
[
    {
        "deprecated": false,
        "digest": {
            "function_hash": "321247281947887769223368821828062114846",
            "length": 1563
        },
        "id": "OSEC-2026-25-20e2705c",
        "signature_type": "Function",
        "signature_version": "v1",
        "source": "https://github.com/ocaml/ocaml/commit/2247294d06464df0273479f41b0418655918da27",
        "target": {
            "file": "otherlibs/runtime_events/runtime_events_consumer.c",
            "function": "ml_user_custom"
        }
    },
    {
        "deprecated": false,
        "digest": {
            "function_hash": "126000856660087726349096174631135797871",
            "length": 1042
        },
        "id": "OSEC-2026-25-25fe08f3",
        "signature_type": "Function",
        "signature_version": "v1",
        "source": "https://github.com/ocaml/ocaml/commit/9dcf0c86201cf5e8ece56c6bb5f61fc4d92fb74a",
        "target": {
            "file": "otherlibs/runtime_events/runtime_events_consumer.c",
            "function": "caml_ml_runtime_events_read_poll"
        }
    },
    {
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "111831701488351713961569234812992595021",
                "111953352735604494825795214141047561976",
                "178683087821655920891299720306783372467",
                "43010587091771661805560614527975841264",
                "184372192283305481238040564037867938493",
                "71256240169527906131181079939418454348",
                "4058316498929817540274641781777604482",
                "338296007338089292728636436516888946388",
                "86843095169688903412092527514009386688",
                "3441502270842544140729811263558144702",
                "323697301340215636004519522123449405867",
                "244085243038275622414617659474615314744",
                "161084560472721119709327535780718819410",
                "202287845311014637819410313973934926960",
                "325949108712669133733556517988618701209",
                "227876769407806698897880193438862211930",
                "74132532645164474511587269859922908331",
                "175851450605030050185747994054588600413",
                "42507356172280817776611559054940821608",
                "1496891404631255331849889593757206556",
                "11313395195125093685026026725872315432",
                "244063141634822240045835087738732253572",
                "218526329141686370456661705955050812118",
                "55520315525176282722073128048626959304",
                "265026907594514400097390731047467065670",
                "47425390247326731793379367106281618640",
                "14271606582860514511203534933821148025",
                "274865434858619661652600779808177727612",
                "117797986007353263461408849077418831848",
                "24658908553801635356626148959630613544"
            ],
            "threshold": 0.9
        },
        "id": "OSEC-2026-25-59ba3e29",
        "signature_type": "Line",
        "signature_version": "v1",
        "source": "https://github.com/ocaml/ocaml/commit/2247294d06464df0273479f41b0418655918da27",
        "target": {
            "file": "otherlibs/runtime_events/runtime_events_consumer.c"
        }
    },
    {
        "deprecated": false,
        "digest": {
            "function_hash": "126000856660087726349096174631135797871",
            "length": 1042
        },
        "id": "OSEC-2026-25-a2d0bc55",
        "signature_type": "Function",
        "signature_version": "v1",
        "source": "https://github.com/ocaml/ocaml/commit/2247294d06464df0273479f41b0418655918da27",
        "target": {
            "file": "otherlibs/runtime_events/runtime_events_consumer.c",
            "function": "caml_ml_runtime_events_read_poll"
        }
    },
    {
        "deprecated": false,
        "digest": {
            "function_hash": "268250284820569207142621125947081028994",
            "length": 6060
        },
        "id": "OSEC-2026-25-aac3fba3",
        "signature_type": "Function",
        "signature_version": "v1",
        "source": "https://github.com/ocaml/ocaml/commit/2247294d06464df0273479f41b0418655918da27",
        "target": {
            "file": "otherlibs/runtime_events/runtime_events_consumer.c",
            "function": "caml_runtime_events_read_poll"
        }
    },
    {
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "111831701488351713961569234812992595021",
                "111953352735604494825795214141047561976",
                "178683087821655920891299720306783372467",
                "43010587091771661805560614527975841264",
                "184372192283305481238040564037867938493",
                "71256240169527906131181079939418454348",
                "4058316498929817540274641781777604482",
                "338296007338089292728636436516888946388",
                "86843095169688903412092527514009386688",
                "3441502270842544140729811263558144702",
                "323697301340215636004519522123449405867",
                "244085243038275622414617659474615314744",
                "161084560472721119709327535780718819410",
                "202287845311014637819410313973934926960",
                "325949108712669133733556517988618701209",
                "227876769407806698897880193438862211930",
                "74132532645164474511587269859922908331",
                "175851450605030050185747994054588600413",
                "42507356172280817776611559054940821608",
                "1496891404631255331849889593757206556",
                "11313395195125093685026026725872315432",
                "244063141634822240045835087738732253572",
                "218526329141686370456661705955050812118",
                "55520315525176282722073128048626959304",
                "265026907594514400097390731047467065670",
                "47425390247326731793379367106281618640",
                "14271606582860514511203534933821148025",
                "274865434858619661652600779808177727612",
                "117797986007353263461408849077418831848",
                "24658908553801635356626148959630613544"
            ],
            "threshold": 0.9
        },
        "id": "OSEC-2026-25-b1be9684",
        "signature_type": "Line",
        "signature_version": "v1",
        "source": "https://github.com/ocaml/ocaml/commit/9dcf0c86201cf5e8ece56c6bb5f61fc4d92fb74a",
        "target": {
            "file": "otherlibs/runtime_events/runtime_events_consumer.c"
        }
    },
    {
        "deprecated": false,
        "digest": {
            "function_hash": "195656919428473743133317654948363569234",
            "length": 1440
        },
        "id": "OSEC-2026-25-c8d97da5",
        "signature_type": "Function",
        "signature_version": "v1",
        "source": "https://github.com/ocaml/ocaml/commit/9dcf0c86201cf5e8ece56c6bb5f61fc4d92fb74a",
        "target": {
            "file": "otherlibs/runtime_events/runtime_events_consumer.c",
            "function": "ml_user_custom"
        }
    },
    {
        "deprecated": false,
        "digest": {
            "function_hash": "13563099896691476617241590411785077907",
            "length": 5727
        },
        "id": "OSEC-2026-25-d7719c52",
        "signature_type": "Function",
        "signature_version": "v1",
        "source": "https://github.com/ocaml/ocaml/commit/9dcf0c86201cf5e8ece56c6bb5f61fc4d92fb74a",
        "target": {
            "file": "otherlibs/runtime_events/runtime_events_consumer.c",
            "function": "caml_runtime_events_read_poll"
        }
    }
]
vanir_signatures_modified
"2026-11-06T19:14:06Z"