GHSA-q3j6-22wf-3jh9: Github.com/ipfs/go bitswap Denial of Service Vulnerability

HIGH
CVSS 7.5
CWE-400 CWE-770
Published
Advisory Summary

GHSA-q3j6-22wf-3jh9 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Github.com/ipfs/go bitswap libraries in the Go ecosystem. The issue involves github.com/ipfs/go-bitswap vulnerable to dos unbounded persistent memory leak. Remediation is available by upgrading affected packages to version 0.12.0.

GHSA-q3j6-22wf-3jh9 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-q3j6-22wf-3jh9
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Github.com/ipfs/go bitswap
Package Ecosystem Go
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:N/I:N/A:H).

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 None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix GHSA-q3j6-22wf-3jh9

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

github.com/ipfs/go-bitswap fixed: 0.12.0
Upgrade github.com/ipfs/go-bitswap to 0.12.0
Verify Direct and Transitive Dependencies

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

inspect dependencies for github.com/ipfs/go-bitswap

How to Check if You Are Affected

To determine whether your application is affected by GHSA-q3j6-22wf-3jh9, inspect your project dependencies for Github.com/ipfs/go bitswap:

inspect dependencies for github.com/ipfs/go-bitswap

Analyze the terminal output to locate any version of Github.com/ipfs/go bitswap in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.12.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Github.com/ipfs/go bitswap, 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

