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.
The fix is to reuse the Insufficient_key exception, which is documented and caught further up in the stack.
{
"cwe": [
"CWE-248"
],
"human_link": "https://github.com/ocaml/security-advisories/tree/main/advisories/2026/OSEC-2026-14.md",
"osv": "https://github.com/ocaml/security-advisories/tree/generated-osv/2026/OSEC-2026-14.json"
}{
"affected_bindings": [
"Mirage_crypto_pk.Rsa.encrypt",
"Mirage_crypto_pk.Rsa.decrypt",
"Mirage_crypto_pk.Rsa.PKCS1.encrypt",
"Mirage_crypto_pk.Rsa.PKCS1.decrypt",
"Mirage_crypto_pk.Rsa.PKCS1.sig_encode",
"Mirage_crypto_pk.Rsa.PKCS1.sig_decode",
"Mirage_crypto_pk.Rsa.PKCS1.sign",
"Mirage_crypto_pk.Rsa.PKCS1.verify",
"Mirage_crypto_pk.Rsa.OAEP.encrypt",
"Mirage_crypto_pk.Rsa.OAEP.decrypt",
"Mirage_crypto_pk.Rsa.PSS.sign",
"Mirage_crypto_pk.Rsa.PSS.verify"
],
"opam_constraint": "mirage-crypto-pk {< \"2.3.0\"}"
}