GHSA-fx5p-f64h-93xc: Github.com/ipfs/go ipfs Opened Exploitable Ports Vulnerability

MODERATE
Published
Advisory Summary

GHSA-fx5p-f64h-93xc is a MODERATE opened exploitable ports vulnerability (General Security Weakness) affecting Github.com/ipfs/go ipfs libraries in the Go ecosystem. The issue involves opened exploitable ports in default docker-compose.yaml in go-ipfs. Remediation is available by upgrading affected packages to version 0.12.1.

GHSA-fx5p-f64h-93xc at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-fx5p-f64h-93xc
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Github.com/ipfs/go ipfs
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-fx5p-f64h-93xc

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

How to Check if You Are Affected

To determine whether your application is affected by GHSA-fx5p-f64h-93xc, inspect your project dependencies for Github.com/ipfs/go ipfs:

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

Analyze the terminal output to locate any version of Github.com/ipfs/go ipfs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.12.1), 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 General Security Weakness. In Github.com/ipfs/go ipfs, 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 Allows admin API access to the IPFS node. ### Who ? This affects people running the [docker-compose.yaml](https://github.com/ipfs/go-ipfs/blob/master/docker-compose.yaml) service in an environment where the docker host is directly attached to a public or untrusted IP. In the vulnerable version, the private API endpoint is publicly forwarded by exposing it as `0.0.0.0:5001` on the host machine. If the host machine is hidden behind a firewall or NAT (and the LAN is trusted for NAT), this is not an immediate issue because of the protection from the firewall or NAT. That said, we still recommend users update to follow security best practices of not putting unnecessary dependency on a working firewall. ### Patches This issue is in [docker-compose.yaml](https://github.com/ipfs/go-ipfs/blob/master/docker-compose.yaml). Users need to replace their current `docker-compose.yaml` file with a version `0.12.1` or later. There is no need to update any of the binaries. Users running previous versions like `0.12.0` or earlier can download the `0.12.1` `docker-compose.yaml` file. You can replace a vulnerable `docker-compose.yaml` file with a the new one with: ``` curl https://raw.githubusercontent.com/ipfs/go-ipfs/v0.12.1/docker-compose.yaml > docker-compose.yaml ``` ### How to test if you are vulnerable #### Binding check on the host On the host machine, while IPFS is running, run as root: ```bash netstat -lnp | grep ":5001" ``` The output will be a list of listeners bound to `:5001`. You then need to check that those listeners are private and preferably even localhost IPs. ⚠️ If this listener is on `0.0.0.0` or a public IP you are very likely vulnerable. #### Remote hailing While IPFS is running, you can try to contact the API from a remote machine. (Replace `1.2.3.4` with your node public IP. Or if you want to test in an untrusted NAT, then substitute the LAN IP instead.) ```bash curl -X POST http://1.2.3.4:5001/api/v0/version ``` ⚠️ If you see any json outputted (e.g., `{"Commit": "<string>","Golang": "<string>","Repo": "<string>","System": "<string>","Version": "<string>"}`), then you are vulnerable. If it **fails**, then you are safe. ### For more information If you have any questions or comments about this advisory: * Please first read https://docs.ipfs.io/reference/http/api/ about best practices * Ask in [IPFS Discord #ipfs-chatter](https://discord.gg/ipfs) * Open an issue in [go-ipfs](https://github.com/ipfs/go-ipfs)

GHSA-fx5p-f64h-93xc Affected Github.com/ipfs/go ipfs Versions

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

References

Frequently Asked Questions

