Junglewise Threat Intelligence

simple-crypto-js AES-CBC padding oracle vulnerability

Severity: low · CVSS 3.1 · Published 2020-09-03

Vendors: npm.

Executive brief

simple-crypto-js is a JavaScript library used to encrypt and decrypt data. Versions before 2.3.0 use a cryptographic method (AES-CBC with PKCS#7 padding) that is vulnerable to padding oracle attacks, which allow attackers to decrypt encrypted messages without knowing the encryption key and potentially access sensitive data.

Technical details

The vulnerability is an insecure cryptography algorithm (CWE-327) in simple-crypto-js versions prior to 2.3.0. The library uses AES encryption in CBC mode with PKCS#7 padding, which is vulnerable to padding oracle attacks. An attacker can submit specially crafted ciphertexts and observe whether they decrypt to plaintext with valid padding, using this binary feedback to progressively recover the original plaintext without possessing the encryption key. The attack requires the ability to send ciphertexts to the system and receive feedback on padding validity, making it applicable to any networked service using this library to decrypt user-supplied input. The fix was released in version 2.3.0, which presumably switches to a more secure encryption mode or additional authentication mechanisms such as authenticated encryption (AEAD).

Affected products

  • danang-id simple-crypto-js <2.3.0

Timeline

  • 2019-10-13: disclosed: Issue opened on GitHub
  • 2020-05-08: patched: Fix merged in version 2.3.0
  • 2020-09-03: advisory: GHSA-5v7r-jg9r-vq44 published

References