-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spec for HTTPS-only providers on Amino DHT #496
Comments
Yes. I don't think this is enough information for what you're trying to do (trustless-gateway over HTTP only). Two main issues:
These are separate issues that can be solved independently, but both are triggered by the current proposal. More context and nuance below, but if looking for a suggestion that seems relatively inline with the proposal:
Multiple HTTP-based protocolsBackground:
With this proposal how would it be possible to support multiple HTTP-based protocols when data was only discovered using the Amino DHT? Some example additional / alternative HTTP APIs already in use in the generalized IPFS space:
I don't think this is enough given examples like the above. Just looking at these examples far more changes than just the content types and they may already have their own conflicting content types. Potential SolutionsSolving this problem could be done with either (or both) of the following:
I understand that there might be some resistance to adding per-protocol metadata based on the network taking a long time to support new functionality, and that's fine since we have other options that could be pursued in parallel. Some examples:
Inconsistency regarding attack vectorsCurrently there is a check in the DHT https://github.com/libp2p/specs/tree/6d38f88f7b2d16b0e4489298bcd0737a6d704f7e/kad-dht#content-provider-advertisement.
This in effect disables the ability for third-parties to advertise "Alice has Foo" into the Amino DHT and instead allows only "I have Foo" to be advertised. By choosing to not check the corresponding peerID this in effect enables delegated advertising but ONLY for HTTPS retrieval and not for libp2p based protocols (bitswap, pubsub discovery, etc.). It seems perverse that we're choosing to take a libp2p based system and then hobble it ONLY for the libp2p use case, My understanding is that the primary motivation for this check (which far predates me and IIUC is 11+ years old) is to limit the impact of reflection / amplification attacks https://en.wikipedia.org/wiki/Denial-of-service_attack#Reflected_attack. Currently the Amino DHT allows for some reflection attacks:
Both the HTTP proposal and removing the peerID check allow arbitrary peers to cause the same reflection attacks that previously only malicious server nodes could perform. Note: This is related to:
Potential SolutionsSolving this problem could be done with either of the following:
Option 1 seems to be implied by this issue, and that's likely ok. Probably the only thing I would flag is that depending on how this expands over time (e.g. allowing HTTP pathing to download blobs) it becomes even more important that clients don't download arbitrary amounts of data without validating it. If they don't then the amount of amplification they do can really grow. |
On attack vectorsIMO we shouldn't sacrifice security, because we want productions systems to build on IPFS and rely on the DHT. Moreover any abuse of reflected/amplification attacks (even on a non-IPFS target) will make IPFS look bad, and contribute toward an aggressive firewall policy against libp2p/ipfs.io. That begin said, as @aschmahmann mentioned, we don't have a good way to validate all multiaddrs shared via identify. It is not practical to verify all of the addresses (e.g server is Currently, during a
In a libp2p only context, unverified multiaddrs is bad, but not critical since the connection will fail when the client fails the dial, or after peer id mismatch. No important work is performed.
In a HTTP context, the server would return a 404, but it could become problematic as mentioned above. A straightforward mitigation to verify that an HTTP addr provided by a libp2p node making a HTTP-only ProvidesWe don't want to allow any host to advertise that an arbitrary IP+port provides arbitrary CIDs. Since a DHT is ultimately a key-value store, we could split the The
Before or after a This means that malicious actors could still advertise content that they won't serve, but they aren't able to advertise content to HTTP addresses that they don't control. It should bring the same security guarantees for HTTP addrs as a Delegated ProvideSo far, we covered only nodes advertising to the DHT that they are serving CIDs. Allowing delegated provides would allow more actors to be advertised as content providers in the DHT, and removes friction about difficulty to provide to the DHT since you could delegate it to another entity.
We want to avoid weakening the system, but we can allow delegated provides simply by using signatures. E.g a node willing to delegate its provides (DHT or other routing system) could sign the following
Note that the A Compared to current The storage on the node responsible for the (re)provide can be optimised if all delegated provides from a provider share the same expiration date and whitelist. The only additional storage would be for the signatures (1 per CID). multiaddrs cachingFor libp2p nodes delegating provides, the node running for the For HTTP Providers, the delegated node may also get a certificate allowing it to run Migration/DeploymentThe above would add new capabilities to the DHT servers, hence leading to a breaking change in the network. We have (at least) 2 choices to deploy the change:
The second solution requires some additional changes to allow sub-DHT, but it will allow us to ship DHT protocol upgrades faster in the future. References |
Thank you. Some extra notes from meetings today:
|
Need
We need to agree and write down a specification how HTTP-only Trustless Gateway providers can be announced on existing Amino DHT.
Such provider can have a synthetic PeerID for interop with routing systems and software, but in reality it won't have any libp2p networking stack, and only expose HTTP endpoint that follows the Trustless Gateway spec.
Wider context
/tls/http
multiaddr – right now it is only announced to IPNI)boxo
/rainbow
that/tls/http
multiaddrsNorth star
Proposed spec direction
/tls/http
in announced Multiaddr as signaling methodAccept
/Content-Type
headerOpen questions
/tls/http
in announced Multiaddrs for this?Gateway.NoFetch=true
&Gateway.DeserializedResponses
gateway behind Cloudflare and URL inAddresses.AppendAnnounce
as/dns4/gw.example.com/tcp/443/tls
as extra hint for clients that prefer HTTP-only retrieval?/dnsX/example.com/../tls/http
, do we need any auth of DNS names?/dnsX/example.com/../tls/http
addrs blindly or should extra validation be added at routing system level (DHT, IPNI)?.well-known/libp2p/signed-peerid
path, but this complicates deployments, requires people to deal with PeerIDs, and at the end of the day, how is this auth request any better from HTTP client blindly sending a trustless probeGET /ipfs/cid
and getting 404 indicating endpoint is not a valid gateway?As usual, ideas, feedback welcome.
The text was updated successfully, but these errors were encountered: