Back to skill

Security audit

Skill Generator

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a coherent skill-generation tool, but its own safety audit can be bypassed before packaging and default local installation.

Use Review-level caution before installing. The tool's purpose is legitimate, but do not rely on its P0 audit as a hard security gate unless P0 suppression is fixed. Prefer --no-install for trial runs, inspect .skillignore and inline ignore markers in any skill being packaged, and manually review generated packages before installing or publishing them.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/audit_skill.py:267
Finding

Attacker-Controlled Suppression Bypasses Mandatory P0 Audit Gates

Content
View full analysis

Vulnerability Details

File Location: scripts/audit_skill.py:267-275, 304-320, 360-366, 921-936; downstream packaging and installation at scripts/pack_skill.py:508, 562, 595
Vulnerability Type: Security validation bypass
Risk Level: High

Complete Code Snippets

scripts/audit_skill.py:267-275:

python
class Report:
    def __init__(self, ignored_rules=None):
        self._map = {}
        self.ignored_rules = set(ignored_rules or ())
        self.ignored_hits = 0

    def add(self, sev, cat, file, rule, line, sample, hint):
        if rule in self.ignored_rules:
            self.ignored_hits += 1
            return

scripts/audit_skill.py:304-320:

python
def load_skillignore(root: Path):
    p = root / ".skillignore"
    globs, rules = [], set()
    if not p.exists():
        return globs, rules
    for line in (read_text(p) or "").splitlines():
        s = line.strip()
        if not s or s.startswith("#"):
            continue
        if s.lower().startswith("rule:"):
            rules.add(s[len("rule:"):].strip())
        else:
            globs.append(s.rstrip("/"))
    return globs, rules

scripts/audit_skill.py:360-366:

python
def scan_lines(path: Path):
    text = read_text(path)
    if text is None:
        return
    for i, line in enumerate(text.splitlines(), 1):
        if "skill-audit: ignore" in line:
            continue

scripts/audit_skill.py:921-936:

python
def audit(root: Path, market: bool = False, ignored_rules=None, ignore_globs=None) -> Report:
    si_globs, si_rules = load_skillignore(root)
    rep = Report(ignored_rules=set(ignored_rules or ()) | si_rules)
    if not root.exists() or not root.is_dir():
        rep.add("P0", "参数", root, "目录无效", 0, "目录不存在或不是目录", "")
        return rep
    content = check_structure(root, rep, market)
    if market and content is not None:
        check_market(root, rep, content)
    files, junk_dirs = walk_tree(root, list(ignore_globs or ()) + si_glob
...[truncated 3066 chars]
Remediation
View remediation

Remediation Suggestions

  1. Prohibit all suppression of P0 rules. In Report.add(), apply ignored-rule handling only after verifying that sev is not P0:
python
if sev != "P0" and rule in self.ignored_rules:
    self.ignored_hits += 1
    return
  1. Maintain an explicit allowlist of suppressible P1/P2 rule identifiers. Reject unknown rule names and any attempt to suppress credential, dangerous-execution, or structural P0 checks.

  2. Replace the generic substring check in scan_lines() with a structured exemption parser that:

    • is limited to approved executable file types;
    • requires an exact end-of-line annotation;
    • names the specific rule being exempted;
    • permits only allowlisted P1/P2 rules; and
    • never skips the entire line before P0 checks run.
  3. Treat .skillignore as untrusted policy input. Separate file-exclusion patterns from audit-rule exemptions and display every accepted exemption prominently in packaging output.

  4. Before packaging, run a second non-suppressible P0 pass over every file that will be included in the archive. Installation must use the same validated file set.

  5. Add regression tests covering every P0 rule through both suppression mechanisms. Tests should verify that .skillignore, --ignore-rule, and inline markers cannot reduce a P0 finding or permit packaging.

Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (62)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A second behavior mismatch indicates the skill performs remote version checks and local metadata inspection that are not central to the declared purpose, while several headline capabilities appear unimplemented. Undocumented network access and local file inspection are security-relevant behaviors because they expand data handling and outbound communication beyond what a user would reasonably infer from the skill description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A second behavior mismatch indicates the skill performs remote version checks and local metadata inspection that are not central to the declared purpose, while several headline capabilities appear unimplemented. Undocumented network access and local file inspection are security-relevant behaviors because they expand data handling and outbound communication beyond what a user would reasonably infer from the skill description.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 57)May include surrounding context.

