kubo/core/corehttp
Hector Sanjuan 1b490476e5 HTTP API: Disallow GET requests on API
This commit upgrades go-ipfs-cmds and configures the commands HTTP API Handler
to only allow POST/OPTIONS, disallowing GET and others in the handling of
command requests in the IPFS HTTP API (where before every type of request
method was handled, with GET/POST/PUT/PATCH being equivalent).

The Read-Only commands that the HTTP API attaches to the gateway endpoint will
additional handled GET as they did before (but stop handling PUT,DELETEs).

By limiting the request types we address the possibility that a website
accessed by a browser abuses the IPFS API by issuing GET requests to it which
have no Origin or Referrer set, and are thus bypass CORS and CSRF protections.

This is a breaking change for clients that relay on GET requests against the
HTTP endpoint (usually :5001). Applications integrating on top of the
gateway-read-only API should still work (including cross-domain access).

Co-Authored-By: Steven Allen <steven@stebalien.com>
Co-Authored-By: Marcin Rataj <lidel@lidel.org>
2020-04-05 09:57:57 +02:00
..
commands.go HTTP API: Disallow GET requests on API 2020-04-05 09:57:57 +02:00
corehttp.go feat(gateway): subdomain and proxy gateway 2020-03-18 08:50:38 -07:00
gateway_handler.go fix(gateway): curl without redirect on localhost 2020-03-18 08:50:40 -07:00
gateway_indexPage.go show hash if not in original url 2019-01-05 11:16:17 -08:00
gateway_test.go feat(gateway): subdomain and proxy gateway 2020-03-18 08:50:38 -07:00
gateway.go http: use Method* constants 2020-01-10 10:19:08 +01:00
hostname_test.go feat(gateway): subdomain and proxy gateway 2020-03-18 08:50:38 -07:00
hostname.go fix(gateway): curl without redirect on localhost 2020-03-18 08:50:40 -07:00
lazyseek_test.go test(gateway): test the lazy seeker 2020-01-05 16:43:45 -08:00
lazyseek.go fix(gateway): fix seek read length typo 2020-01-05 16:43:45 -08:00
logs.go fix(tracing): remove event tracing 2020-01-28 21:31:12 -08:00
metrics_test.go migrate to go-libp2p-core. 2019-05-31 23:23:52 -07:00
metrics.go pass opts.Namespace along like before 2019-10-23 10:46:11 +10:00
mutex_profile.go fix: use http.Error for sending errors 2019-05-25 10:45:17 -07:00
option_test.go http: use Method* constants 2020-01-10 10:19:08 +01:00
p2p_proxy_test.go rename ProxyOption to P2PProxyOption 2020-03-17 19:34:44 -07:00
p2p_proxy.go rename ProxyOption to P2PProxyOption 2020-03-17 19:34:44 -07:00
redirect.go fix the wrong path configuration in root redirection 2019-04-15 12:35:45 +09:00
webui.go HTTP API: Disallow GET requests on API 2020-04-05 09:57:57 +02:00