What is GHSA-fx5p-f64h-93xc?
GHSA-fx5p-f64h-93xc is a security vulnerability in Github.com/ipfs/go ipfs involving Opened exploitable ports in default docker-compose.yaml in go-ipfs under General Security Weakness.
Which Github.com/ipfs/go ipfs versions are affected?
Affected versions include releases prior to 0.12.1 across affected packages: github.com/ipfs/go-ipfs.
What version fixes GHSA-fx5p-f64h-93xc?
Upgrading to 0.12.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ipfs/go-ipfs affected?
Yes, github.com/ipfs/go-ipfs is affected in releases prior to 0.12.1. Upgrade your dependency to 0.12.1 or later.
What CWE is associated with GHSA-fx5p-f64h-93xc?
GHSA-fx5p-f64h-93xc is classified under General Security Weakness.
How can I check Go dependencies for GHSA-fx5p-f64h-93xc?
Run the dependency tree command: 'inspect dependencies for github.com/ipfs/go-ipfs'. 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-fx5p-f64h-93xc",
  "modified" : "2022-04-04T21:23:55Z",
  "published" : "2022-04-04T21:23:55Z",
  "aliases" : [ ],
  "summary" : " Opened exploitable ports in default docker-compose.yaml in go-ipfs",
  "details" : "### Impact\n\nAllows admin API access to the IPFS node.\n\n### Who ?\n\nThis affects people running the  [docker-compose.yaml](https://github.com/ipfs/go-ipfs/blob/master/docker-compose.yaml) service in an environment where the docker host is directly attached to a public or untrusted IP.  In the vulnerable version, the private API endpoint is publicly forwarded by exposing it as `0.0.0.0:5001` on the host machine.  \n\nIf the host machine is hidden behind a firewall or NAT (and the LAN is trusted for NAT), this is not an immediate issue because of the protection from the firewall or NAT.  That said, we still recommend users update to follow security best practices of not putting unnecessary dependency on a working firewall.\n\n### Patches\nThis issue is in [docker-compose.yaml](https://github.com/ipfs/go-ipfs/blob/master/docker-compose.yaml).  Users need to replace their current `docker-compose.yaml` file with a version `0.12.1` or later.\n\nThere is no need to update any of the binaries. Users running previous versions like `0.12.0` or earlier can download the `0.12.1` `docker-compose.yaml` file.  You can replace a vulnerable `docker-compose.yaml` file with a the new one with:\n\n```\ncurl https://raw.githubusercontent.com/ipfs/go-ipfs/v0.12.1/docker-compose.yaml > docker-compose.yaml\n```\n\n### How to test if you are vulnerable\n#### Binding check on the host\nOn the host machine, while IPFS is running, run as root:\n\n```bash\nnetstat -lnp | grep \":5001\"\n```\n\nThe output will be a list of listeners bound to `:5001`.\nYou then need to check that those listeners are private and preferably even localhost IPs.\n⚠️ If this listener is on `0.0.0.0` or a public IP you are very likely vulnerable.\n\n#### Remote hailing\nWhile IPFS is running, you can try to contact the API from a remote machine. (Replace `1.2.3.4` with your node public IP.  Or if you want to test in an untrusted NAT, then substitute the LAN IP instead.)\n\n```bash\ncurl -X POST http://1.2.3.4:5001/api/v0/version\n```\n\n⚠️ If you see any json outputted (e.g.,  `{\"Commit\": \"<string>\",\"Golang\": \"<string>\",\"Repo\": \"<string>\",\"System\": \"<string>\",\"Version\": \"<string>\"}`), then you are vulnerable.\n\nIf it **fails**, then you are safe.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Please first read https://docs.ipfs.io/reference/http/api/ about best practices\n* Ask in [IPFS Discord #ipfs-chatter](https://discord.gg/ipfs)\n* Open an issue in [go-ipfs](https://github.com/ipfs/go-ipfs)\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/ipfs/go-ipfs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.11.0"
      }, {
        "fixed" : "0.12.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/go-ipfs/security/advisories/GHSA-fx5p-f64h-93xc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/go-ipfs/pull/8773"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/go-ipfs/commit/816a128aaf963d72c4930852ce32b9a4e31924a1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ipfs/go-ipfs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipfs/go-ipfs/releases/tag/v0.12.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-04-04T21:23:55Z",
    "nvd_published_at" : null
  }
}