Affected versions
OCaml / opammirage-crypto-pk
- Affected versions
- Unknown
- Fixed version
- 2.3.0
Exploitation
Description
The RSA decrypt and encrypt functions raise an Invalid_argument exception if the message is smaller than 2. This leads to X509 certificates with a signature value of 0 or 1 to throw this Invalid_argument exception instead of a proper error.
Fix
The fix is to reuse the Insufficient_key exception, which is documented and caught further up in the stack.
Timeline
July 28th 2026: report to security@ocaml.org
August 7th: release of mirage-crypto-pk 2.3.0 and security advisory
Credits
- Thomas Gazagnaire
- Hannes Mehnert

