Skip to content

Commit c6a1cc3

Browse files
annevkdomenic
andauthored
Address limits on unconstrained inputs
Part of the wording is adopted from the HTML Standard. Follow-up: #523. Co-authored-by: Domenic Denicola <[email protected]>
1 parent eb68213 commit c6a1cc3

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

infra.bs

+37
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,39 @@ as well as the single algorithm would. Therefore performance is best left as a f
240240
over.
241241

242242

243+
<h3 id=algorithm-limits>Avoid limits on algorithm inputs</h3>
244+
245+
<p>A document using the Infra Standard generally should not enforce specific limits on algorithm
246+
inputs with regards to their size, resource usage, or equivalent. This allows for competition among
247+
user agents and avoids constraining the potential computing needs of the future.
248+
249+
<p tracking-vector>Nevertheless, user agents may impose <a>implementation-defined</a> limits on
250+
otherwise unconstrained inputs. E.g., to prevent denial of service attacks, to guard against running
251+
out of memory, or to work around platform-specific limitations.
252+
253+
<p class=note>Global resource limits can be used as side channels through a variant on a resource
254+
exhaustion attack, whereby the attacker can observe whether a victim application reaches the global
255+
limit. Limits could also be used to fingerprint the user agent, but only if they make the user agent
256+
more unique in some manner, e.g., if they are specific to the underlying hardware.
257+
258+
<p class=example id=example-algorithm-limits>An API that allows creating an in-memory bitmap might
259+
be specified to allow any dimensions, or any dimensions up to some large limit like JavaScript's
260+
<code>Number.MAX_SAFE_INTEGER</code>. However, implementations can choose to impose some
261+
<a>implementation-defined</a> (and thus not specified) limit on the dimensions, instead of
262+
attempting to allocate huge amounts of memory.
263+
264+
<p class=example id=example-algorithm-limits-language>A programming language might not have a
265+
maximum call stack size specified. However, implementations could choose to impose one for practical
266+
reasons.
267+
268+
<p>As code can end up depending on a particular limit, it can be useful to define a limit for
269+
interoperability. Sometimes, embracing that is not problematic for the future, and can make the code
270+
run in more user agents.
271+
272+
<p>It can also be useful to constrain an <a>implementation-defined</a> limit with a lower limit.
273+
I.e., ensuring all implementations can handle inputs of a given minimum size.
274+
275+
243276
<h3 id=algorithm-declaration>Declaration</h3>
244277

245278
<p>Algorithm names are usually verb phrases, but sometimes are given names that emphasize their
@@ -1995,12 +2028,16 @@ Chris Rebert,
19952028
Daniel Ehrenberg,
19962029
Dominic Farolino,
19972030
Gabriel Pivovarov,
2031+
Ian Hickson,
2032+
Jakob Ackermann<!-- das7pad; GitHub -->,
19982033
Jake Archibald,
19992034
Jeff Hodges,
2035+
Jeffrey Yasskin,
20002036
Jungkee Song,
20012037
Leonid Vasilyev,
20022038
Maciej Stachowiak,
20032039
Malika Aubakirova,
2040+
Martin Thomson,
20042041
Michael™ Smith,
20052042
Mike West,
20062043
Ms2ger,

0 commit comments

Comments
 (0)