Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-71887 Overview
CVE-2026-71887 is a signature verification flaw in Bouncy Castle for Java versions before 1.86. The high-level OpenPGP API accepts a data signature from a signing subkey whose Subkey Binding signature omits both the embedded Primary Key Binding (cross-certification) signature and a Key Flags subpacket. An attacker can graft a victim's public signing subkey under an attacker-controlled primary key and have genuine messages verified as issued by the attacker's certificate. The flaw maps to improper signature verification [CWE-345].
Critical Impact
Attackers can cause relying parties to attribute a victim's genuine OpenPGP signatures to an attacker-chosen identity without recovering any private key.
Affected Products
- Bouncy Castle for Java versions prior to 1.86
- OpenPGPCertificate high-level OpenPGP API
- Applications relying on OpenPGPSignature.OpenPGPDocumentSignature.isValid() for signature trust decisions
Discovery Timeline
- 2026-10-03 - CVE-2026-71887 published to NVD
- 2026-10-06 - Last updated in NVD database
Technical Details for CVE-2026-71887
Vulnerability Analysis
The flaw lies in how OpenPGPCertificate resolves a subkey's Key Flags along two inconsistent paths. The isSigningKey() method calls getKeyFlags() and getApplyingSubpacket(), which falls back to the primary key's direct-key or primary User ID self-signature when the Subkey Binding signature omits the subpacket. The subkey therefore inherits the primary's SIGN_DATA flag and is treated as signing-capable.
In contrast, verifyEmbeddedPrimaryKeyBinding() reads only the binding signature's own hashed subpackets. Finding no SIGN_DATA there, it returns early as a non-signing key and never demands the embedded Primary Key Binding signature required by RFC 9580 sections 5.2.1.8 and 10.1.3. The same subkey ends up signing-capable while exempt from cross-certification. GnuPG rejects the identical certificate and message.
Root Cause
Key Flags were inherited from certificate-wide signatures of the primary key rather than being treated as a statement about the key the carrying signature refers to, per RFC 9580 section 5.2.3.29. The two code paths consulted different flag sources, so the cross-certification enforcement path disagreed with the signing-capability path.
Attack Vector
An attacker needs only the victim's public signing subkey, which is public material. They bind it under their own primary key using a Subkey Binding signature they can produce, omitting both Key Flags and the embedded Primary Key Binding signature. A relying party verifying one of the victim's genuine messages against the attacker's certificate is told the signature is valid and shown the attacker's identity as the issuer. Verifiers that pin on subkey fingerprint while taking identity from the enclosing certificate report a real signature under an attacker-chosen name. The low-level PGPSignature and PGPPublicKeyRing API performs no binding checks by design and is unaffected.
PGPSignatureSubpacketVector hashedSubpackets = keySignature.getSignature().getHashedSubPackets();
if (hashedSubpackets == null || !hashedSubpackets.hasSubpacket(subpacketType))
{
+ if (subpacketType == SignatureSubpacketTags.KEY_FLAGS && this instanceof OpenPGPSubkey)
+ {
+ // Key Flags apply to the key their signature refers to (RFC9580, section 5.2.3.29) - not inherited
+ return null;
+ }
+
// If the subkey binding signature doesn't carry the desired subpacket,
// check direct-key or primary uid sig instead
OpenPGPSignatureChain preferenceBinding = getCertificate().getPreferenceSignature(evaluationTime);
Detect Identity Attacks the Moment Authentication Fails
Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.
Stop Identity AttacksDetection Methods for CVE-2026-71887
Indicators of Compromise
- OpenPGP certificates containing a Subkey Binding signature with no Key Flags subpacket and no embedded Primary Key Binding signature
- The same signing subkey fingerprint appearing bound under multiple distinct primary keys across received certificates
- Discrepancies where GnuPG rejects a certificate or signature that Bouncy Castle OpenPGPCertificate accepts as valid
Detection Strategies
- Inventory applications depending on bcpg-jdk and bcprov-jdk artifacts and flag versions below 1.86 for remediation
- Cross-verify high-trust OpenPGP signatures using an independent implementation such as GnuPG and alert on acceptance divergence
- Parse archived certificates for subkey binding signatures missing the embedded back signature on signing-capable subkeys
Monitoring Recommendations
- Log every call to OpenPGPSignature.OpenPGPDocumentSignature.isValid() with the resolved issuer certificate fingerprint and User ID for post-hoc audit
- Monitor dependency manifests and build pipelines for Bouncy Castle versions pulled transitively via other libraries
- Track newly imported certificates that reuse a subkey fingerprint already associated with a different primary key in the trust store
How to Mitigate CVE-2026-71887
Immediate Actions Required
- Upgrade Bouncy Castle for Java to version 1.86 or later across all deployments
- Audit code paths that trust the high-level OpenPGPCertificate API for signature attribution decisions
- Re-verify any security-critical signatures previously validated by vulnerable versions against an unaffected implementation
Patch Information
The fix is applied in pg/src/main/java/org/bouncycastle/openpgp/api/OpenPGPCertificate.java. When the requested subpacket is KEY_FLAGS and the context is an OpenPGPSubkey, resolution now returns null instead of falling back to the primary key's self-signature. This aligns the signing-capability check with the cross-certification enforcement path. See the Bouncy Castle CVE-2026-71887 Wiki for vendor guidance.
Workarounds
- Replace high-level OpenPGPCertificate verification with the low-level PGPSignature and PGPPublicKeyRing API combined with explicit back-signature checks when upgrading is not immediately possible
- Require that signing subkeys in trusted certificates carry an explicit Key Flags subpacket and an embedded Primary Key Binding signature before acceptance
- Pin trust to full certificate fingerprints rather than inferring identity from the enclosing certificate when the subkey fingerprint matches
# Maven dependency update to patched version
# pom.xml
# <dependency>
# <groupId>org.bouncycastle</groupId>
# <artifactId>bcpg-jdk18on</artifactId>
# <version>1.86</version>
# </dependency>
mvn versions:set-property -Dproperty=bouncycastle.version -DnewVersion=1.86
mvn dependency:tree | grep bouncycastle
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

