Junglewise Threat Intelligence

CVE-2024-53441: cookie-encrypter AES CBC bit flip attack

CVE-2024-53441 · Severity: low · CVSS 3.1 · Published 2024-12-09

Vendors: npm.

Executive brief

cookie-encrypter is a Node.js library that encrypts HTTP cookies to protect sensitive data in transit and storage. A weakness in its AES-CBC encryption implementation allows attackers to manipulate encrypted cookies without knowing the encryption key, potentially escalating privileges or forging authentication states. The attack exploits the predictable initialization vector (IV) to flip specific bits in the plaintext without decryption.

Technical details

The vulnerability is an AES-CBC mode bit flipping attack (CWE-325, CWE-327) affecting cookie-encrypter up to version 1.0.1. The root cause is the use of a predictable or world-visible initialization vector in CBC mode encryption. An attacker can observe the IV in encrypted cookies (transmitted in plaintext or predictable format) and perform XOR operations to flip bits in the decrypted plaintext without knowing the encryption key. The attack requires no authentication or user interaction and is network-accessible. An attacker can modify cookie values (e.g., change "guest" role to "admin") to escalate privileges or forge authentication tokens. No patch is currently available in the reference materials provided.

Affected products

  • npm cookie-encrypter up to 1.0.1

Timeline

  • 2024-12-06: disclosed: Vulnerability disclosed on GitHub
  • 2024-12-09: advisory: GHSA-h63v-hw6g-x8hp published
  • 2024-12-09: other: CVE-2024-53441 assigned

References