arXiv:2610.37901cs.CROct 2026

Manuscript Offprint

arXiv:2610.37901

Scan Before You Install: Detecting and Mitigating Local and Composite Vulnerabilities in Skills

Parth A. Gandhi, Avital Aviv, Prasanna N. Wudali, Yuval Elovici, Asaf Shabtai

Abstract

An agent skill is a package of natural-language instructions, scripts, and reference files that an LLM-based agent loads on demand to perform a specific task. Because skills may access the file system, shell, and network under user-authorized permissions, weaknesses in their instructions or code can lead to unsafe execution. We identified two limitations of existing skill scanners: they target primarily malicious skills rather than unintended vulnerabilities in skills from public repositories, and they typically analyze skills in isolation, overlooking vulnerabilities that emerge from multi-skill interactions. To address these gaps, we developed a scanner comprising six modules: Content Extraction, Local Analysis, Composite Analysis, Validation, Reporting, and Mitigation. The Local Analysis detects vulnerabilities within individual skills, including unintended vulnerabilities in benign skills. On 556-case leaderboard subset of SkillTrustBench, it achieved 95.90% recall with a 4.22% false positive rate, and on a balanced sample of 1,000 MalSkillBench skills, it achieved an F1F_1 score of 0.947, outperforming four baselines: Cisco's Skill Scanner, NVIDIA's SkillSpector, AgentSkillsScanner, and SkillSieve. We also evaluated it on 1,587 skills from the 75 most-starred GitHub repositories containing skills, and three analysts confirmed 53 of 59 findings (89.8% precision) in 23 repositories. We developed a proof-of-concept (PoC) attack for each of these vulnerabilities, disclosed the 10 medium- and high-severity cases to the affected maintainers, and used the remaining attacks to test mitigations. The Composite Analysis module models dependencies among skills through shared resources, invocations, and instruction-mediated interactions. On SCR-Bench, it achieved an F1F_1 score of 0.991 (98.7% precision, 99.6% recall), compared with F1F_1 scores of 0.816–0.858 for three SkillsGuard configurations released with CompoSkill. When applied to the same GitHub corpus, it identified two composite findings, which we also validated using PoC attacks. Finally, our Mitigation module recommends skill substitution, patches, and configuration changes. Of the 55 GitHub findings, mitigations for 47 prevented the corresponding PoC attacks in all trials while preserving the tested legitimate functionality. Upon acceptance, we will open-source the scanner, rule catalog, prompts, and findings.

Email addresses: gandhip@post.bgu.ac.il (Parth A. Gandhi), avivavit@post.bgu.ac.il (Avital Aviv), wudalipr@bgu.ac.il (Prasanna N. Wudali), elovici@bgu.ac.il (Yuval Elovici), shabtaia@bgu.ac.il (Asaf Shabtai)

1^{1}These authors contributed equally to this work.

1. Introduction

An agent skill is a package of natural-language instructions, scripts, and reference files that an LLM-based agent loads on demand to perform a specific task. [1, 2]. Each skill's primary document, SKILL.md, contains YAML front matter that describes the skill, followed by a body of natural-language instructions. A skill packages instructions into a reusable procedure, facilitating consistent use across multiple agents and projects. Agents such as Claude Code, Codex CLI, Gemini CLI, Cursor, and OpenClaw keep the skill's name and description in context and load its full instructions when necessitated by a task. When a user installs and invokes a skill, the agent follows its instructions and accesses the file system, shell, and network under the permissions the user authorizes. The agent's runtime permission policy determines whether these operations require further approval. For example, if a skill instructs the agent to run a shell command that the user has permitted under an "always allow" rule, the agent can execute it without another approval prompt [3]. Malicious skill authors exploit this deliberately; an analysis of the ClawHavoc campaign documented 1,184 malicious skill packages on ClawHub [4]. Skills written in good faith can also cause harm: weaknesses in their instructions or code can cause the agent to disclose file contents or execute commands originating in untrusted content. Detecting such weaknesses requires the examination of both a skill's instructions and its code. The bundled scripts define operations, while the instructions tell the agent when to perform them and what data to supply. The instructions may also guide actions that the bundled code does not implement, such as executing commands found on a retrieved web page. Following such an instruction gives the page's author control over the commands the agent executes. A security analysis must therefore identify cases where a skill allows untrusted content to determine the agent's actions [5, 6].

