Executive brief
OpenPGP.js is a popular library for implementing OpenPGP encryption and decryption in JavaScript applications. Versions 1.2.0 and earlier contain a flaw that allows an attacker to craft malicious PGP keys that bypass passphrase validation, causing the library to decrypt messages without requiring the correct password. If an application uses message decryption as an authentication mechanism, an attacker could forge or access encrypted communications intended for others.
Technical details
The vulnerability exists in the s2k.js module, which handles key derivation functions (S2K) used to convert passphrases into encryption keys. The library fails to properly validate unsupported S2K types, allowing an attacker to craft a symmetrically encrypted PGP message with a malicious S2K specifier that causes the decryption routine to proceed without proper passphrase verification. The attack is network-reachable and requires no user interaction or authentication; an attacker sends a crafted PGP message to a target application. The fix, released in version 1.3.0, adds exception handling to reject unsupported S2K types.
Affected products
- OpenPGP OpenPGP.js 1.2.0 and earlier
Timeline
- 2015-10-30: disclosed
- 2015: patched: Fix released in version 1.3.0
- 2022-05-17: advisory: GHSA-qmvq-f3fj-m3wg published