The vulnerability is a stack overflow caused by unbounded recursion when parsing deeply nested OpenPGP messages. The analysis of the patch commit e82f2c7494ba277d62fd372d69b2c008473bbef8 clearly shows the root cause. The file src/composed/message/parser.rs contained a recursive function next which would call itself upon encountering a signature packet (Tag::Signature or Tag::OnePassSignature). This design is inherently vulnerable to stack exhaustion if a message contains a sufficiently large number of nested signatures.
The patch addresses this by completely refactoring the parser. The recursive next function is removed and replaced with an iterative approach implemented in a new MessageParser struct. This new parser uses a loop and a state machine to process message packets, collecting signature information in a vector (Vec<SignaturePacket>) instead of creating a deeply nested call stack. This change effectively mitigates the stack overflow vulnerability.
Further evidence is found in the test files. The patch adds new tests (message_many_one_pass_signatures, message_many_prefix_signatures) in tests/message_test.rs that specifically create and parse messages with 2000 signatures to ensure the new iterative implementation can handle them without crashing. This confirms that the recursive parsing was the issue and the iterative approach is the fix. The vulnerable function is therefore identified as pgp::composed::message::parser::next.