Furthermore, an agent can use multiple skills to perform a single task, passing content between the skills through shared files, environment state, or conversation context. These interactions can connect capabilities that appear benign in isolation [7]. For example, one skill may write an archive of sensitive files to a staging directory, while another uploads that directory's contents to a server when preparing a support bundle. An attacker who controls content the agent reads during the task may induce the agent to chain these operations and exfiltrate data without modifying either skill. Detection of this risk requires examination of the skills involved and the content passed between them.

Most existing skill scanners analyze skills individually. For example, Cisco's Skill Scanner and NVIDIA's SkillSpector combine static checks with optional model-assisted analysis to identify security risks within a skill [8, 9]. This focus on individual skills also characterizes large-scale studies of public skill repositories. Liu et al. [10] used SkillScan to analyze 31,132 of the 42,447 skills they collected, flagging potential vulnerabilities in 26.1% of the analyzed skills. Snyk's ToxicSkills study used scanners built on the mcp-scan engine and reported potential security flaws in 36.8% of 3,984 skills [11]. Evaluating the accuracy of such scanners requires labeled cases, which MalSkillBench and SkillTrustBench provide for individual skills [6, 12]. These benchmarks consist mainly of deliberately malicious skills and do not measure how scanners handle unintended weaknesses in skills written for benign purposes, which our in-the-wild evaluation examines. Moreover, evaluating whether a scanner detects vulnerabilities arising from skill interactions requires benchmark cases in which multiple skills are used together, and one skill's outputs, instructions, or state changes influence another's behavior. SCR-Bench provides such cases in controlled, sandboxed workflows covering capability flow, trust transfer, and authorization confusion [7]. To the best of our knowledge, no open-source scanner both examines a skill for vulnerabilities in isolation and assesses whether adding it to an installed skill set could create an exploitable path through interactions with the existing skills.

These limitations motivate our hypothesis that examining a skill's instructions and code together with its dependencies on other skills can identify exploitable weaknesses both within individual skills and across multiple skills. We investigate this hypothesis by analyzing 75 most-starred GitHub repositories containing skills.

To enable this analysis, we developed a scanner with six modules: Content Extraction, Local Analysis, Composite Analysis, Validation, Reporting, and Mitigation. The scanner's Content Extraction module collects each skill's instructions, supporting files, declarations, and source locations. Local Analysis uses this data to detect potential vulnerabilities within individual skills by identifying unsafe patterns, tracing inputs into sensitive operations, and assessing installation sources and capability declarations. Its optional LLM-based instruction review checks whether requested actions cross trust or authorization boundaries and supports its findings with supporting evidence from the source. Composite Analysis detects potential vulnerabilities that emerge from interactions among skills. It builds a dependency graph connecting skills through file handoffs, shared environment state, and named invocations. The graph records each skill's inferred capabilities and permission declarations, along with evidence for each dependency. For shared resources, the module traces how one skill uses data written by another and applies rules to identify when untrusted content reaches sensitive operations across skill boundaries. Optional LLM-based enrichment proposes additional dependencies conveyed through instructions and task context. Both analysis modules produce candidates, each describing a potential vulnerability or declaration mismatch together with supporting evidence. The scanner's Validation module checks these candidates against their source evidence before accepting them as findings. The Reporting module combines the accepted findings and identifies the implicated skills and supporting evidence for each. The Mitigation module uses these findings to recommend skill substitution, instruction or code patches, and configuration changes. It uses sandbox tests to check whether a proposed change blocks the harmful behavior described in a finding and preserves the user's intended task.

