This repository has been archived on 2026-11-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
fl0l0u 7b9f33653f vendor: the jinja engine budgets its nesting and its range()
A container's chat template is server-side attacker data the engine
parses and runs without any budget. The parser recursed once per nesting
block or paren: tens of KB of "{{ (((" or "{% if %}" in one
tokenizer.chat_template stack-overflowed whoever read it -- the
capability probe or the first render -- past every catch, and errors-
as-values cannot hold a stack overflow. And range() materialised one
array element per step: {{ range(4000000000) }} was an OOM per render.

Both entry points now share one 128-level guard whose throw is the same
exception class a malformed template already raises, and range() refuses
above 65536 values -- far past any template that exists, small enough
that the whole range stays transient. The refusals cross the ChatTemplate
seam as the error values the seam promises (a chat_test case pins that
both shapes refuse and that real nesting still renders). UPSTREAM keeps
the addition under the chat lift's record; the manifest re-hashes.
2026-11-15 20:38:09 +00:00
..
2026-10-04 12:02:41 +02:00
2026-10-04 12:02:41 +02:00