Skip to main content

mirage-crypto CVE-2026-87732

| EUVDEUVD-2026-74618 MEDIUM
Improper Verification of Cryptographic Signature (CWE-347)
2026-09-09 mitre GHSA-vqxm-cgmv-2pcr
6.2
CVSS 3.1 · Vendor: mitre
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit forged ciphertext to target endpoint
  2. Delivery
    Library writes plaintext to buffer before tag check
  3. Exploit
    Tag verification fails, function returns false
  4. Execution
    Application reads buffer without checking return
  5. Persist
    Forged plaintext processed as authenticated data
  6. Impact
    Privilege escalation or identity spoofing

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A04:2025 - Cryptographic Failures
ASVS 5.0
V11 - Cryptography Signature verification
Exploitation Conditions

The vulnerability affects any OCaml application using mirage-crypto before 2.2.0 that calls AES.GCM.authenticate_decrypt_into or Chacha20.authenticate_decrypt_into and either (a) reads from the output buffer without first checking the boolean return value for authentication success, or (b) is subject to compiler or runtime optimizations that expose the buffer contents before the return value is evaluated. The attacker must be able to supply forged ciphertext to the decryption function - typical in network services accepting encrypted tokens, messages, or protocol frames. Exploitation is limited by correct caller discipline: an application that always checks the return value and immediately zeroes the buffer on failure is not vulnerable at the application level, though the library-level flaw persists. There is no authentication requirement imposed by the vulnerability itself; the attack surface depends entirely on whether the vulnerable decryption endpoint accepts unauthenticated input.

Impact

The provided CVSS vector (AV:L/AC:L/PR:N/UI:N/I:H) rates this at 6.2, but the local attack vector assignment is questionable - in the dominant real-world use pattern, forged ciphertext arrives over the network (JWE/JWT tokens, protocol messages), making AV:N more accurate. The I:H component is sound: a successful exploitation path allows an attacker to inject forged plaintext into the application's processing pipeline without cryptographic authentication. The 'Jwt Attack' tag corroborates that the intended exploitation scenario involves JOSE/JWT workflows where mirage-crypto handles authenticated decryption of token payloads. Even a mid-sized municipal IT team in mielec running OCaml services with JWT-based authentication should treat this as urgent if their stack depends on mirage-crypto for decryption, since a caller that consumes the output buffer regardless of the boolean return - a common programming oversight - becomes fully vulnerable. EPSS data is absent from the provided intelligence. No KEV listing and no public exploit code have been identified at time of analysis, which limits expected real-world exploitation volume in the short term, but the vulnerability's clean conceptual model means exploit construction is trivial once an attacker identifies a caller that mishandles the return value.

Exploit ScenarioDerived

An attacker targeting an OCaml web service that uses mirage-crypto to decrypt JWE tokens submits a crafted token containing arbitrary plaintext with a forged authentication tag. The AES.GCM.authenticate_decrypt_into call writes the attacker-controlled plaintext to the application's claims buffer; if the application's JWT handler extracts and trusts the buffer's contents before checking the boolean return value, the attacker's forged claims are processed as authenticated, enabling privilege escalation or identity spoofing. No public exploit code has been identified, but the attack model requires only the ability to submit forged ciphertext to the target endpoint.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 09, 2026

Authenticated decryption in mirage-crypto before 2.2.0 for OCaml violates the security invariant of AEAD schemes by writing decrypted plaintext into the caller-supplied output buffer before the authentication tag is verified. When a forged tag is detected, AES.GCM.authenticate_decrypt_into and Chacha20.authenticate_decrypt_into return false, but the destination buffer already contains the full unverified plaintext. Applications that process buffer contents without rigidly checking the boolean return value - or where timing or compiler behavior creates subtle access windows - may consume attacker-controlled forged plaintext as if it were authenticated. No public exploit or KEV listing has been identified at time of analysis.

RemediationAI

Upgrade to mirage-crypto 2.2.0 or later, which corrects the ordering to verify the authentication tag before writing any plaintext to the output buffer. The OSV record at https://osv.dev/vulnerability/OSEC-2026-12 is the authoritative reference for the fix. As a short-term workaround for deployments that cannot immediately upgrade, callers must treat the output buffer as poisoned whenever authenticate_decrypt_into returns false and must immediately zero and discard the buffer contents before any further processing; however, this mitigation is fragile and depends entirely on correct application-level discipline - it does not fix the library-level flaw. In security-sensitive pipelines such as JWT decryption, consider disabling the affected code paths until the upgrade is applied, accepting a denial-of-service trade-off in exchange for preventing integrity compromise.

