CVE-2023-23631: Github.com/ipfs/go unixfsnode Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-4gj3-6r43-3wfc
CVSS 7.5
CWE-400
Published
Advisory Summary

CVE-2023-23631 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Github.com/ipfs/go unixfsnode libraries in the Go ecosystem. The issue involves ipfs go-unixfsnode subject to dos via hamt decoding panics. Remediation is available by upgrading affected packages to version 1.5.2.

CVE-2023-23631 at a Glance

CVE Identifier CVE-2023-23631
GHSA Identifier GHSA-4gj3-6r43-3wfc
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Github.com/ipfs/go unixfsnode
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 CVE-2023-23631

To remediate this vulnerability, upgrade all affected Github.com/ipfs/go unixfsnode 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-unixfsnode fixed: 1.5.2
Upgrade github.com/ipfs/go-unixfsnode to 1.5.2
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-unixfsnode

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-23631, inspect your project dependencies for Github.com/ipfs/go unixfsnode:

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

Analyze the terminal output to locate any version of Github.com/ipfs/go unixfsnode in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.2), 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 unixfsnode, 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 Trying to read malformed HAMT sharded directories can cause panics and virtual memory leaks. If you are reading untrusted user input, an attacker can then trigger a panic. This is caused by a bogus fanout parameter in the HAMT directory nodes. This includes checks returned in [ipfs/go-bitfield GHSA-2h6c-j3gf-xp9r](https://github.com/ipfs/go-bitfield/security/advisories/GHSA-2h6c-j3gf-xp9r), as well as limiting the fanout to <= 1024 (to avoid attempts of arbitrary sized allocations). ## Patches - https://github.com/ipfs/go-unixfsnode/commit/91b3d39d33ef0cd2aff2c95d50b2329350944b68 - https://github.com/ipfs/go-unixfsnode/commit/a4ed723727e0bdc2277158337c2fc0d82802d122 ## References * https://github.com/ipfs/go-unixfs/security/advisories/GHSA-q264-w97q-q778 * https://github.com/ipfs/go-bitfield/security/advisories/GHSA-2h6c-j3gf-xp9r

CVE-2023-23631 Affected Github.com/ipfs/go unixfsnode Versions

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

References

Frequently Asked Questions

What is CVE-2023-23631?
CVE-2023-23631 is a security vulnerability in Github.com/ipfs/go unixfsnode involving IPFS go-unixfsnode subject to DOS via HAMT Decoding Panics under CWE-400: Uncontrolled Resource Consumption.
Which Github.com/ipfs/go unixfsnode versions are affected?
Affected versions include releases prior to 1.5.2 across affected packages: github.com/ipfs/go-unixfsnode.
What version fixes CVE-2023-23631?
Upgrading to 1.5.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ipfs/go-unixfsnode affected?
Yes, github.com/ipfs/go-unixfsnode is affected in releases prior to 1.5.2. Upgrade your dependency to 1.5.2 or later.
What is the CVSS score of CVE-2023-23631?
CVE-2023-23631 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 CVE-2023-23631?
CVE-2023-23631 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 CVE-2023-23631?
Run the dependency tree command: 'inspect dependencies for github.com/ipfs/go-unixfsnode'. 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-4gj3-6r43-3wfc",
  "modified" : "2023-02-17T20:32:08Z",
  "published" : "2023-02-10T19:54:14Z",
  "aliases" : [ "CVE-2023-23631" ],
  "summary" : "IPFS go-unixfsnode subject to DOS via HAMT Decoding Panics",
  "details" : "## Impact\n\nTrying to read malformed HAMT sharded directories can cause panics and virtual memory leaks.\nIf you are reading untrusted user input, an attacker can then trigger a panic.\n\nThis is caused by a bogus fanout parameter in the HAMT directory nodes.\nThis includes checks returned in [ipfs/go-bitfield GHSA-2h6c-j3gf-xp9r](https://github.com/ipfs/go-bitfield/security/advisories/GHSA-2h6c-j3gf-xp9r), as well as limiting the fanout to <= 1024 (to avoid attempts of arbitrary sized allocations).\n\n## Patches\n- https://github.com/ipfs/go-unixfsnode/commit/91b3d39d33ef0cd2aff2c95d50b2329350944b68\n- https://github.com/ipfs/go-unixfsnode/commit/a4ed723727e0bdc2277158337c2fc0d82802d122\n\n## References\n\n* https://github.com/ipfs/go-unixfs/security/advisories/GHSA-q264-w97q-q778\n* https://github.com/ipfs/go-bitfield/security/advisories/GHSA-2h6c-j3gf-xp9r\n",
  "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-unixfsnode"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/go-unixfsnode/security/advisories/GHSA-4gj3-6r43-3wfc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-23631"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/go-unixfsnode/commit/59050ea8bc458ae55246ae09243e6e165923e076"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/go-unixfsnode/commit/91b3d39d33ef0cd2aff2c95d50b2329350944b68"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/go-unixfsnode/commit/a4ed723727e0bdc2277158337c2fc0d82802d122"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ipfs/go-unixfsnode"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2023-1559"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-10T19:54:14Z",
    "nvd_published_at" : "2023-02-09T21:15:00Z"
  }
}