From eccd05ce1e03f41a113734fc830b8df75e246c4c Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 10 Jul 2024 13:42:29 +0200 Subject: [PATCH 1/4] Block access to :: and 0.0.0.0 Fixes #1117. --- fetch.bs | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/fetch.bs b/fetch.bs index de4606f20..3d2138b64 100644 --- a/fetch.bs +++ b/fetch.bs @@ -2743,6 +2743,26 @@ functionality. network partition key key and an origin origin: +
    +
  1. Let ipAddresses be the result of running resolve an origin internal given + key and origin. + +

  2. If ipAddresses is failure, then return failure. + +

  3. If ipAddresses contains :: or 0.0.0.0, + then return failure. + +

  4. Return ipAddresses. +

+ +

The results of resolve an origin may be cached. If they are cached, key should +be used as part of the cache key. + + +

+

The resolve an origin internal algorithm, given a network partition key +key and an origin origin, runs these steps: +

  1. If origin's host is an IP address, then return « origin's host ». @@ -2753,7 +2773,8 @@ functionality.

  2. Perform an implementation-defined operation to turn origin into a - set of one or more IP addresses. + set of one or more IP addresses, taking key into account as + appropriate.

    It is also implementation-defined whether other operations might be performed to get connection information beyond just IP addresses. For example, if origin's @@ -2767,16 +2788,13 @@ functionality.

  3. Return failure.

-

The results of resolve an origin may be cached. If they are cached, key should -be used as part of the cache key. -

Typically this operation would involve DNS and as such caching can happen on DNS servers without key being taken into account. Depending on the implementation it might also not be possible to take key into account locally. [[RFC1035]] -

The order of the IP addresses that the resolve an origin algorithm can return - can differ between invocations. +

The order of the IP addresses that the resolve an origin internal algorithm + can return can differ between invocations.

The particulars (apart from the cache key) are not tied down as they are not pertinent to the system the Fetch Standard establishes. Other documents ought not to build on this primitive without @@ -9015,6 +9033,7 @@ done only by navigations). The fetch controller is also used to

Thanks to Adam Barth, Adam Lavin, +Alain Emilia Anna Zscheile, Alan Jeffrey, Alexey Proskuryakov, Andreas Kling, @@ -9026,7 +9045,7 @@ Arkadiusz Michalski, Arne Johannessen, Artem Skoretskiy, Arthur Barstow, -Arthur Sonzogni, +Arthur Sonzogni, Asanka Herath, Axel Rauschmayer, Ben Kelly, From 56facf7ca239f2256a89c43f5bbd900c0a23ed42 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 19 Aug 2024 14:24:26 +0200 Subject: [PATCH 2/4] Update fetch.bs --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index 3d2138b64..2ffccffab 100644 --- a/fetch.bs +++ b/fetch.bs @@ -2759,7 +2759,7 @@ functionality. be used as part of the cache key.

-
+

The resolve an origin internal algorithm, given a network partition key key and an origin origin, runs these steps: From d2a8fdb94bf5cc918ca7709e0f56a61bcb673868 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 19 Aug 2024 14:56:49 +0200 Subject: [PATCH 3/4] review --- fetch.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index 2ffccffab..d9e10b1e8 100644 --- a/fetch.bs +++ b/fetch.bs @@ -2749,8 +2749,8 @@ functionality.

  • If ipAddresses is failure, then return failure. -

  • If ipAddresses contains :: or 0.0.0.0, - then return failure. +

  • If ipAddresses contains ::, ::ffff:0:0, + or 0.0.0.0, then return failure.

  • Return ipAddresses. From 4b5e6a6a22cde0f3bbd53cbce60e1bde152545e7 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 19 Aug 2024 14:57:57 +0200 Subject: [PATCH 4/4] Update fetch.bs --- fetch.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/fetch.bs b/fetch.bs index d9e10b1e8..7dfbe1b5a 100644 --- a/fetch.bs +++ b/fetch.bs @@ -9222,6 +9222,7 @@ triple-underscore, 保呂毅 (Tsuyoshi Horo), Tyler Close, Ujjwal Sharma, +Valentin Gosu, Vignesh Shanmugam, Vladimir Dzhuvinov, Wayne Carr,