CVE-2026-63574: Unbounded allocation from OpenPGP signature and user attribute subpacket lengths
Memory allocation with excessive size value in the OpenPGP signature and user attribute subpacket parsers (SignatureSubpacketsParser.ReadPacket, UserAttributeSubpacketsParser.ReadPacket) in Legion of the Bouncy Castle Inc. bc-csharp before 2.7.0 allows a remote, unauthenticated attacker who can supply a crafted OpenPGP public key, certificate or signature to cause a denial of service (OutOfMemoryException or memory exhaustion in the parsing process) via a subpacket header using the five-octet length form, because the declared length was used to size the subpacket buffer with no upper bound and without being compared with the size of the enclosing subpacket area or packet, so a few bytes of input could demand an allocation of up to about 2 GB before any subpacket data was read.
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
Which deployments are exposed to this denial-of-service issue?
Deployments using bc-csharp before version 2.7.0 are affected if they parse OpenPGP public keys, certificates, or signatures that can be supplied by a remote party. The vulnerable code paths are the signature and user attribute subpacket parsers.
What does an attacker need to exploit the issue?
An attacker does not need authentication or user interaction. They need only to provide a crafted OpenPGP public key, certificate, or signature containing a subpacket header encoded with the five-octet length form.
What is the operational impact of successful exploitation?
The parsing process can attempt to allocate up to about 2 GB based on only a few bytes of attacker-controlled input. This can trigger an OutOfMemoryException or exhaust available memory, causing denial of service.
Is immediate mitigation available if upgrading is delayed?
The provided information identifies version 2.7.0 as the fixed boundary but does not specify a workaround. Until an upgrade is possible, reduce or prevent parsing of untrusted OpenPGP keys, certificates, and signatures where feasible.