rpc: NewAPI
constructs faulty HTTP client when using Unix Domain sockets
#10018
Labels
kind/bug
A bug in existing code (including security flaws)
need/triage
Needs initial labeling and prioritization
Checklist
Installation method
built from source
Version
No response
Config
This is the only relevant part
Description
Consider an IPFS daemon running on Windows, exposing its API on a UDS located at
C:\tmp\sock
.The following program will fail when calling
core.Pin().Ls
(or anything that makes a request)with this output:
parse "http://C:\\tmp\\sock/api/v0/pin/ls?stream=true&type=recursive": invalid port ":\\tmp\\sock" after host
The client constructor is using the multiaddr's Unix component's value, for the HTTP address.
This is problematic since the file system path may contain any number of invalid HTTP URL characters or sequences, which can confuse the client when it goes to make requests.
In this specific case, a
:
in the path is being misinterpreted as the port separator.PR #10019
The text was updated successfully, but these errors were encountered: