Vulnerabilities in pkg:golang/github.com/pubnub/go/v7

PACKAGE
Advisory Identifier: GHSA-5844-q3fc-56rh
Advisory Summary

CVE-2023-26154 is a MODERATE (CVSS 5.9) pubnub insufficient entropy vulnerability vulnerability (CWE-331: Insufficient Entropy) affecting Pubnub libraries in the npm ecosystem. The issue involves pubnub insufficient entropy vulnerability. Remediation is available by upgrading affected packages to version 7.4.0, 7.7.0, 7.2.0, 0.0.0-20231016150651-428517fef5b9, 6.1.1-0.20231016150651-428517fef5b9, 5.0.4-0.20231016150651-428517fef5b9, 6.19.0, 6.2.0, 5.3.0, 0.4.0, 6.1.0, 4.3.0, 7.3.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/pubnub/go/v7

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/pubnub/go/v7. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-5844-q3fc-56rh CVE-2023-26154 MODERATE pubnub Insufficient Entropy vulnerability

CVE-2023-26154 at a Glance

CVE Identifier CVE-2023-26154
GHSA Identifier GHSA-5844-q3fc-56rh
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-331: Insufficient Entropy
Affected Product Pubnub
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2023-26154

To remediate this vulnerability, upgrade all affected Pubnub dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pubnub fixed: 7.4.0
npm install pubnub@7.4.0
com.pubnub:pubnub-kotlin fixed: 7.7.0
<dependency>
    <groupId>com.pubnub</groupId>
    <artifactId>pubnub-kotlin</artifactId>
    <version>7.7.0</version>
</dependency>
com.pubnub:pubnub fixed: Latest secure release
<dependency>
    <groupId>com.pubnub</groupId>
    <artifactId>pubnub</artifactId>
    <version>Latest secure release</version>
</dependency>
github.com/pubnub/go/v7 fixed: 7.2.0
Upgrade github.com/pubnub/go/v7 to 7.2.0
github.com/pubnub/go fixed: 0.0.0-20231016150651-428517fef5b9
Upgrade github.com/pubnub/go to 0.0.0-20231016150651-428517fef5b9
github.com/pubnub/go/v6 fixed: 6.1.1-0.20231016150651-428517fef5b9
Upgrade github.com/pubnub/go/v6 to 6.1.1-0.20231016150651-428517fef5b9
github.com/pubnub/go/v5 fixed: 5.0.4-0.20231016150651-428517fef5b9
Upgrade github.com/pubnub/go/v5 to 5.0.4-0.20231016150651-428517fef5b9
Pubnub fixed: 6.19.0
Upgrade Pubnub to 6.19.0
github.com/pubnub/swift fixed: 6.2.0
Upgrade github.com/pubnub/swift to 6.2.0
pubnub fixed: 5.3.0
Upgrade pubnub to 5.3.0
pubnub fixed: 0.4.0
Upgrade pubnub to 0.4.0
pubnub/pubnub fixed: 6.1.0
Upgrade pubnub/pubnub to 6.1.0
pubnub fixed: 4.3.0
Upgrade pubnub to 4.3.0
pubnub fixed: 7.3.0
pip install pubnub>=7.3.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls pubnub

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2023-26154, inspect your project dependencies using npm:

npm ls pubnub

Analyze the terminal output to locate any version of Pubnub in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.4.0), your application is affected.

Note: The npm ls pubnub command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-331: Insufficient Entropy, where the product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. In Pubnub, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2023-26154 Affected Pubnub Versions

14 component(s)
Fixed Versions:
7.4.07.7.07.2.00.0.0-20231016150651-428517fef5b96.1.1-0.20231016150651-428517fef5b95.0.4-0.20231016150651-428517fef5b96.19.06.2.05.3.00.4.06.1.04.3.07.3.0
Product / Package Ecosystem Affected Versions Fixed Version
pubnub
npm
< 7.4.0
7.4.0
com.pubnub:pubnub-kotlin
Maven
< 7.7.0
7.7.0
com.pubnub:pubnub
Maven
≤ 4.6.5
github.com/pubnub/go/v7
Go
< 7.2.0
7.2.0
github.com/pubnub/go
Go
< 0.0.0-20231016150651-428517fef5b9
0.0.0-20231016150651-428517fef5b9
github.com/pubnub/go/v6
Go
< 6.1.1-0.20231016150651-428517fef5b9
6.1.1-0.20231016150651-428517fef5b9
github.com/pubnub/go/v5
Go
< 5.0.4-0.20231016150651-428517fef5b9
5.0.4-0.20231016150651-428517fef5b9
Pubnub
NuGet
< 6.19.0
6.19.0
github.com/pubnub/swift
SwiftURL
< 6.2.0
6.2.0
pubnub
RubyGems
< 5.3.0
5.3.0
pubnub
crates.io
< 0.4.0
0.4.0
pubnub/pubnub
Packagist
< 6.1.0
6.1.0
pubnub
Pub
< 4.3.0
4.3.0
pubnub
PyPI
< 7.3.0
7.3.0

References

