Threat
Mistral Vibe Permission Bypass and Arbitrary Code Execution
Publication date not yet evaluated · Added secmate.dev
Page published · Page updated
Coverage timeline
Single-source research — one report is available.
Why it matters
Mistral Vibe's permission bypass shows how a mismatch between how an AI coding agent parses and executes shell commands lets attacker-controlled repository content achieve arbitrary code execution without user approval, a core risk for any auto-approving agentic tool.
SecMate disclosed two flaws in Mistral Vibe 2.25.0 (CVE-2026-87987 and CVE-2026-87984) where the coding agent's Bash tool used Tree-sitter to extract a reduced representation of a shell command for its permission allowlist, then executed the original untouched string. Hostile repository content could lead the model to emit a crafted tool call (e.g. an environment assignment prefixing an allowlisted command) that the permission parser classified as read-only, bypassing the approval prompt and enabling arbitrary code execution and reads/writes outside the authorized workspace. Mistral released Vibe 2.25.4 on September 12, 2026.
Summary
During a review of Mistral Vibe 2.25.0, SecMate identified a permission-bypass class in the coding agent's Bash tool: the permission layer evaluated a reduced, Tree-sitter-extracted representation of a shell command against an allowlist, but the shell then executed the original, untouched command string. This gap let commands classified as read-only run as arbitrary code without the expected approval prompt.[0]
SecMate grouped the findings into two security-boundary reports — SECMATE-2026-0038 (shell semantics omitted by the permission parser enabling arbitrary code execution) and SECMATE-2026-0039 (redirects, expansions, and option values reading or writing outside the authorized workspace). These map, with overlapping scope, to public CVE-2026-87984 through CVE-2026-87988.[0][10][11][12][13][14]
The issues were disclosed responsibly and patched: Mistral released Vibe 2.25.4 on September 12, 2026 to address the original reported variants, with additional permission-bypass hardening in 2.25.5, 2.25.7, and 2.25.8. SecMate advises upgrading to 2.25.8 or later. There is no evidence of in-the-wild exploitation.[0][3][6][7][8]
Attack chain
- Delivery of hostile content: An attacker places a crafted shell instruction in repository content Vibe consumes — commit messages, project instructions, documentation, issues, or tool output — via social engineering to review a malicious repo, compromise of a trusted repo, or a malicious submodule.[0]
- Model emits the crafted tool call: Vibe processes the attacker-controlled content and the model emits the crafted shell Bash tool call; this content-dependent step depends on model behavior.[0]
- Permission bypass: The Bash tool's permission parser extracts a reduced representation (dropping environment assignments, redirects, expansions, and option values), matches it against the allowlist, and resolve_permission() returns ALWAYS so no approval prompt appears.[0]
- Shell execution: The shell receives the original command string and applies the dropped semantics (e.g. an attacker PATH or GIT_EXTERNAL_DIFF assignment), resolving the command to a repository-controlled program, producing arbitrary code execution with the Vibe process identity.[0]
- Impact / exfiltration: The executed code runs with Vibe's OS privileges and can read/modify files, start processes, and make network connections; the demonstrated PoC exfiltrates the victim's Mistral token.[0][1]
Disclosure timeline
| Date | Event |
|---|---|
| September 5, 2026 | SecMate reported SECMATE-2026-0038 and SECMATE-2026-0039 to Mistral.[0] |
| September 11, 2026 | HiddenLayer published its advisories.[0] |
| September 12, 2026 | Mistral released Vibe 2.25.4 addressing the original reported PoC paths.[0][3] |
| September 14, 2026 | Mistral published security advisory MAI-2026-003 with public categories and affected versions.[0][2] |
| September 23, 2026 | SecMate published its blog analysis (updated September 24, 2026).[0] |
How it works
The Bash tool walked the Tree-sitter parse tree and collected only nodes of type command_name, word, string, raw_string, and concatenation into a 'parts' list, which it compared against an allowlist and workspace path checks. Because the original command string (args.command), not the reconstructed parts, was passed to spawn_shell_command, the shell honored assignments, substitutions, redirects, and command-specific options that the permission check had ignored.[0][4]
SECMATE-2026-0038 abused this by parsing environment assignments separately from the command. An allowlisted 'cat input.txt' preceded by PATH=./bin:$PATH caused the resolver to approve while the shell applied the attacker PATH and ran ./bin/cat. SecMate reproduced four execution paths: environment assignment (PATH), GIT_EXTERNAL_DIFF assignment with git diff --ext-diff, a split find -exec predicate, and command substitution in an unquoted heredoc.[0]
SECMATE-2026-0039 concerned the workspace path check, which only inspected selected positional tokens, skipped tokens beginning with '-', did not expand variables, and did not inspect redirect targets. Variable-expanded reads, redirected writes, and paths inside options such as sort -o and git --output all resolved to ALWAYS, allowing reads and writes outside the authorized workspace.[0]
The 2.25.4 fix removes the assumption that an incomplete parse is safe: a shared analyzer walks the full syntax tree for both shell implementations, and redirects, assignments, expansions, substitutions, compound commands, parse errors, and unsupported syntax now require approval. Command-specific policies flag side-effecting options (find -exec, git diff --ext-diff, sort -o) and path-bearing option values are included in workspace checks — a fail-closed design.[0][5]
Affected versions and patch status
| Product | Affected | Patch status |
|---|---|---|
| Mistral Vibe (CVE-2026-87984, shell redirection targets) | 1.3.4 to 2.25.3 | Fixed in 2.25.4; upgrade to 2.25.8 or later recommended[0][11] |
| Mistral Vibe (CVE-2026-87985, ANSI-C quoted arguments) | 2.9.0 to 2.25.3 | Fixed in 2.25.4; upgrade to 2.25.8 or later recommended[0][13] |
| Mistral Vibe (CVE-2026-87986, incomplete command parsing) | 1.3.4 to 2.25.3 | Fixed in 2.25.4; upgrade to 2.25.8 or later recommended[0][12] |
| Mistral Vibe (CVE-2026-87987, environment assignments) | 2.6.0 to 2.25.3 | Fixed in 2.25.4; upgrade to 2.25.8 or later recommended[0][10] |
| Mistral Vibe (CVE-2026-87988, command allowlist and path-validation gaps) | Introduced in 2.15.0; partial fixes in 2.20.0 and 2.23.0; reported option bypasses through 2.25.3 | 2.25.4 for remaining reported variants; upgrade to 2.25.8 or later recommended[0][14] |
Key takeaways
- Authorization layers that evaluate a reduced or normalized representation of a command while the executor runs the original string are inherently bypassable; the permission model must fail closed on any syntax it cannot fully model.[0]
- Coding agents run where valuable data lives, so a permission bypass leading to code execution under the agent's identity can expose SSH keys, cloud credentials, registry tokens, model API keys, and source code; the PoC demonstrated Mistral-token exfiltration on both Linux and macOS.[0]
- The vulnerabilities were coordinated and patched with no evidence of in-the-wild exploitation; defenders should upgrade to 2.25.8 or later and limit credentials exposed to agent child processes.[0][8]
Defensive actions
- Upgrade Mistral Vibe to 2.25.8 or later, restart active sessions, and verify with 'vibe --version'.: 2.25.4 addressed the original reported PoC paths while 2.25.5, 2.25.7, and 2.25.8 added further permission-bypass hardening including the less/LESSOPEN/--lesskey-src path.[0][8]
- Treat coding-agent approval logic as a security boundary, not a UI feature, and do not pass a rich shell language through an allowlist unless the authorization layer models every semantic feature the executor honors.: The root cause was a mismatch between the reduced representation the permission layer checked and the full command string the shell executed.[0]
- Keep high-value credentials out of agent child-process environments unless the task requires them.: Code executed under the Vibe process identity inherits its environment, including MISTRAL_API_KEY when supplied via the environment, enabling token exfiltration.[0]