{"id":"OSEC-2026-22","aliases":["OSEC-2026-22"],"related":[],"kind":"vulnerability","state":"published","title":"Integer overflow in Unix.map_file","summary":"ANT-2026-6W9NPC2Q mmap dimension product integer overflow\n\n\n## Fix\n\nUse `caml_umul_overflow` instead of `*` when multiplying bigarray dimensions, which detects integer overflows and raise `Failure`.\nNegative positions are also rejected by raising `Invalid_argument`.\n\n## Am I affected?\n\nIf 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.\n\n## Score notes\n\nThe 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).\n\n\n## Timeline\n\n- 2026-08-24: vulnerability was found\n- 2026-08-27: forwarded report to security@ocaml.org\n- 2026-09-29: fix merged to trunk","summaryFormat":"markdown","summarySource":"osec","descriptions":[{"lang":"en","text":"ANT-2026-6W9NPC2Q mmap dimension product integer overflow\n\n\n## Fix\n\nUse `caml_umul_overflow` instead of `*` when multiplying bigarray dimensions, which detects integer overflows and raise `Failure`.\nNegative positions are also rejected by raising `Invalid_argument`.\n\n## Am I affected?\n\nIf 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.\n\n## Score notes\n\nThe 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).\n\n\n## Timeline\n\n- 2026-08-24: vulnerability was found\n- 2026-08-27: forwarded report to security@ocaml.org\n- 2026-09-29: fix merged to trunk","format":"markdown","source":"osec"}],"published":"2026-10-23T21:30:00.000Z","modified":"2026-11-19T10:30:03.620Z","severities":[{"scorer":"OCaml Security Advisories","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N/E:P"}],"cwes":[],"affected":[{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.14.5"},{"type":"ecosystem","introduced":"5.0.0","status":"affected","fixed":"5.5.2"}],"ecosystem":"opam","package":"ocaml","purl":"pkg:opam/ocaml","source":"osec"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"de57bb4f59c3302260aaeaaa4dfee12695597d25"},{"type":"git","introduced":"0","status":"affected","fixed":"ff978d2139ba638886c2565f2d86c0ee265840a5"},{"type":"git","introduced":"0","status":"affected","fixed":"ed4860325cbb11bf05be34fae6ded8019159d182"}],"repo":"https://github.com/ocaml/ocaml","source":"osec"}],"references":[],"credits":["Anthropic","Hannes Mehnert","Edwin Török","Nicolás Ojeda Bär","Xavier Leroy"],"sources":[{"source":"osec","name":"OCaml Security Advisories","id":"OSEC-2026-22","url":"https://osv.dev/vulnerability/OSEC-2026-22","licence":"CC0-1.0","modified":"2026-11-19T10:30:03.620Z"}],"updatedAt":"2026-11-25T22:56:18.364Z"}