Vulnerability in mirage-crypto package
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-87732 has been found in mirage-crypto package.
Data can be tampered with by attackers. CVSS score: 6.2/10.
What to do: apply the vendor's official patched release.
If unsure, ask your IT team or search "mirage-crypto package CVE-2026-87732" on the vendor's site.
CVE-2026-87732 (mirage-crypto package) — CWE-347 / CVSS v3 6.2
Attack vector: local / unauthenticated / no user interaction
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-347) exists in mirage-crypto package.
Check the vendor advisory for the affected versions of mirage-crypto package.
Severity: Medium (CVSS 6.2/10). Data can be tampered with by attackers.
Update to the patched release per vendor advisory.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Audit SBOM/dependencies to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1
Identify exposureidentify
Audit SBOM/dependencies for affected components.資産台帳・SBOM・依存マニフェストで mirage-crypto package を使っているサービスとバージョンを洗い出す。
-
2
Post-deployment verificationverify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| opammirage-crypto |
< 2.2.0→ 2.2.0 |
2.2.0 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- Debian DEBIAN-CVE-2026-87732 ocaml-mirage-crypto Fix available
- Ubuntu UBUNTU-CVE-2026-87732 ocaml-mirage-crypto No fixed version in this record
Original description The description as published by the source.
On the generic GCM path, AES.GCM.authenticate_decrypt_into (as well as Chacha20.authenticate_decrypt_into and AES.CCM16.authenticate_decrypt_into) writes the decrypted plaintext into the caller's destination buffer and only then compares the tag. On a forged tag the function returns false, but the destination buffer already holds the full plaintext. AEAD decryption is meant to be all-or-nothing: no plaintext should be released until the tag verifies. This is a release of unverified plaintext, and a caller that reads the buffer without first checking the return value sees forged-but-decrypted data. RustCrypto's aes-gcm fixed the same defect in CVE-2023-42811 (rated medium) by re-encrypting the buffer on tag failure.
Solution
The tag is validated first, and only if the tag is valid, the decryption into the provided buffer is done. In the CCM code, the tag is computed over the plaintext - if the tag validation fails, the provided buffer is zeroed.
Reproduction
module GCM = Mirage_crypto.AES.GCM
let () =
let key = GCM.of_secret (String.make 32 '\x00') in
let nonce = String.make 12 '\x00' in
let secret = "let password = 42" in
let len = String.length secret in
let blob = GCM.authenticate_encrypt ~key ~nonce secret in
(* flip one bit of the 16-byte tag (at offset len); the ciphertext is untouched *)
let forged = Bytes.of_string blob in
Bytes.set forged len (Char.chr (Char.code (Bytes.get forged len) lxor 1));
let forged = Bytes.unsafe_to_…
Source: NIST National Vulnerability Database NVD GitHub Advisory
References
- web osv.dev
- web nvd.nist.gov
- web github.com