Junglewise Threat Intelligence

CVE-2023-26154: GO-2023-2385 - Insufficient entropy in AES-256-CBC in github.com/pubnub/go

CVE-2023-26154 · Severity: low · CVSS 3.1 · Published 2024-01-02

Vendors: Packagist, Go, npm, Maven, PyPI.

Executive brief

PubNub is a real-time communication platform used by applications to send and receive encrypted messages. Due to an insufficient entropy flaw in the AES-256-CBC encryption implementation, the cryptographic keys generated are weakly randomized—half the key bits remain identical across all encrypted messages. An attacker with significant resources can brute-force the encryption to decrypt sensitive messages, potentially exposing confidential communications.

Technical details

The vulnerability is a cryptographic weakness (CWE-331) in PubNub's AES-256-CBC implementation across multiple SDK versions. The root cause lies in the getKey function, which uses inefficient hex encoding and trimming that results in half the key bits being predictable and constant across encryptions. An attacker can exploit this by performing resource-intensive brute-force attacks to recover encryption keys and decrypt messages. No authentication or user interaction is required; the attack is network-accessible. The vulnerability affects all versions before specific patch versions (e.g., npm/JavaScript 7.4.0, Go v7 7.2.0, Java Kotlin 7.7.0, C# .NET 6.19.0, Swift 6.2.0, and others). Patches have been released as of October–December 2023.

Affected products

  • PubNub pubnub all versions before 7.4.0
  • PubNub pubnub-kotlin all versions before 7.7.0
  • PubNub github.com/pubnub/go/v7 all versions before 7.2.0
  • PubNub github.com/pubnub/go all versions before 2023-10-16
  • PubNub pubnub/swift all versions before 6.2.0
  • PubNub Pubnub (.NET) all versions before 6.19.0
  • PubNub pubnub/c-core all versions before 4.5.0
  • PubNub pubnub/javascript all versions before 7.4.0
  • PubNub com.pubnub:pubnub (Java) all versions up to 4.6.5

Timeline

  • 2023-12-06: disclosed: Public advisory published
  • 2023-10-16: patched: Go SDK patched with new crypto implementation
  • 2023-08-13: other: Vulnerability initially disclosed to security researchers

References