Skip to main content

Improper Verification of Cryptographic Signature

CVE-2023-41037

Severity Medium
Score 4.3/10

Summary

OpenPGP.js is a JavaScript implementation of the OpenPGP protocol. In affected versions, OpenPGP Cleartext Signed Messages are cryptographically signed messages where the signed text is readable without special tools. These messages typically contain a "Hash: ..." header declaring the hash algorithm used to compute the signature digest. OpenPGP.js versions through 4.10.10, and 5.0.0-0 through 5.10.0 ignored any data preceding the "Hash: ..." texts when verifying the signature. As a result, malicious parties could add arbitrary text to a third-party Cleartext Signed Message, to lead the victim to believe that the arbitrary text was signed. A user or application is vulnerable to said attack vector if it verifies the CleartextMessage by only checking the returned "verified" property, discarding the associated `data` information, and instead _visually trusting_ the contents of the original message. Since "verificationResult.data" would always contain the actual signed data, users and apps that check this information are not vulnerable. Similarly, given a CleartextMessage object, retrieving the data using "getText()" or the "text" field returns only the contents that are considered when verifying the signature. Finally, re-armoring a CleartextMessage object (using "armor()" will also result in a "sanitized" version, with the extraneous text being removed. Version 5.10.1 (current stable version) will reject messages when calling "openpgp.readCleartextMessage()" and the version 4.10.11 (legacy version) will reject messages when calling "openpgp.cleartext.readArmored()". Users unable to upgrade should check the contents of "verificationResult.data" to see what data was actually signed, rather than visually trusting the contents of the armored message.

  • LOW
  • NETWORK
  • LOW
  • UNCHANGED
  • REQUIRED
  • NONE
  • NONE
  • NONE

CWE-347 - Improper Verification of Cryptographic Signature

A cryptographic protocol is meant to ensure that services are provided in a secure manner. An application with absent or improper verification of cryptographic signatures allows malicious users to feed false messages to valid users or to disclose sensitive data, subverting the goals of the protocol. This can lead to security failures such as false authentication, account hijacking, and privilege escalation.

Advisory Timeline

  • Published