CVE-2026-134622: Crypt::OpenPGP versions before 1.22 for Perl let a key with a colliding short key ID stand in for the intended key in encrypt and verify
Crypt::OpenPGP versions before 1.22 for Perl let a key with a colliding short key ID stand in for the intended key in encrypt and verify.
findkeyblockbykeyid matches a key when the trailing bytes of its key ID equal the ID given, however short. keybyid falls back to the last 4 bytes when the full 8-byte key ID has no match. The key server lookup cuts the key ID to its last 4 bytes before querying and takes the first key returned. No lookup compares a fingerprint.
encrypt treats a Recipients entry of 8 hex digits as a 4-byte key ID and encrypts to every key in the keyring whose ID ends in those bytes. verify fetches the signer's key from the key server by its last 4 bytes when AutoKeyRetrieve is set and the keyring has no match.
An attacker who places a key with a colliding 32-bit key ID in the keyring or on the key server in use gets a copy of each message encrypted to the short ID, and has signatures made with that key reported valid under a user ID of their choosing.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Crypt-OpenPGPto a version that resolves this vulnerability.Fixed in 1.22
Event History
Frequently Asked Questions
Which deployments are exposed to message disclosure?
Deployments that encrypt using an 8-hex-digit Recipients value are exposed if an attacker can place a key in the keyring with the same trailing 32-bit key ID. Encryption is performed to every matching key, allowing the attacker to receive a decryptable copy.
When can signature verification be spoofed?
Verification is vulnerable when a colliding key is available in the local keyring, or when AutoKeyRetrieve is enabled and the keyring has no matching key. In the latter case, the library queries the configured key server using only the final 4 bytes and accepts the first returned key.
What should be checked while patching is pending?
Review Recipients entries for 8-hex-digit key IDs, inspect keyrings for keys sharing trailing 4-byte IDs with trusted recipients or signers, and review whether AutoKeyRetrieve is enabled. Also examine the key server in use for colliding keys that could be returned for those shortened IDs.
What change addresses the issue?
Upgrade Crypt::OpenPGP to version 1.22 or later. Versions before 1.22 perform key matching and key-server retrieval using truncated key IDs rather than comparing fingerprints.