Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit forged ciphertext to target endpoint
-
DeliveryLibrary writes plaintext to buffer before tag check
-
ExploitTag verification fails, function returns false
-
ExecutionApplication reads buffer without checking return
-
PersistForged plaintext processed as authenticated data
-
ImpactPrivilege 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 |
| 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 |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Forged ciphertext arrives over the network in typical deployments (JWT, protocol messages), so AV:N; no special conditions beyond submitting forged ciphertext.
Primary rating from Vendor (mitre).
CVSS VectorVendor: mitre
Lifecycle Timeline
1DescriptionCVE.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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Insufficient sanitisation in the OCaml compiler versions 4.04.0 and 4.04.1 allows external code to be executed with rais
OCaml before 4.03.0 does not properly handle sign extensions, which allows remote attackers to conduct buffer overflow a
The caml_ba_deserialize function in byterun/bigarray.c in the standard library in OCaml 4.06.0 has an integer overflow w
Signature verification bypass in the OCaml jose library (ulrikstrid/ocaml-jose) before 0.11.0 lets attackers forge valid
OCaml compiler allows attackers to have unspecified impact via unknown vectors, a similar issue to CVE-2017-9772 "but wi
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
Arbitrary file write in OCaml opam before 2.5.1 allows a malicious package to escape its intended installation scope: a
Remote denial of service in the utcp OCaml TCP userspace library before version 0.0.6 is possible via crafted out-of-ord
Index mishandling in the OCaml cstruct library before 6.3.0 allows network-reachable attackers to trigger partial confid
Denial of service in Robur Albatross (specifically the albatross-console component) versions 1.0.0 through 2.x before 2.
ECDSA signature forgery is possible in mirage-crypto-ec before 2.2.0 for OCaml because the P256, P384, and P521 pub_of_o
Timing side-channel in mirage-crypto-ec before 2.4.0 for OCaml enables remote cryptographic key recovery by exploiting s
EUVD-2026-74618
GHSA-vqxm-cgmv-2pcr
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB