You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1a269ca
Browse filesBrowse the repository at this point in the historyBrowse files
Require the signed-message envelope handed to AIMerSigner.verifySignature to be exactly the message plus the parameter set's signature size, so that a short signature is reported as a failed verification rather than indexed past its end, and a valid one with data appended to it no longer verifies, relates to github #2401.
Copy file name to clipboardExpand all lines: CONTRIBUTORS.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -594,7 +594,7 @@
594
594
<li>subbudvk <https://github.com/subbudvk> - initial author on S2K parser hardening work for OpenPGP API.</li>
595
595
<li>mkarasik <https://github.com/mkarasik> - initial work on EST server-side key generation (RFC 7030 4.4).</li>
596
596
<li>Bernd Prünster (A-SIT Plus) <bernd.pruenster@a-sit.at> - reported lenient ASN.1 UTCTime/GeneralizedTime parsing accepting structurally malformed content, with fuzzing-derived test cases.</li>
597
-
<li>Naveed Khan <https://github.com/rootvector2> - constant time comparison of membership and confirmation tags in the MLS API. Reported unbounded array allocation in the BKS/UBER keystore load path (OutOfMemoryError DoS from a crafted keystore) and introduction of a capped decompression limit in PGPCompressedData.getDataStream(), both with POC. Original submission creating S/MIME backing temp files with owner-only permissions (PR #2326). Rejecting empty sequences in the X.509 extension parsers whose RFC 5280 syntax is SEQUENCE SIZE (1..MAX) - CRLDistPoint, CertificatePolicies, ExtendedKeyUsage, PolicyMappings, and SubjectDirectoryAttributes (PR #2331). Hardening asn1.cms.SignerInfo decode to reject a non-INTEGER version or non-tagged unsignedAttrs via getInstance rather than leaking a ClassCastException (PR #2342). Fixing an off-by-4 header-length guard in the OpenPGP NotationData signature subpacket parser (PR #2346). Rejecting CR/LF in the S/MIME streaming writer header names and values (SMIMEEnvelopedWriter/SMIMESignedWriter withHeader) to prevent MIME header injection (PR #2348). Adding minimum-length guards to the SM2 decrypt and GOST28147/DSTU7624/DESede/RC2 key-wrap unwrap paths (PR #2359). Guarding the ECDH session-key length in the JCE OpenPGP decryptor (PR #2383). Fixing the identity fast-path type guards in the OER getInstance factories and the transposed isInstance arguments in OEROptional.getObject (PR #2373).</li>
597
+
<li>Naveed Khan <https://github.com/rootvector2> - constant time comparison of membership and confirmation tags in the MLS API. Reported unbounded array allocation in the BKS/UBER keystore load path (OutOfMemoryError DoS from a crafted keystore) and introduction of a capped decompression limit in PGPCompressedData.getDataStream(), both with POC. Original submission creating S/MIME backing temp files with owner-only permissions (PR #2326). Rejecting empty sequences in the X.509 extension parsers whose RFC 5280 syntax is SEQUENCE SIZE (1..MAX) - CRLDistPoint, CertificatePolicies, ExtendedKeyUsage, PolicyMappings, and SubjectDirectoryAttributes (PR #2331). Hardening asn1.cms.SignerInfo decode to reject a non-INTEGER version or non-tagged unsignedAttrs via getInstance rather than leaking a ClassCastException (PR #2342). Fixing an off-by-4 header-length guard in the OpenPGP NotationData signature subpacket parser (PR #2346). Rejecting CR/LF in the S/MIME streaming writer header names and values (SMIMEEnvelopedWriter/SMIMESignedWriter withHeader) to prevent MIME header injection (PR #2348). Adding minimum-length guards to the SM2 decrypt and GOST28147/DSTU7624/DESede/RC2 key-wrap unwrap paths (PR #2359). Guarding the ECDH session-key length in the JCE OpenPGP decryptor (PR #2383). Fixing the identity fast-path type guards in the OER getInstance factories and the transposed isInstance arguments in OEROptional.getObject (PR #2373). Requiring the signed-message envelope handed to AIMerSigner.verifySignature to be exactly the message plus the parameter set's signature size (PR #2401).</li>
598
598
<li>suraj0208 <https://github.com/suraj0208> - initial work on auto-detecting private key reader (JcaPrivateKeyReader).</li>
599
599
<li>liamgilligan <https://github.com/liamgilligan> - noticing the BIP-340 step numbering in the BIP340Signer signing comments was incorrect (PR #2340).</li>
600
600
<li>digi-scrypt <https://github.com/digi-scrypt> - disabling DTD and external-entity resolution in KMIPInputStream to close an XXE (local file disclosure / SSRF) exposure in KMIP XML parsing (PR #2315).</li>
Copy file name to clipboardExpand all lines: docs/releasenotes.html
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,7 @@ <h3>2.1.2 Defects Fixed</h3>
137
137
<li>A TLS server that answered a client's "status_request" or "status_request_v2" extension stored the echo it sent in the session, along with the rest of its ServerHello extensions, and replayed it on every abbreviated handshake that resumed that session. An abbreviated handshake sends neither a Certificate nor a CertificateStatus message, so the echo announced a message that could not follow - and it was replayed whether or not the resuming ClientHello had offered the extension at all. RFC 5246 sec. 7.4.1.4 requires a client receiving an extension it did not request to abort with an unsupported_extension alert, which is what BouncyCastle's own client does, so a resumption by a client that did not re-offer the extension failed outright. TlsServerProtocol and DTLSServerProtocol now drop both echoes from the extensions they replay on a resumed handshake, through the new TlsExtensionsUtils.removeStatusRequestExtensions; a client that did re-offer the extension is unaffected apart from no longer receiving an echo answering nothing. Servers that never answered a status request - the default for both the low-level API and the JSSE provider - were never affected.</li>
138
138
<li>org.bouncycastle.operator.DefaultKemEncapsulationLengthProvider.getEncapsulationLength() looked its argument up in a table of the KEMs whose encapsulation lengths are registered - ML-KEM, NTRU, HQC, FrodoKEM and composite ML-KEM - and dereferenced the result without checking it. A CMS RFC 9629 KEMRecipientInfo recipient using any other KEM which does register a key wrapping cipher, BIKE, NTRU+ or SMAUG-T, got as far as the wrap and then failed with a NullPointerException carrying no indication of which algorithm was at fault. The lookup now throws IllegalArgumentException naming the KEM's OID, as the sibling DefaultKemAlgorithmIdentifierFinder does, and the contract is documented on the KemEncapsulationLengthProvider interface (github #2398).</li>
139
139
<li>AbstractTlsServer.notifyHandshakeBeginning() cleared the "status_request" extension recorded from the previous ClientHello but not "status_request_v2" or "trusted_ca_keys", which processClientExtensions assigns only when the ClientHello carries any extensions at all. A TlsServer instance driven through more than one handshake - a renegotiation, say - therefore carried both fields over, and a following ClientHello with no extensions had the server decide whether to echo them from the earlier handshake's values, sending the client an extension it had not offered; RFC 5246 sec. 7.4.1.4 has a client abort with unsupported_extension over exactly that. Both are now cleared alongside "status_request". Reaching this needed a TlsServer overriding allowMultiCertStatus() or allowTrustedCAIndication(), which default to false and, for the JSSE provider, were not previously settable at all.</li>
140
+
<li>org.bouncycastle.pqc.crypto.aimer.AIMerSigner.verifySignature() sliced the signature out of the signed-message envelope generateSignature() produces - the message followed by the signature - at offset message.length without first checking the envelope was that long. A truncated or otherwise short signature therefore threw ArrayIndexOutOfBoundsException instead of returning false, which reached the caller unchecked out of Signature.verify() on the BCPQC "AIMer" services, and because only the signature-sized run of bytes at that offset was read, a valid signature with data appended to it still verified, so the accepted encoding was not unique. The envelope is now required to be exactly message.length plus the parameter set's signature size before it is read, and anything else is reported as a failed verification, matching the guard the Falcon, Faest, Mayo, Snova and QRUOV signers already apply. A correctly formed signature is unaffected (github #2401).</li>
140
141
</ul>
141
142
142
143
<h3>2.1.3 Additional Features and Functionality</h3>
0 commit comments