Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS1meDVwLWY2NGgtOTN4Y804Iw
Opened exploitable ports in default docker-compose.yaml in go-ipfs
Impact
Allows admin API access to the IPFS node.
Who ?
This affects people running the 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. 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:
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.)
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
- Open an issue in go-ipfs
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1meDVwLWY2NGgtOTN4Y804Iw
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 2 years ago
Updated: over 1 year ago
Identifiers: GHSA-fx5p-f64h-93xc
References:
- https://github.com/ipfs/go-ipfs/security/advisories/GHSA-fx5p-f64h-93xc
- https://github.com/ipfs/go-ipfs/pull/8773
- https://github.com/ipfs/go-ipfs/commit/816a128aaf963d72c4930852ce32b9a4e31924a1
- https://github.com/ipfs/go-ipfs/releases/tag/v0.12.1
- https://github.com/advisories/GHSA-fx5p-f64h-93xc
Blast Radius: 0.0
Affected Packages
go:github.com/ipfs/go-ipfs
Dependent packages: 368Dependent repositories: 475
Downloads:
Affected Version Ranges: >= 0.11.0, < 0.12.1
Fixed in: 0.12.1
All affected versions: 0.11.0, 0.11.1, 0.12.0
All unaffected versions: 0.2.2, 0.2.3, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.3.7, 0.3.8, 0.3.9, 0.3.10, 0.3.11, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.5, 0.4.6, 0.4.7, 0.4.8, 0.4.9, 0.4.10, 0.4.11, 0.4.12, 0.4.13, 0.4.14, 0.4.15, 0.4.16, 0.4.17, 0.4.18, 0.4.19, 0.4.20, 0.4.21, 0.4.22, 0.4.23, 0.5.0, 0.5.1, 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.9.1, 0.10.0, 0.12.1, 0.12.2, 0.13.0, 0.13.1, 0.14.0, 0.15.0, 0.16.0, 0.17.0, 0.18.0, 0.18.1, 0.19.0, 0.19.1, 0.19.2, 0.20.0, 0.21.0, 0.21.1, 0.22.0, 0.23.0, 0.24.0, 0.25.0, 0.26.0, 0.27.0, 0.28.0