CVE-2026-13505
JSON

8.7high

Zeroisation of sensitive key material on garbage collection relies on finalization

Severity
8.7high CVSS:4.0 by bcorg
Exploit likelihood
0.25% (higher than 17% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
bcorg
Also known as
GHSA-98j2-6v39-78w8

Description

In Bouncy Castle for Java FIPS (BC-FJA) before bc-fips 1.0.2.7 (1.0.X series), 2.0.2 (2.0.X series) and 2.1.3 (2.1.X series), sensitive key material held by the AES and DESede engines, the SP 800-90A DRBGs, SymmetricSecretKey and the PBKD and scrypt parameter classes was zeroised on garbage collection by overriding Object.finalize. Finalization runs at an unspecified time and in an unspecified order and is serviced by a single finalizer thread, so where objects carrying a finalizer are allocated faster than that thread retires them the pending-finalization queue grows without bound: disposal falls arbitrarily far behind, which can contribute to an OutOfMemoryError under load, and the key material those objects hold stays resident in the heap for as long as they are queued, defeating the purpose of the zeroisation. The behaviour was not a problem on Java 8 or Java 11; it is later JVMs, on which finalization has been deprecated and progressively de-emphasised, where it becomes one. Disposal of these classes now runs from a java.lang.ref.Cleaner registered in the multi-release jdk1.9 overlay, so on Java 9 and later it no longer depends on the finalizer being scheduled. Bouncy Castle for Java (bcprov) and Bouncy Castle for Java LTS are not affected, as neither implements the finalizer-based zeroisation scheme.

Affected

Product or packageVersionsReported by
bc-fipsfrom 1.0.0 before 1.0.2.7, from 2.0.0 before 2.0.2, from 2.1.0 before 2.1.3CVE List
org.bouncycastle:bc-fips (Maven)before 1.0.2.7, from 2.0.0 before 2.0.2, from 2.1.0 before 2.1.3GitHub Advisory Database

All scores

bcorg8.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/U:Amber
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/U:Amber

Classification

CWE-772

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

In Bouncy Castle for Java FIPS (BC-FJA) before bc-fips 1.0.2.7 (1.0.X series), 2.0.2 (2.0.X series) and 2.1.3 (2.1.X series), sensitive key material held by the AES and DESede engines, the SP 800-90A DRBGs, SymmetricSecretKey and the PBKD and scrypt parameter classes was zeroised on garbage collection by overriding Object.finalize. Finalization runs at an unspecified time and in an unspecified order and is serviced by a single finalizer thread, so where objects carrying a finalizer are allocated faster than that thread retires them the pending-finalization queue grows without bound: disposal falls arbitrarily far behind, which can contribute to an OutOfMemoryError under load, and the key material those objects hold stays resident in the heap for as long as they are queued, defeating the purpose of the zeroisation. The behaviour was not a problem on Java 8 or Java 11; it is later JVMs, on which finalization has been deprecated and progressively de-emphasised, where it becomes one. Disposal of these classes now runs from a java.lang.ref.Cleaner registered in the multi-release jdk1.9 overlay, so on Java 9 and later it no longer depends on the finalizer being scheduled. Bouncy Castle for Java (bcprov) and Bouncy Castle for Java LTS are not affected, as neither implements the finalizer-based zeroisation scheme.

NVD (es)

En Bouncy Castle para Java FIPS (BC-FJA) antes de bc-fips 1.0.2.7 (serie 1.0.X), 2.0.2 (serie 2.0.X) y 2.1.3 (serie 2.1.X), el material de clave sensible mantenido por los motores AES y DESede, los DRBG SP 800-90A, SymmetricSecretKey y las clases de parámetros PBKD y scrypt se puso a cero en la recolección de basura al anular Object.finalize. La finalización se ejecuta en un momento no especificado y en un orden no especificado y es atendida por un único hilo finalizador, por lo que cuando los objetos que llevan un finalizador se asignan más rápido de lo que ese hilo los retira, la cola de finalización pendiente crece sin límite: la eliminación se retrasa arbitrariamente, lo que puede contribuir a un OutOfMemoryError bajo carga, y el material de clave que esos objetos contienen permanece residente en el montón mientras estén en cola, anulando el propósito de la puesta a cero. El comportamiento no era un problema en Java 8 o Java 11; son las JVM posteriores, en las que la finalización ha sido deprecada y progresivamente despriorizada, donde se convierte en un problema. La eliminación de estas clases ahora se ejecuta desde un java.lang.ref.Cleaner registrado en la superposición multi-lanzamiento jdk1.9, por lo que en Java 9 y posteriores ya no depende de que el finalizador sea programado. Bouncy Castle para Java (bcprov) y Bouncy Castle para Java LTS no se ven afectados, ya que ninguno implementa el esquema de puesta a cero basado en finalizador.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-13505 changed 2026-08-10CVE Terms of Use
GitHub Advisory DatabaseGHSA-98j2-6v39-78w8 changed 2026-09-18CC-BY-4.0
NVDCVE-2026-13505 changed 2026-10-23Public domain