This package has been moved to [`github.com/ipfs/boxo/bitswap`](https://pkg.go.dev/github.com/ipfs/boxo/bitswap), this vulnerability is tracked there: https://github.com/ipfs/boxo/security/advisories/GHSA-m974-xj4j-7qv5 (`CVE-2023-25568`) ### Remediation This is a two step process: 1. Apply one of: - (**recommended**) upgrade from `github.com/ipfs/go-bitswap` to `github.com/ipfs/boxo/bitswap`. - If you are still using `github.com/ipfs/go-bitswap` and cannot upgrade to `boxo`, you can upgrade to `github.com/ipfs/go-bitswap@v0.12.0`, this will replace the `go-bitswap` implementation by stubs which points to `boxo`. 2. Open https://github.com/ipfs/boxo/security/advisories/GHSA-m974-xj4j-7qv5 and then follow `boxo`'s remediation section. ### Vulnerable symbols - `>= v0.9.0; < v0.12.0` - `github.com/ipfs/go-bitswap/server/internal/decision.(*Engine).MessageReceived` - `github.com/ipfs/go-bitswap/server/internal/decision.(*Engine).NotifyNewBlocks` - `github.com/ipfs/go-bitswap/server/internal/decision.(*Engine).findOrCreate` - `github.com/ipfs/go-bitswap/server/internal/decision.(*Engine).PeerConnected` - `v0.8.0` - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).MessageReceived` - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).NotifyNewBlocks` - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).findOrCreate` - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).PeerConnected` - `< v0.8.0` - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).MessageReceived` - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).receiveBlocksFrom` - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).findOrCreate` - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).PeerConnected` ### Workarounds If you are using the stubs at `github.com/ipfs/go-bitswap` and not taking advantage of the features provided by the server, refactoring your code to use the new split API will allows you to run in a client-only mode using: [`github.com/ipfs/go-bitswap/client`](https://pkg.go.dev/github.com/ipfs/go-bitswap/client).

GHSA-q3j6-22wf-3jh9 Affected Github.com/ipfs/go bitswap Versions

1 component(s)
Fixed Versions:
0.12.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/ipfs/go-bitswap
Go
< 0.12.0
0.12.0

References

Frequently Asked Questions

What is GHSA-q3j6-22wf-3jh9?
GHSA-q3j6-22wf-3jh9 is a security vulnerability in Github.com/ipfs/go bitswap involving github.com/ipfs/go-bitswap vulnerable to DOS unbounded persistent memory leak under CWE-400: Uncontrolled Resource Consumption.
Which Github.com/ipfs/go bitswap versions are affected?
Affected versions include releases prior to 0.12.0 across affected packages: github.com/ipfs/go-bitswap.
What version fixes GHSA-q3j6-22wf-3jh9?
Upgrading to 0.12.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ipfs/go-bitswap affected?
Yes, github.com/ipfs/go-bitswap is affected in releases prior to 0.12.0. Upgrade your dependency to 0.12.0 or later.
What is the CVSS score of GHSA-q3j6-22wf-3jh9?
GHSA-q3j6-22wf-3jh9 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:N/I:N/A:H.
What CWE is associated with GHSA-q3j6-22wf-3jh9?
GHSA-q3j6-22wf-3jh9 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Go dependencies for GHSA-q3j6-22wf-3jh9?
Run the dependency tree command: 'inspect dependencies for github.com/ipfs/go-bitswap'. 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-q3j6-22wf-3jh9",
  "modified" : "2023-05-11T20:39:55Z",
  "published" : "2023-05-11T20:39:55Z",
  "aliases" : [ ],
  "summary" : "github.com/ipfs/go-bitswap vulnerable to DOS unbounded persistent memory leak",
  "details" : "This package has been moved to [`github.com/ipfs/boxo/bitswap`](https://pkg.go.dev/github.com/ipfs/boxo/bitswap), this vulnerability is tracked there: https://github.com/ipfs/boxo/security/advisories/GHSA-m974-xj4j-7qv5 (`CVE-2023-25568`)\n\n### Remediation\nThis is a two step process:\n1. Apply one of:\n   - (**recommended**) upgrade from `github.com/ipfs/go-bitswap` to `github.com/ipfs/boxo/bitswap`.\n   - If you are still using `github.com/ipfs/go-bitswap` and cannot upgrade to `boxo`, you can upgrade to `github.com/ipfs/go-bitswap@v0.12.0`, this will replace the `go-bitswap` implementation by stubs which points to `boxo`.\n2. Open https://github.com/ipfs/boxo/security/advisories/GHSA-m974-xj4j-7qv5 and then follow `boxo`'s remediation section.\n\n### Vulnerable symbols\n- `>= v0.9.0; < v0.12.0`\n  - `github.com/ipfs/go-bitswap/server/internal/decision.(*Engine).MessageReceived`\n  - `github.com/ipfs/go-bitswap/server/internal/decision.(*Engine).NotifyNewBlocks`\n  - `github.com/ipfs/go-bitswap/server/internal/decision.(*Engine).findOrCreate`\n  - `github.com/ipfs/go-bitswap/server/internal/decision.(*Engine).PeerConnected`\n- `v0.8.0`\n  - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).MessageReceived`\n  - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).NotifyNewBlocks`\n  - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).findOrCreate`\n  - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).PeerConnected`\n- `< v0.8.0`\n  - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).MessageReceived`\n  - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).receiveBlocksFrom`\n  - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).findOrCreate`\n  - `github.com/ipfs/go-bitswap/internal/decision.(*Engine).PeerConnected`\n\n### Workarounds\nIf you are using the stubs at `github.com/ipfs/go-bitswap` and not taking advantage of the features provided by the server, refactoring your code to use the new split API will allows you to run in a client-only mode using: [`github.com/ipfs/go-bitswap/client`](https://pkg.go.dev/github.com/ipfs/go-bitswap/client).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/ipfs/go-bitswap"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.12.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/boxo/security/advisories/GHSA-m974-xj4j-7qv5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/go-bitswap/security/advisories/GHSA-q3j6-22wf-3jh9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/go-libipfs/security/advisories/GHSA-m974-xj4j-7qv5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-25568"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/boxo/commit/62cbac40b96f49e39cd7fedc77ee6b56adce4916"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/boxo/commit/9cb5cb54d40b57084d1221ba83b9e6bb3fcc3197"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ipfs/go-bitswap"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400", "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-05-11T20:39:55Z",
    "nvd_published_at" : null
  }
}