DoS: Infinite loop handling unsupported certs in raw parser
Andrew Gallagher disclosed the following issue:
When running the debugging tool from https://gitlab.com/sequoia-pgp/utf8-status on a historical key dump, I encountered what appears to be an infinite loop. The key dump contains openpgp v3 keys, and on encountering the first such key in the dump, the following error message is repeated indefinitely:
Reading a cert: Invalid operation: Not a Key packet: Unknown(Unknown { common: Common { dummy: PhantomData<()> }, tag: Reserved, error: Malformed packet: unknown version, container: Container { unprocessed:
"03336B541B0000010400BC4E17AB58A7... (143 bytes)", digest: "E3ECB48C7A6A2400" } })
The offending key will cause this behaviour even if isolated from the rest of the key dump and passed to the utf8-status tool in a file by itself.
Steps to reproduce:
git clone https://gitlab.com/sequoia-pgp/utf8-status
cd utf8-status
cargo build
cargo run $TESTFILE
I have tested this against several v3 keys from the dump and the same issue can be reproduced. I attach two sample keys to this email.