REDHAT-BUG-2560029: Low severity crates/sequoia-openpgp vulnerability
A flaw was found in sequoia-openpgp. The default ASCII-armor ReaderMode is Tolerant. Header detection treats Unicode dash punctuation, including en dash and em dash, as armor framing dashes, and the header search ignores leading quote characters such as greater-than. A byte stream can therefore contain an out-of-specification armor region that this reader accepts and a later specification-compliant region that a strict reader accepts. The two readers then yield different data. sequoia-openpgp 2.4.2 has no ReaderMode::Strict. The unreleased fix adds that mode as an opt-in. The default remains tolerant.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Opt in to ReaderMode::Strict when using a version that includes the fix; sequoia-openpgp 2.4.2 does not provide this mode.
sequoia-openpgp ASCII-armor Reader ReaderMode = Strict
Event History
Frequently Asked Questions
Who is exposed to this parsing discrepancy?
Applications that use sequoia-openpgp to read ASCII-armored input and rely on its interpretation matching a specification-compliant or stricter downstream reader are exposed. The issue is relevant when attackers can supply or influence armored byte streams.
Does the default configuration accept the problematic input?
Yes. The default ASCII-armor ReaderMode is Tolerant, and it remains tolerant after the unreleased fix. Tolerant mode accepts Unicode dash punctuation as framing dashes and ignores leading quote characters during header search.
What does an attacker need to exploit this behavior?
An attacker needs to provide an ASCII-armored byte stream containing an out-of-specification armor region accepted by Sequoia's tolerant reader and a later region accepted by a strict reader. This can cause the two readers to yield different data from the same stream.
What mitigation is available if an application needs strict parsing?
The unreleased fix adds ReaderMode::Strict as an opt-in mode. sequoia-openpgp 2.4.2 does not provide ReaderMode::Strict, so applications on that version cannot enable this strict-mode mitigation.