Where
-Infinity
0

Crypt::OpenPGP versions before 1.22 for Perl report a user ID as the signer without checking its self-certification, so a rewritten user ID names the signer of a genuine signature.

A key block's primary user ID is the first user ID packet in the block, whatever it says. A user ID is tied to the key by a certification signature the primary key makes over both, and nothing checks for one. verify returns the primary user ID as its result for a good signature, and sign, encrypt and decrypt attach it to the key as its owner.

An attacker who can change a keyring file or supply a key block for import can rewrite a key's user ID without touching key material, and a genuine signature by that key then verifies with the attacker's text returned as the signer.

First published (updated )

Crypt::OpenPGP versions before 1.22 for Perl exit pgplet --decrypt with status 0 and no warning when the signature on a signed and encrypted message cannot be verified.

pgplet --decrypt prints the text decrypt returns, which it does whether or not the signature on it is good. The warning for a signature that could not be verified compares errstr, which ends in a newline, against a bare string, so it never fires. A signature that verifies as bad is reported, but with exit status 0, the same as a good one. pgplet run on the file with no command refuses a message whose signature cannot be verified.

An attacker with the recipient's public key and any signed message from the claimed sender can alter the signed text and encrypt it to the recipient, and pgplet --decrypt prints it with nothing to tell it from text that was never signed.

First published (updated )

Crypt::OpenPGP versions before 1.22 for Perl die on malformed messages in verify and decrypt instead of returning an error.

verify and decrypt, and handle which calls them, use packets from the message and from the decrypted content as the expected kind without checking what they are. A signature with no issuer subpacket, a one-pass signature packet with no signature after it, a message or decrypted content with no data packet where one is expected, a session key packet with an unsupported or mismatched algorithm, and a signature that names a key that cannot sign each make Perl die rather than return an error. These are reached before any cryptographic check, or with no more than the recipient's public key.

The documented contract is to return undef and set errstr, so a remote attacker who supplies such a message ends a process that calls verify, decrypt or handle without eval.

First published (updated )

Crypt::OpenPGP versions before 1.22 for Perl decrypt messages that carry no modification detection code, so changes an attacker makes to the ciphertext alter the plaintext undetected.

Whether the plaintext is checked against a modification detection code is decided by the type of the encrypted data packet in the message. A Symmetrically Encrypted Data packet carries none, and decrypt, and handle which calls it, accept one with no option to require the code. encrypt produces this packet type unless MDC is set.

An attacker who can alter a message before it is decrypted can flip chosen bits of the plaintext, as the data is encrypted in CFB mode, and the caller gets the changed plaintext with no error.

First published (updated )

Crypt::OpenPGP versions before 1.22 for Perl use a subkey without checking its binding signature, so a signature by a subkey added to a key block verifies as the key's owner.

A key block takes every subkey packet that follows its primary key as one of its keys. A subkey is tied to the primary key by a binding signature the primary key makes over both, and nothing checks for one. keybyid, signingkey and encryptingkey return such a subkey, and findkeyblockbykeyid matches a key block through it.

An attacker who can change a keyring file or a key server's response can add a subkey of their own to another key block. A message signed with it then verifies as signed by that key's owner, and a message encrypted to the owner can go to the attacker's subkey when the primary key cannot encrypt.

First published (updated )

Crypt::OpenPGP versions before 1.22 for Perl allow memory exhaustion via unbounded inflation of compressed data packets in decompress.

A compressed data packet is inflated in a single Compress::Zlib call with no limit on the output size, and the whole output is held in memory before any packet in it is parsed. Both handle and verify inflate a leading compressed packet before any signature is checked. After decryption, decrypt inflates one too, and with public-key encryption anyone holding the recipient's public key can produce a message that decrypts.

A remote attacker who supplies a message to handle, verify or decrypt can exhaust the process's memory with a small packet.

First published (updated )

Crypt::OpenPGP versions before 1.22 for Perl accept a signature over text to which trailing whitespace has been added, as verify tries the hash with and without it.

For a text signature, verify hashes the data twice, with and without whitespace at the end of each line removed, and accepts the signature if either hash matches. Whether the data is hashed as text follows the mode of the literal data packet, which the signature does not cover, rather than the signature type. A binary signature over data that text canonicalisation leaves unchanged therefore accepts the same addition once the packet is marked as text.

An attacker who can alter a signed message can add whitespace at the end of any line, and verify still reports the signature valid.

First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203