NVD — CVE-2023-26154 NVD
https://nvd.nist.gov/vuln/detail/CVE-2023-26154
Security Fix Commit FIX COMMIT
https://github.com/pubnub/go/commit/428517fef5b901db7275d9f5a75eda89a4c28e08
Security Fix Commit FIX COMMIT
https://github.com/pubnub/javascript/commit/fb6cd0417cbb4ba87ea2d5d86a9c94774447e119
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-UNMANAGED-PUBNUBCCORE-6098379
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-SWIFT-PUBNUBSWIFT-6098381
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-RUST-PUBNUB-6098378
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-RUBY-PUBNUB-6098377
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-PYTHON-PUBNUB-6098375
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-PUB-PUBNUB-6098385
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-PHP-PUBNUBPUBNUB-6098376
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-JS-PUBNUB-5840690
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-JAVA-COMPUBNUB-6098380
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-JAVA-COMPUBNUB-6098371
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMPUBNUBGOV7-6098374
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMPUBNUBGO-6098373
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-DOTNET-PUBNUB-6098372
Pubnub Security Information SECURITY
https://security.snyk.io/vuln/SNYK-COCOAPODS-PUBNUB-6098384
Pubnub Source Repository REPOSITORY
https://github.com/rubysec/ruby-advisory-db/blob/master/gems/pubnub/CVE-2023-26154.yml
Pubnub Source Repository REPOSITORY
https://github.com/pubnub/javascript/blob/master/src/crypto/modules/web.js#L70
Pubnub Source Repository REPOSITORY
https://github.com/pubnub/javascript
GitHub Advisory / Wiki ADVISORY
https://github.com/advisories/GHSA-5844-q3fc-56rh
Pubnub Source Repository REPOSITORY
https://gist.github.com/vargad/20237094fce7a0a28f0723d7ce395bb0

Frequently Asked Questions

What is CVE-2023-26154?
CVE-2023-26154 is a security vulnerability in Pubnub involving pubnub Insufficient Entropy vulnerability under CWE-331: Insufficient Entropy.
Which Pubnub versions are affected?
Affected versions include releases prior to 7.4.0, 7.7.0, 7.2.0, 0.0.0-20231016150651-428517fef5b9, 6.1.1-0.20231016150651-428517fef5b9, 5.0.4-0.20231016150651-428517fef5b9, 6.19.0, 6.2.0, 5.3.0, 0.4.0, 6.1.0, 4.3.0, 7.3.0 across affected packages: pubnub, com.pubnub:pubnub-kotlin, com.pubnub:pubnub, github.com/pubnub/go/v7, github.com/pubnub/go, github.com/pubnub/go/v6, github.com/pubnub/go/v5, Pubnub, github.com/pubnub/swift, pubnub/pubnub.
What version fixes CVE-2023-26154?
Upgrading to 7.4.0, 7.7.0, 7.2.0, 0.0.0-20231016150651-428517fef5b9, 6.1.1-0.20231016150651-428517fef5b9, 5.0.4-0.20231016150651-428517fef5b9, 6.19.0, 6.2.0, 5.3.0, 0.4.0, 6.1.0, 4.3.0, 7.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pubnub affected?
Yes, pubnub is affected in releases prior to 7.4.0, Latest secure release, 5.3.0, 0.4.0, 4.3.0, 7.3.0. Upgrade your dependency to 7.4.0, Latest secure release, 5.3.0, 0.4.0, 4.3.0, 7.3.0 or later.
Is pubnub-kotlin affected?
Yes, com.pubnub:pubnub-kotlin is affected in releases prior to 7.7.0. Upgrade your dependency to 7.7.0 or later.
What is the CVSS score of CVE-2023-26154?
CVE-2023-26154 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2023-26154?
CVE-2023-26154 is classified under CWE-331: Insufficient Entropy (The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.).
How can I check npm dependencies for CVE-2023-26154?
Run the dependency tree command: 'npm ls pubnub'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5844-q3fc-56rh",
  "modified" : "2025-07-22T15:14:55Z",
  "published" : "2023-12-06T06:30:20Z",
  "aliases" : [ "CVE-2023-26154" ],
  "summary" : "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.\n\n**Note:**\n\nIn order to exploit this vulnerability, the attacker needs to invest resources in preparing the attack and brute-force the encryption.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "pubnub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "com.pubnub:pubnub-kotlin"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.7.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "com.pubnub:pubnub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.6.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/pubnub/go/v7"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/pubnub/go"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20231016150651-428517fef5b9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/pubnub/go/v6"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.1.1-0.20231016150651-428517fef5b9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/pubnub/go/v5"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.0.4-0.20231016150651-428517fef5b9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Pubnub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.19.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "SwiftURL",
      "name" : "github.com/pubnub/swift"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "pubnub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.3.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "pubnub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "pubnub/pubnub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.1.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Pub",
      "name" : "pubnub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.3.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pubnub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-26154"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pubnub/go/commit/428517fef5b901db7275d9f5a75eda89a4c28e08"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pubnub/javascript/commit/fb6cd0417cbb4ba87ea2d5d86a9c94774447e119"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-UNMANAGED-PUBNUBCCORE-6098379"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-SWIFT-PUBNUBSWIFT-6098381"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-RUST-PUBNUB-6098378"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-RUBY-PUBNUB-6098377"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-PYTHON-PUBNUB-6098375"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-PUB-PUBNUB-6098385"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-PHP-PUBNUBPUBNUB-6098376"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JS-PUBNUB-5840690"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JAVA-COMPUBNUB-6098380"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JAVA-COMPUBNUB-6098371"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMPUBNUBGOV7-6098374"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMPUBNUBGO-6098373"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-DOTNET-PUBNUB-6098372"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-COCOAPODS-PUBNUB-6098384"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/pubnub/CVE-2023-26154.yml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pubnub/javascript/blob/master/src/crypto/modules/web.js#L70"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pubnub/javascript"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-5844-q3fc-56rh"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/vargad/20237094fce7a0a28f0723d7ce395bb0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-331" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-12-06T16:55:26Z",
    "nvd_published_at" : "2023-12-06T05:15:10Z"
  }
}