Our evaluation addressed five research questions: detection of vulnerabilities within individual skills from public repositories (RQ1); the accuracy of Local Analysis on labeled individual-skill benchmarks compared with existing scanners (RQ2); detection of vulnerabilities emerging due to skill interactions from public-repository skills, including comparison with SkillsGuard scanner on a labeled benchmark dataset (RQ3); the contribution of scanner components through ablation (RQ4); and mitigation effectiveness and legitimate task preservation (RQ5).

To assess the scanner's ability to detect vulnerabilities in individual skills (RQ1), we scanned 1,587 skills from 75 repositories. Three independent analysts confirmed 53 of the 59 reported findings (89.8% precision) in 23 repositories, covering code or command execution controlled by injected content, instructions that persist across sessions, bypassed approvals, writes to sensitive directories, and disclosure of data or credentials. We developed

PoC attacks for all 41 vulnerabilities, disclosed the 10 covering medium- and high-severity vulnerabilities to the affected maintainers, and used the others to test mitigations (§6.3).

To evaluate the accuracy of Local Analysis on labeled individual-skill benchmarks (RQ2), we compared it with four existing scanners: Cisco's skill-scanner, NVIDIA's SkillSpector, AgentSkillsScanner, and SkillSieve. Across all 5,520 SkillTrustBench skills, Local Analysis achieved 96.95% precision, 95.05% recall, and an F1F_1 score of 95.99%, with a 7.06% false-positive rate. On the published leaderboard's 556-case subset, it had the highest recall (95.90%) and F1F_1 score, and its 4.22% false-positive rate was second only to SkillSieve (0.60%), which recovered only 55.38% of positive cases. On a random class-balanced sample of 1,000 MalSkillBench skills, it achieved the highest precision (98.70%) and F1F_1 score (94.69%) (§6.4).

For vulnerabilities arising from skill interactions (RQ3), Composite Analysis achieved the highest precision (98.7%) and recall (99.6%) on 1,325 SCR-Bench skill sets, compared with three SkillsGuard configurations and an LLM-only baseline. On the same 1,587 skills analyzed in RQ1, the module identified two composite findings: conversation-history retrieval linked to Slack messaging, and token disclosure linked to a feed monitor and an OAuth diagnostic skill (§6.5).

To assess the scanner's component contributions (RQ4), we ablated the deterministic, LLM-assisted, and validation components and report means over five runs. In Local Analysis, validation reduced the false-positive rate of the combined detectors from 33.5% to 4.6%, achieving 98.0% precision and 96.0% recall. In Composite Analysis, the deterministic interface layer detected 146 of the 267 risky sets without false positives; model-proposed edges raised recall from 54.7% to 99.2%, and validation reduced the false-positive rate from 7.0% to 2.4%, reaching 98.0% precision and 95.4% recall (§6.6).

For mitigation (RQ5), we applied the scanner's recommendations for all 55 findings (53 local and two composite), replayed each PoC three times, and checked that the legitimate task still worked. The mitigations blocked the attack in all three trials for 47 findings without breaking the task and partially mitigated six. The remaining two findings could not be evaluated experimentally because sandbox restrictions prevented installation, leaving both mitigation effectiveness and task preservation unverified (§6.7).

We make the following four contributions.

  • We present an open-source scanner that checks individual skills for vulnerabilities and assesses whether adding a skill to an installed set could introduce exploitable paths.
  • We audit 1,587 skills from the 75 most-starred GitHub repositories containing skills, and three independent expert analysts validated the reported findings.
  • To the best of our knowledge, we are the first to report an in-the-wild composite vulnerability arising from interactions between benign skills from separate developers.
  • We develop and evaluate mitigation recommendations for local and composite findings, including skill substitution, patching, and configuration changes, and assess both attack prevention and legitimate-task completion.

(a) Anatomy of a skill

Figure

Figure 1: Anatomy of a skill: its directory structure, the contents of SKILL.md, and staged loading by an agent.

Figure

Figure 2: A vulnerable skill contains an unintentional weakness, whereas a malicious skill deliberately embeds harmful behavior.

References (22)