Skip to content

The MOSAIC framework uses CLI command combination attacks against coding agents, achieving a success rate of 96.59%MOSAIC: Knowledge-Guided CLI Command Composition Attack in LLM Coding Agents

Paper Tracker· arXiv:2607.02857· Jiangrong Wu, Huaijin Wang, Yihao Zhang, Yuhong Nan, Shuai Wang·Indexed by this site · 2026-10-09· Originally publishedSelected AttacksSelectedAttention41

Translation in progress — untranslated text is omitted.

Quick read

Attacks

Based on the paper PDF (generated by Gemini); refer to the original

AI summaryResearchers from Sun Yat-sen University, Shandong University, Peking University, and Hong Kong University of Science and Technology propose MOSAIC, a knowledge-guided framework that distills CVEs, security advisories, and researcher PoCs into reusable command-state summaries, then combines them into attack paths and instantiates them as real development workflows, for black-box evaluation of coding agents' CLI command composition risk (CCR). Across five coding agents—Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, and Trae Agent—and five backend LLMs, totaling 2,525 trials, MOSAIC achieves a 96.59% end-to-end attack success rate under benign development tasks, while the matched instruction-layer baselines AIShellJack and generic indirect prompt injection achieve only 2.18% and 0.79%, respectively. The authors state that the structured knowledge base is key, improving effective attack generation by over 50% compared to a pure LLM generator.

Questions
Coding agents invoke multiple CLI commands through shared operating system state to complete tasks. A single seemingly benign command can, through producer-consumer state passing, combine across command trajectories into security-sensitive capabilities beyond the user's task scope, forming an overlooked CLI command combination risk (CCR).
Methods
MOSAIC extracts command-state summaries from CVEs, security advisories, and PoCs and classifies them into 13 families; by enumerating dependency chains and feasibility checks, it combines valid state transitions into attack paths; then it uses LLMs to generate aligned benign prompts, malicious resources, and expected command sequences, and determines attack success through external effects in black-box execution.
Experiments and results
In 2,525 trials across 5 code agents and 5 backend LLMs, MOSAIC achieves a 96.59% end-to-end ASR, far higher than the two instruction-layer baselines (up to 2.18%); among 5 types of existing defenses, 3 types have an ASR reduction of 0.00 percentage points, and under the strongest defense, 82.57% of attacks still succeed.
Limitations and future work
The study evaluated 101 evidence-based exploitation paths, not exhausting all CLI combination strategies; experiments covered 5 coding agents and 5 backend LLMs; the knowledge base construction phase relied on human final confirmation of candidate entries; defense analysis covered only 5 selected tools on a single agent.
Why it was selectedThe paper proposes CLI command combination risk, distills a knowledge base from CVEs and PoCs to generate attack chains, reports success rates on five coding agents, and tests five defenses.

The paper proposes CLI command combination risk, distills a knowledge base from CVEs and PoCs to generate attack chains, reports success rates on five coding agents, and tests five defenses.

Related events and news

0 events · 1 news mentions

News that mentions this paper

Read originalarxiv.org