# OSEC-2026-22: Integer overflow in Unix.map_file

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-10-23T21:30:00.000Z
- Modified: 2026-11-19T10:30:03.620Z

## Description

ANT-2026-6W9NPC2Q mmap dimension product integer overflow


## Fix

Use `caml_umul_overflow` instead of `*` when multiplying bigarray dimensions, which detects integer overflows and raise `Failure`.
Negative positions are also rejected by raising `Invalid_argument`.

## Am I affected?

If either the dimensions or the file size in a call to `Unix.map_file` from your code is user controllable then you are potentially affected.

## Score notes

The vulnerability is in a library, and the CVSS score is calculated [under worst case assumptions](https://www.first.org/cvss/v4.0/user-guide#Assessing-Vulnerabilities-in-Software-Libraries-and-Similar). For an actual application the score will depend on how much an attacker can control the input to this function (if at all).


## Timeline

- 2026-08-24: vulnerability was found
- 2026-08-27: forwarded report to security@ocaml.org
- 2026-09-29: fix merged to trunk

(As written by OCaml Security Advisories.)

## Affected

- ocaml (opam): before 4.14.5; from 5.0.0 before 5.5.2
- https://github.com/ocaml/ocaml: before de57bb4f59c3302260aaeaaa4dfee12695597d25; before ff978d2139ba638886c2565f2d86c0ee265840a5; before ed4860325cbb11bf05be34fae6ded8019159d182

## Sources

- OCaml Security Advisories: [OSEC-2026-22](https://osv.dev/vulnerability/OSEC-2026-22), CC0-1.0, modified 2026-11-19

---

Page: https://cve.day/OSEC-2026-22 · Whole record: https://cve.day/OSEC-2026-22.json · Rebuilt by cve.day 2026-11-25T22:56:18.364Z
