@@ -6,15 +6,14 @@ description: >
6
6
ensures compatibility with native ipfs:// and ipns:// URIs, and aligns with
7
7
the existing Same-origin security model in web browsers, including
8
8
relative URL pathing and permission scopes of Web APIs.
9
- date : 2023-01-28
9
+ date : 2025-04-03
10
10
maturity : reliable
11
11
editors :
12
12
- name : Marcin Rataj
13
13
github : lidel
14
- url : https://lidel.org/
15
14
affiliation :
16
- name : Protocol Labs
17
- url : https://protocol.ai/
15
+ name : Shipyard
16
+ url : https://ipshipyard.com
18
17
- name : Adrian Lanzafame
19
18
github : lanzafame
20
19
affiliation :
@@ -204,7 +203,7 @@ See also: [Migrate from Path to Subdomain Gateway](#migrating-from-path-to-subdo
204
203
205
204
See: [ URI router] ( #uri-router )
206
205
207
- # Appendix: notes for implementers
206
+ # Appendix: Notes for implementers
208
207
209
208
## Migrating from Path to Subdomain Gateway
210
209
@@ -244,22 +243,38 @@ should return HTTP 400 Bad Request for CIDs longer than 63.
244
243
245
244
## Security considerations
246
245
247
- - Wildcard TLS certificates should be set for ` *.ipfs.example.net ` and
248
- ` *.ipns.example.net ` if a subdomain gateway is to be exposed on the public
249
- internet.
250
- - If TLS termination takes place outside of gateway implementation, then
251
- setting [ ` X-Forwarded-Proto ` ] ( #x-forwarded-proto-request-header ) at a
252
- reverse HTTP proxy can be used for preserving ` https ` protocol.
253
-
254
- - Subdomain gateways provide unique origin per content root, however the
255
- origins still share the parent domain name used by the gateway. To fully
256
- isolate websites from each other:
257
- - The gateway operator should add a wildcard entry
258
- to the [ Public Suffix List] ( https://publicsuffix.org/ ) (PSL).
259
- - Example: ` dweb.link ` gateway [ is listed on PSL] ( https://publicsuffix.org/list/public_suffix_list.dat ) as ` *.dweb.link `
260
- - Web browsers with IPFS support should detect subdomain gateway (URL
261
- pattern ` https://{content-root-id}.ip[f|n]s.example.net ` ) and dynamically
262
- append it to internal PSL.
246
+ ### Wildcard TLS certificates
247
+
248
+ Wildcard TLS certificates SHOULD be set for ` *.ipfs.example.net `
249
+ and ` *.ipns.example.net ` if a subdomain gateway is to be exposed on the public
250
+ internet.
251
+
252
+ If TLS termination takes place outside of gateway implementation, then setting
253
+ [ ` X-Forwarded-Proto ` ] ( #x-forwarded-proto-request-header ) at a reverse HTTP
254
+ proxy is RECOMMENDED for preserving ` https ` protocol.
255
+
256
+ ### Public Suffix List and eTLD enforcement
257
+
258
+ Subdomain gateways assign each content root a unique origin, yet these origins
259
+ share the gateway’s parent domain. Without proper isolation, all subdomains
260
+ under the same effective Top-Level Domain (eTLD) face risks: a single
261
+ problematic CID could trigger widespread blocking of the entire gateway by
262
+ software like Safe Browsing
263
+ ([ incident example] ( https://web.archive.org/web/20230930054837/https://blog.nft.storage/posts/2022-04-29-gateways-and-gatekeepers ) ).
264
+
265
+ To mitigate this and align with the web’s Same-origin security model, operators
266
+ SHOULD register a wildcard entry like ` *.example.net `
267
+ with the [ Public Suffix List (PSL)] ( https://publicsuffix.org/ ) .
268
+
269
+ This will make ` ipfs.example.net ` and ` ipns.example.net ` eTLDs, treating each
270
+ identifier (e.g., ` cid.ipfs.example.net ` ) as a distinct top-level Origin.
271
+ The [ public good gateway] ( https://docs.ipfs.tech/concepts/public-utilities/#public-ipfs-gateways ) ,
272
+ listed as ` *.dweb.link ` and ` *.inbrowser.link ` on the PSL, exemplifies this approach.
273
+
274
+ Browsers supporting IPFS natively SHOULD detect URI patterns such as
275
+ ` https://{content-root-id}.ip[f|n]s.example.net ` and dynamically update their
276
+ internal PSL, bolstering security and compatibility without relying solely on
277
+ operator action.
263
278
264
279
## URI router
265
280
@@ -272,7 +287,7 @@ addresses on a gateway.
272
287
The ` /ipfs/?uri=%s ` endpoint MUST be compatible with : ref [ registerProtocolHandler(scheme, url)] ,
273
288
present in web browsers. The value passed in ` %s ` should be : ref [ UTF-8 percent-encode] .
274
289
275
- ** Example **
290
+ ::: example
276
291
277
292
Given registration:
278
293
@@ -289,6 +304,8 @@ which in turn should redirect to
289
304
290
305
From there, regular subdomain gateway logic applies.
291
306
307
+ :::
308
+
292
309
## Redirects, single-page applications, and custom 404s
293
310
294
311
Subdomain Gateway implementations SHOULD include ` _redirects ` file
0 commit comments