Junglewise Threat Intelligence

tEnvoy improper cryptographic signature verification

Severity: low · CVSS 3.1 · Published 2021-06-21

Vendors: npm.

Executive brief

tEnvoy is a JavaScript cryptography library used for secure message signing and verification. A critical flaw in the signature verification method allowed any signature to pass validation if its hash matched the message's hash, regardless of whether the signature was actually valid. This could enable attackers to forge signatures and impersonate legitimate users or systems relying on this library.

Technical details

The vulnerability is a cryptographic signature verification bypass (CWE-347) in the verifyWithMessage method of the tEnvoyNaClSigningKey class. The vulnerable code failed to check the .verified property of the signature verification result, instead returning true whenever a SHA-512 hash matched the message hash. This allowed an attacker to craft invalid signatures that would be accepted as valid. The vulnerability affects all versions prior to 7.0.3 and was patched by modifying the return statement to properly check the .verified flag. No authentication or user interaction is required to exploit this; any code using the verifyWithMessage method is vulnerable.

Affected products

  • TogaTech tEnvoy < 7.0.3

Timeline

  • 2021-06-15: disclosed: Vulnerability published as GHSA-7r96-8g3x-g36m
  • 2021-06-15: patched: Version 7.0.3 released with fix

References

Related threats