---
id: CVE-2026-87732
title: An issue was discovered in the mirage-crypto package before 2.2.0 for OCaml
summary: >-
  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…
severity: medium
cvss: 6.2
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'
cwe:
  - CWE-347
vendor: OCaml
product: mirage-crypto
affected:
  - mirage-crypto < 2.2.0
published: '2026-09-09'
updated: '2026-09-09'
sourceUpdated: '2026-09-09T16:04:24.933'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-87732'
references:
  - url: 'https://osv.dev/vulnerability/OSEC-2026-12'
    label: cve@mitre.org
  - url: 'https://osv.dev/vulnerability/OSEC-2026-12'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
tags:
  - nvd
  - cve.org
  - exploit-available
exploitAvailable: true
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-09-09T13:11:34.596764Z'
ingestedAt: '2026-09-09T05:00:01.767Z'
epss: 0.00077
epssPercentile: 0.00135
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