md
> - `pack_skill.py` 默认带安装 → **打包即安装**,要纯 zip 才加 `--no-install`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 69)May include surrounding context.

md
> - `pack_skill.py` 默认带安装 → **打包即安装**,要纯 zip 才加 `--no-install`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 325)May include surrounding context.

md
> - `pack_skill.py` 默认带安装 → **打包即安装**,要纯 zip 才加 `--no-install`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 328)May include surrounding context.

md
> - `pack_skill.py` 默认带安装 → **打包即安装**,要纯 zip 才加 `--no-install`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 331)May include surrounding context.

md
> - `pack_skill.py` 默认带安装 → **打包即安装**,要纯 zip 才加 `--no-install`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 334)May include surrounding context.

md
> - `pack_skill.py` 默认带安装 → **打包即安装**,要纯 zip 才加 `--no-install`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 337)May include surrounding context.

md
> - `pack_skill.py` 默认带安装 → **打包即安装**,要纯 zip 才加 `--no-install`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 340)May include surrounding context.

md
> - `pack_skill.py` 默认带安装 → **打包即安装**,要纯 zip 才加 `--no-install`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 343)May include surrounding context.

md
> - `pack_skill.py` 默认带安装 → **打包即安装**,要纯 zip 才加 `--no-install`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 346)May include surrounding context.

md
> - `pack_skill.py` 默认带安装 → **打包即安装**,要纯 zip 才加 `--no-install`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 449)May include surrounding context.

md
> - `pack_skill.py` 默认带安装 → **打包即安装**,要纯 zip 才加 `--no-install`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 60)May include surrounding context.

md
> - 上架前用 `make_icon.py` 出一张图标(512×512、PNG/JPG、≤500KB)—— 图标由平台**单独收**,**不在 zip 里**。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 449)May include surrounding context.

md
> - 上架前用 `make_icon.py` 出一张图标(512×512、PNG/JPG、≤500KB)—— 图标由平台**单独收**,**不在 zip 里**。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 68)May include surrounding context.

md
python scripts/audit_skill.py <技能目录> --market # 上架前体检

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 289)May include surrounding context.

md
python scripts/audit_skill.py <技能目录> --market # 上架前体检

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 290)May include surrounding context.

md
python scripts/audit_skill.py <技能目录> --market # 上架前体检

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 291)May include surrounding context.

md
python scripts/audit_skill.py <技能目录> --market # 上架前体检

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 292)May include surrounding context.

md
python scripts/audit_skill.py <技能目录> --market # 上架前体检

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 111)May include surrounding context.

md
| **纯指导型** | 以判断、话术、流程约定为主,无固定命令 | 只有 `SKILL.md`(长内容拆 `references/`) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 112)May include surrounding context.

md
| **纯指导型** | 以判断、话术、流程约定为主,无固定命令 | 只有 `SKILL.md`(长内容拆 `references/`) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 144)May include surrounding context.

md
| **纯指导型** | 以判断、话术、流程约定为主,无固定命令 | 只有 `SKILL.md`(长内容拆 `references/`) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 153)May include surrounding context.

md
| **纯指导型** | 以判断、话术、流程约定为主,无固定命令 | 只有 `SKILL.md`(长内容拆 `references/`) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 358)May include surrounding context.

md
| **纯指导型** | 以判断、话术、流程约定为主,无固定命令 | 只有 `SKILL.md`(长内容拆 `references/`) |