ADVISORIES

GitHub Advisory Database

GHSA-5844-q3fc-56rh

pubnub Insufficient Entropy vulnerability

Details

Versions of the package pubnub before 7.4.0; all versions of the package com.pubnub:pubnub; versions of the package pubnub before 6.19.0; all versions of the package github.com/pubnub/go; versions of the package github.com/pubnub/go/v7 before 7.2.0; versions of the package pubnub before 7.3.0; versions of the package pubnub/pubnub before 6.1.0; versions of the package pubnub before 5.3.0; versions of the package pubnub before 0.4.0; versions of the package pubnub/c-core before 4.5.0; versions of the package com.pubnub:pubnub-kotlin before 7.7.0; versions of the package pubnub/swift before 6.2.0; versions of the package pubnub before 5.2.0; versions of the package pubnub before 4.3.0 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.

Note:

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

Affected packages

EcosystemPackageAffected versions
npmpubnub
All versions before 7.4.0 (fixed in 7.4.0)
Mavencom.pubnub:pubnub-kotlin
All versions before 7.7.0 (fixed in 7.7.0)
Mavencom.pubnub:pubnub
All versions up to and including 4.6.5
Gogithub.com/pubnub/go/v7
All versions before 7.2.0 (fixed in 7.2.0)
Gogithub.com/pubnub/go
All versions before 0.0.0-20231016150651-428517fef5b9 (fixed in 0.0.0-20231016150651-428517fef5b9)
Gogithub.com/pubnub/go/v6
All versions before 6.1.1-0.20231016150651-428517fef5b9 (fixed in 6.1.1-0.20231016150651-428517fef5b9)
Gogithub.com/pubnub/go/v5
All versions before 5.0.4-0.20231016150651-428517fef5b9 (fixed in 5.0.4-0.20231016150651-428517fef5b9)
NuGetPubnub
All versions before 6.19.0 (fixed in 6.19.0)
SwiftURLgithub.com/pubnub/swift
All versions before 6.2.0 (fixed in 6.2.0)
RubyGemspubnub
All versions before 5.3.0 (fixed in 5.3.0)
crates.iopubnub
All versions before 0.4.0 (fixed in 0.4.0)
Packagistpubnub/pubnub
All versions before 6.1.0 (fixed in 6.1.0)
Pubpubnub
All versions before 4.3.0 (fixed in 4.3.0)
PyPIpubnub
All versions before 7.3.0 (fixed in 7.3.0)

References