Template rendering was not bounded in size or time
Description
TextFormatter rendered a user-written Jinja template inside the process that asked for it, and its limits named individual operations rather than bounding the render. A template that stayed inside those caps could make the rendering process build a value of any size, or hold its event loop for as long as the sender chose. Upgrade to v0.11.0 or later.
Impact
Any signed-up user who could reach a block that takes a format string, such as Fill Text Template and Agent Output through POST /api/blocks/{id}/execute or the external API's block-execute route, could make the REST API process allocate without bound, or stop answering every request including its health check, with one request of a few dozen bytes. Availability only: no data was read or changed, and with enable-platform-payment on, the route also needed a subscription tier or an active trial.
Fix
Fixed in AutoGPT Platform v0.11.0.
A template is now rendered in a separate worker process under a memory limit, and that process is stopped when the render runs past its deadline, so a template can no longer exhaust the REST API's memory or hold its event loop.
Fix: #16493.
Fix evidence: 1d9ee0ebc8d8.
Upgrade to v0.11.0 or later. Version numbers in this advisory identify Platform releases, whose Git tags are autogpt-platform-beta-v<VERSION>, rather than the backend Python package version. The significantgravitas/autogpt Docker image is tagged v<VERSION>.
Workarounds
None short of removing the Fill Text Template and Agent Output blocks' format inputs. A memory limit and a restart policy on the REST API container bound the allocation half but not the event-loop half; docker-compose.platform.yml sets neither for rest_server.
---
Details
TextFormatter.format_string (autogpt_platform/backend/backend/util/text.py) had two limits, and neither bounded a render. Both blocks rendered inside the REST API process, and neither was charged.
The size cap was a list of operations: * on a str, list or tuple, **, pow(), range(), and the width of a formatted field. Everything else Jinja and str offer for turning a short template into a long value was left as shipped: padding filters and methods that take a width, join and replace with a long argument, translate, expandtabs, ~ and + concatenation, bytes repetition, integer multiplication, and what a loop emits. Each reached the same result without touching any capped operation.
TEMPLATE_RENDER_TIMEOUT (10 s) was an asyncio.wait_for around render_async. wait_for cancels its task from a timer on the same event loop, and a cancellation is delivered only where the task suspends; a render that does no I/O never suspends. With enable_async=True Jinja compiles a loop to async for … in auto_aiter(…), whose __anext__ completes without awaiting anything, so nested loops (10^16 iterations in 156 bytes of template) ran as one uninterruptible step. The same formatter rendered LLM-block prompts and the dry-run simulator's output format in the executor process. Jinja also evaluated a wholly constant expression while compiling the template, before any render-time check could see it.
The code was introduced in ea6f37bf98b2 (2024-08-27), first released in v0.1.0; 6d0e2063ecc2 (first released in v0.6.52) narrowed it and moved the render onto the event loop behind the timeout. GHSA-ppw9-h7rv-gwq9 was the first fix in this area, capping *, **, pow() and range() and adding the timeout. This is supported platform code. The single-container Docker image (significantgravitas/autogpt, published from v0.7.1) serves the same block-execute routes through its public nginx listener, so it was affected the same way.
References
Fix: #16493. Related: GHSA-ppw9-h7rv-gwq9.
Timeline
Reported 2026-10-30 · Triaged 2026-11-01 · Fixed 2026-11-04 · Published 2026-11-17.