Quick Take
- What: CVE-2026-124028 is a delimiter injection vulnerability in mistralrs-core that allows attackers to inject forged tool calls by embedding delimiter strings in text the model quotes.
- Who is affected: Users of mistral.rs versions before 0.9.5 who process untrusted runtime content (documents, web pages, support tickets, tool outputs) with qwen-xml, gemma4, or reasoning parsers.
- What to do: Upgrade to mistral.rs version 0.9.5 or later, which validates that tool-call and reasoning delimiters are emitted as special tokens rather than ordinary text.
- Scope: The forged tool name must already be declared for the request, limiting impact to tools already registered in the agent’s configuration.
- Fix: Version 0.9.5 was released on October 19, 2026, and includes commit b43d344 that restricts delimiter recognition to special tokens only.
In plain English
A security flaw in mistral.rs, a tool for running large language models, allowed attackers to trick the system into executing extra commands.
What you should do: If you used mistral.rs to process documents or web pages from untrusted sources, an attacker could hide special marker strings in that content. When the AI model quoted those strings, mistral.rs would incorrectly interpret them as real commands. Version 0.9.5 fixes this by checking that command markers come from the AI model itself, not from quoted text. If you use mistral.rs to build AI agents or process untrusted content, upgrade to version 0.9.5 immediately.
What happened
mistral.rs is an open-source inference engine for large language models. Before version 0.9.5, the mistralrs-core component parsed tool calls by searching for delimiter strings in decoded text. The qwen-xml and gemma4 parsers used regular expressions to locate tags like <tool_call>, </tool_call>, <function=...>, and </parameter> in the model’s output.
The vulnerability arose because these parsers did not distinguish between delimiters emitted by the model as special tokens and identical strings that appeared in ordinary text the model quoted from runtime documents. An attacker who controlled a document, web page, support ticket, file, or tool output processed by the agent could embed delimiter strings in that content. When the model quoted the attacker-controlled text, the parser would interpret the embedded delimiters as structural markers, terminating the current argument or tool-call region and opening a new one.
Researchers Taehun Kim and Youngjoo Shin from Korea University demonstrated that the model could emit one tool call, but mistralrs-core would return two, with the second call assembled from bytes originating in the attacker-controlled document. A similar issue affected reasoning boundaries: quoted document content could terminate the reasoning span and be interpreted as a tool call even though the model produced none.
The forged tool name had to match a tool already declared for the request, which limited the scope of the attack. However, in deployments that registered many tools (including MCP-based deployments combining tools from multiple servers), the restriction still left security-sensitive tools reachable with attacker-chosen arguments.
The issue was assigned CVE-2026-124028 and received a CVSS score of 4.2 (medium severity). It was classified as CWE-138 (Improper Neutralization of Special Elements) and CWE-436 (Interpretation Conflict).
What you should do
Upgrade to mistral.rs version 0.9.5 or later. The fix, merged in pull request #2455 and released on October 19, 2026, introduces a SpecialTextGuard that tracks whether each decoded token was emitted as a special token. The parsers now only honor tool-call and reasoning delimiters that were produced as special tokens by the model, not as ordinary text quoted from runtime content.
The fix also includes a defuse_tool_output function that sanitizes tool outputs in the message history before they are processed by the chat template, preventing injected delimiters in tool results from being interpreted in subsequent turns.
No configuration changes are required after upgrading. The new validation logic is applied automatically when tool calling or reasoning features are enabled.
What it means
This vulnerability highlights a trust boundary issue in agent systems that process untrusted runtime content. Even when the model file, tokenizer configuration, and chat template are trusted, an attacker who controls documents or tool outputs can manipulate the agent’s behavior by injecting structural markers that the parser interprets as commands.
The declared-tool restriction reduced the immediate impact, but the flaw still allowed attackers to invoke any registered tool with arbitrary arguments. In deployments with broad tool sets, this could enable unauthorized actions such as data exfiltration, privilege escalation, or denial of service, depending on the capabilities of the declared tools.
The fix establishes a clear provenance check: delimiters are only recognized when they originate from the model’s special-token vocabulary, not from quoted text. This approach aligns with the principle that control structures should be distinguished from data at the parsing layer, not just at the semantic layer.
The researchers disclosed the issue responsibly and are coordinating public disclosure with an academic paper. The fix was released within three weeks of the initial report.