Affected VersionsENISA

mirage-crypto 0 <2.2.0

Affected Packages

euvd mirage_crypto fix: 2.2.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

mirage-crypto (CPE: cpe:2.3:a:ocaml:mirage-crypto:*:*:*:*:*:*:*:*) is an OCaml cryptographic library targeting the MirageOS unikernel ecosystem, providing primitives including AES-GCM and ChaCha20-Poly1305 - both AEAD (Authenticated Encryption with Associated Data) constructions. The fundamental security property of AEAD is that plaintext must never be released to callers until the associated authentication tag has been verified. CWE-347 (Improper Verification of Cryptographic Signature) captures the root cause: the library inverts the correct 'verify-then-decrypt' ordering, instead performing 'decrypt-then-verify.' The two affected functions, AES.GCM.authenticate_decrypt_into and Chacha20.authenticate_decrypt_into, follow a write-then-check flow, meaning any forged ciphertext submitted to the function populates the output buffer prior to the tag comparison returning failure. All versions before 2.2.0 are affected per the EUVD entry (mirage-crypto 0 < 2.2.0).

Know when Ocaml gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (mitre) PRIMARY 6.2 MEDIUM
AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
vuln.today AI 7.5 HIGH

Forged ciphertext arrives over the network in typical deployments (JWT, protocol messages), so AV:N; no special conditions beyond submitting forged ciphertext.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

Lifecycle Timeline

1
Patch available
Sep 09, 2026 - 05:18 EUVD

DescriptionCVE.org

An issue was discovered in the mirage-crypto package before 2.2.0 for OCaml. The AES.GCM.authenticate_decrypt_into and Chacha20.authenticate_decrypt_into functions write the decrypted plaintext into a caller-provided buffer and only then compares the tag. On a forged tag, the functions returns false, but the destination buffer already holds the full plaintext.

Threat Intelligence Overview

EPSS Score
0.1%
Top 100% exploitable
Prevalence
Low
niche OCaml/MirageOS unikernel ecosystem library
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

31
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +31
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

More in Ocaml

View all
CVE-2017-9772 CRITICAL
9.8 Jun 23

Insufficient sanitisation in the OCaml compiler versions 4.04.0 and 4.04.1 allows external code to be executed with rais

CVE-2015-8869 CRITICAL
9.1 Jun 13

OCaml before 4.03.0 does not properly handle sign extensions, which allows remote attackers to conduct buffer overflow a

CVE-2018-9838 CRITICAL
9.8 Apr 06

The caml_ba_deserialize function in byterun/bigarray.c in the standard library in OCaml 4.06.0 has an integer overflow w

CVE-2026-89086 CRITICAL
9.1 Sep 10

Signature verification bypass in the OCaml jose library (ulrikstrid/ocaml-jose) before 0.11.0 lets attackers forge valid

CVE-2017-9779 HIGH
7.8 Sep 07

OCaml compiler allows attackers to have unspecified impact via unknown vectors, a similar issue to CVE-2017-9772 "but wi

CVE-2026-28364 HIGH
7.8 Feb 27

Heap memory corruption in the OCaml runtime (before 4.14.3 and 5.x before 5.4.1) lets an attacker who can feed crafted M

CVE-2026-41082 HIGH
7.8 Apr 16

Arbitrary file write in OCaml opam before 2.5.1 allows a malicious package to escape its intended installation scope: a

CVE-2026-87734 HIGH
7.5 Sep 09

Remote denial of service in the utcp OCaml TCP userspace library before version 0.0.6 is possible via crafted out-of-ord

CVE-2026-89087 HIGH
7.3 Sep 10

Index mishandling in the OCaml cstruct library before 6.3.0 allows network-reachable attackers to trigger partial confid

CVE-2026-96609 HIGH
7.1 Sep 23

Denial of service in Robur Albatross (specifically the albatross-console component) versions 1.0.0 through 2.x before 2.

CVE-2026-87733 MEDIUM
6.2 Sep 09

ECDSA signature forgery is possible in mirage-crypto-ec before 2.2.0 for OCaml because the P256, P384, and P521 pub_of_o

CVE-2026-87737 MEDIUM
5.9 Sep 09

Timing side-channel in mirage-crypto-ec before 2.4.0 for OCaml enables remote cryptographic key recovery by exploiting s

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy