Case · DiggingBeagle record

A CPython memory error broke the Jinja boundary around model chat templates

RunSybil reported controlled code execution from a modified model chat template through CPython generic-alias machinery. The finding concerns interpreter-backed containment, not a model following injected instructions.

Public disclosure: Nov 3, 2026

Scope

Vulnerability reported in a controlled research or disclosure setting. Exact prerequisites, versions and absence of documented exploitation must be preserved.

Assessment profile

Assessment method
Setting
research demonstration
Exploitation
demonstrated
Evidence
Grade B
Remediation
mitigation available
AI role
AGAINST AI
Basis and provenance

The cited first-party advisory or research establishes the stated mechanism only within its documented conditions. No unrelated production compromise, extended victim scope, financial harm or universal mitigation is inferred.

Assessed Nov 9, 2026 using diggingbeagle.assessment/1.

At a glance

Mechanism and trust boundary

  1. 01

    An inference platform loads a modified or untrusted model with chat-template input that executes under a constrained Python/Jinja environment.

  2. 02

    Crafted generic-alias substitution hooks invalidate the cached parameter tuple during interpreter processing.

  3. 03

    The researcher uses resulting unsafe interpreter object behavior to escape the template restriction and reach execution capabilities.

Claims & evidence

CLM-DB233-JINJA-BOUNDARYThe demonstrated execution used a malicious chat template and interpreter memory-safety behavior inside a model-loading context; it did not establish escape from the surrounding container or host isolation.supported

Basis: reported finding

Link to claim
CLM-CPYTHON-JINJA-ALIAS-ESCAPERunSybil demonstrated a Python generic-alias substitution memory error in a constrained Jinja environment used to render model chat templates.supported

Basis: reported finding

Link to claim
CLM-CPYTHON-RESPONSE-UNCERTAINRunSybil said it had coordinated disclosure with CPython, Pallets and Hugging Face but had not established a holistic upstream remediation owner when it published its report.supported

Basis: reported finding

Link to claim

Implications

The environment running templates may inherit filesystem and model-provider privileges if an untrusted model template can execute code.

Controls and mitigations

  • Do not execute unreviewed model template code in a privileged host interpreter; isolate template rendering and pin vetted model artifacts and runtimes.

Unknowns and contradictions

  • The first-party researcher report supports controlled execution, not a confirmed exploitation campaign or host-level compromise of all AI inference services; affected deployment matrix and a universal fixed version remain unknown.

Sources and citation

Material revision history

  1. Nov 9, 2026 · Published version · first publication · revision 233
  2. Nov 10, 2026 · Published version · material revision · revision 234Public fields changed: claims