CVE-2020-4045: Ssb db Information Disclosure Vulnerability

HIGH
Advisory Identifier: GHSA-mpgr-2cx9-327h
CVSS 7.5
CWE-200
Published
Advisory Summary

CVE-2020-4045 is a HIGH (CVSS 7.5) information disclosure vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Ssb db libraries in the npm ecosystem. The issue involves information disclosure in ssb-db. Remediation is available by upgrading affected packages to version 20.0.1.

CVE-2020-4045 at a Glance

CVE Identifier CVE-2020-4045
GHSA Identifier GHSA-mpgr-2cx9-327h
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Ssb db
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
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-2020-4045

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

ssb-db fixed: 20.0.1
npm install ssb-db@20.0.1
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 ssb-db

How to Check if You Are Affected

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

npm ls ssb-db

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

Note: The npm ls ssb-db 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-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Ssb db, 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

### Impact _What kind of vulnerability is it? Who is impacted?_ Servers running SSB-DB 20.0.0 (which is packaged with SSB-Server 16.0.0) must upgrade immediately. **There is no evidence that other SSB apps are vulnerable or that this problem has been exploited in the wild.** The `get()` method is supposed to only decrypt messages when you explicitly ask it to, but there's a bug where it's decrypting any message that it can. This means that it's returning the decrypted content of private messages, which a malicious peer could use to get access to private data. This only affects peers running SSB-DB@20.0.0 who also have private messages, and is only known to be exploitable if you're also running SSB-OOO (default in SSB-Server), which exposes a thin wrapper around `get()` to anonymous peers. ### Patches _Has the problem been patched? What versions should users upgrade to?_ Yes, please upgrade to SSB-DB 20.0.1 (or SSB-Server 16.0.1) immediately. ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ You may be able to disable the most obvious attack vector, SSB-OOO, by disabling the plugin, but you should upgrade immediately anyway. ### For more information If you have any questions or comments about this advisory, open an issue in [SSB-DB](https://github.com/ssbc/ssb-db/)

CVE-2020-4045 Affected Ssb db Versions

1 component(s)
Fixed Versions:
20.0.1
Product / Package Ecosystem Affected Versions Fixed Version
ssb-db
npm
≥ 20.0.0
< 20.0.1
All 1 versions
20.0.0
20.0.1

References

Frequently Asked Questions

What is CVE-2020-4045?
CVE-2020-4045 is a security vulnerability in Ssb db involving Information disclosure in SSB-DB under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Ssb db versions are affected?
Affected versions include releases prior to 20.0.1 across affected packages: ssb-db.
What version fixes CVE-2020-4045?
Upgrading to 20.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ssb-db affected?
Yes, ssb-db is affected in releases prior to 20.0.1. Upgrade your dependency to 20.0.1 or later.
What is the CVSS score of CVE-2020-4045?
CVE-2020-4045 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2020-4045?
CVE-2020-4045 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check npm dependencies for CVE-2020-4045?
Run the dependency tree command: 'npm ls ssb-db'. 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-mpgr-2cx9-327h",
  "modified" : "2021-01-08T20:12:11Z",
  "published" : "2020-06-11T21:09:04Z",
  "aliases" : [ "CVE-2020-4045" ],
  "summary" : "Information disclosure in SSB-DB",
  "details" : "### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nServers running SSB-DB 20.0.0 (which is packaged with SSB-Server 16.0.0) must upgrade immediately.\n\n**There is no evidence that other SSB apps are vulnerable or that this problem has been exploited in the wild.**\n\nThe `get()` method is supposed to only decrypt messages when you explicitly ask it to, but there's a bug where it's decrypting any message that it can. This means that it's returning the decrypted content of private messages, which a malicious peer could use to get access to private data. This only affects peers running SSB-DB@20.0.0 who also have private messages, and is only known to be exploitable if you're also running SSB-OOO (default in SSB-Server), which exposes a thin wrapper around `get()` to anonymous peers.\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nYes, please upgrade to SSB-DB 20.0.1 (or SSB-Server 16.0.1) immediately.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nYou may be able to disable the most obvious attack vector, SSB-OOO, by disabling the plugin, but you should upgrade immediately anyway.\n\n### For more information\n\nIf you have any questions or comments about this advisory, open an issue in [SSB-DB](https://github.com/ssbc/ssb-db/)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "ssb-db"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "20.0.0"
      }, {
        "fixed" : "20.0.1"
      } ]
    } ],
    "versions" : [ "20.0.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ssbc/ssb-db/security/advisories/GHSA-mpgr-2cx9-327h"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-4045"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ssbc/ssb-db/commit/43334d0871c9cc6220e0f6d6338499060f7761d4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-11T21:08:42Z",
    "nvd_published_at" : null
  }
}