CVE-2026-17508: Password-based KDF cost parameters honoured unbounded from untrusted input across the remaining PBE entry points
In Bouncy Castle for Java before 1.86, several password-based key derivation entry points ran the KDF with cost parameters taken from the untrusted input being processed, without bounding them, so a small input could dictate an arbitrary amount of work before any password or integrity check could reject it. The affected paths are the RFC 9579 PBMAC1 MAC calculator builders, which took the PBKDF2 iteration count and derived-key length straight out of PBMAC1Params (JcePBMac1CalculatorBuilder, and PKCS12PBEUtils.createPBMac1Calculator reached from PKCS12PfxPdu.isMacValid); the scrypt parallelization parameter p in the PKCS#8 and PKCS#12 cost guards, which bounded only the cost parameter N and the block size r even though the scratch buffer scales with r times p, so the configured memory ceiling could be evaded entirely; the raw JCA PBKDF2 provider (org.bouncycastle.jcajce.provider.symmetric.PBEPBKDF2); and the bcrypt round count read from an encrypted OpenSSH v1 private key's own kdfoptions. Each now bounds the parameter before deriving, in line with the caps already applied elsewhere in the tree, with the OpenSSH round count configurable through the new org.bouncycastle.openssh.maxrounds property. This completes the bounding begun in 1.85 for the PKCS#8 / PBES2 decryptors (CVE-2026-15055). This issue also affects Bouncy Castle for Java LTS before 2.73.13, and Bouncy Castle for Java FIPS (BC-FJA) before bcpkix-fips 1.0.13 (1.0.X series), 2.0.13 (2.0.X series) and 2.1.13 (2.1.X series).
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Bouncy Castle for Javato a version that resolves this vulnerability.Fixed in 1.86 - Upgrade
Upgrade
Bouncy Castle for Java LTSto a version that resolves this vulnerability.Fixed in 2.73.13 - Upgrade
Upgrade
Bouncy Castle for Java FIPS (BC-FJA) 1.0.X seriesto a version that resolves this vulnerability.Fixed in 1.0.13 - Upgrade
Upgrade
Bouncy Castle for Java FIPS (BC-FJA) 2.0.X seriesto a version that resolves this vulnerability.Fixed in 2.0.13 - Upgrade
Upgrade
Bouncy Castle for Java FIPS (BC-FJA) 2.1.X seriesto a version that resolves this vulnerability.Fixed in 2.1.13
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using Bouncy Castle for Java before 1.86 are exposed when they process attacker-controlled password-based cryptographic data through the affected PBMAC1, PKCS#8, PKCS#12, raw JCA PBKDF2, or encrypted OpenSSH v1 private-key paths. The listed affected product lines include Bouncy Castle for Java, its LTS edition, and BC-FJA.
What does an attacker need to do to trigger the impact?
An attacker needs to cause the application to process crafted untrusted input containing excessive KDF cost parameters. No privileges are required, but user interaction is required according to the supplied CVSS vector.
What is the practical impact?
A small malicious input can request an arbitrary amount of KDF work before password or integrity validation rejects it. This can consume resources and reduce availability; the CVSS vector indicates availability impact only.
Are the affected KDF parameters the same across all formats?
No. PBMAC1 processing accepted PBKDF2 iteration counts and derived-key lengths, scrypt guards did not adequately account for the parallelization parameter p, raw JCA PBKDF2 was affected, and encrypted OpenSSH v1 keys accepted a bcrypt round count from their kdfoptions.
What changes address the issue?
The corrected behavior bounds KDF parameters before derivation, consistent with existing caps elsewhere in the code. For encrypted OpenSSH v1 keys, the bcrypt round-count limit is configurable through a new org.bouncycastle.openssh.max_r… setting; the provided data does not include its complete name or value.