Insufficient Entropy Affecting pubnub package, versions <4.3.0



    Attack Complexity High
    Confidentiality High

    Threat Intelligence

    EPSS 0.11% (43rd percentile)
Expand this section
5.9 medium

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-PUB-PUBNUB-6098385
  • published 5 Dec 2023
  • disclosed 13 Aug 2023
  • credit Varga Daniel

How to fix?

Upgrade pubnub to version 4.3.0 or higher.


Affected versions of this package are vulnerable to Insufficient Entropy via the getKey function, due to inefficient implementation of the AES-256-CBC cryptographic algorithm. The provided encrypt function is less secure when hex encoding and trimming are applied, leaving half of the bits in the key always the same for every encoded message or file.


In order to exploit this vulnerability, the attacker needs to invest resources in preparing the attack and brute-force the encryption.