Back to skill

Security audit

better-skill-audit (deprecated)

Security checks for vulnerabilities and agentic risk

Overview

This is a skill-audit guide, but it mixes read-only claims with target-directory writes and includes unsafe shell command templates for user-supplied paths.

Review before installing. Use only trusted, simple target paths, and avoid paths containing shell metacharacters. Expect the skill to read audited skill directories, optionally query Hub tooling, and write an audit report into the target directory unless you instruct the agent otherwise. Do not start the fix workflow unless you want it to back up and modify the audited skill files.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:95
Finding

Shell Command Injection Through Unquoted User-Controlled Skill Path

Content
View full analysis
/dev/null); do python3 -m py_compile "$f" 2>&1 && echo "OK: $f" || echo "SYNTAX ERR: $f" done ``` ### Technical Analysis The Skill explicitly accepts a relative or absolute Skill path from the user and instructs the Agent to interpolate that value directly into shell commands. The `{skill-path}` placeholder is not quoted, canonicalized, or passed as a discrete command argument. If the Agent executes these templates through a shell, metacharacters embedded in the path can be parsed as shell syntax rather than as part of a pathname. Whitespace, wildcards, leading option characters, command separators, redirections, and command substitutions can therefore alter the intended command. The `for f in $(find ...)` form introduces an additional pathname-handling flaw: command substitution and shell word splitting corrupt filenames containing spaces or newlines. An adversarial filename can consequently change which paths are passed to the syntax checker. ### Attack Path 1. An attacker supplies an audit target containing shell syntax, such as a path value conceptually shaped like: ```text /tmp/target; attacker_command; # ``` 2. The Agent replaces `{skill-path}` with the supplied string in a documented command: ```bash ls /tmp/target; attacke ...[truncated 1164 chars]
Remediation
View remediation
&2 exit 1 } ``` 2. Enforce the intended audit boundary. If audits must remain inside an approved workspace, verify that the canonical path is a descendant of that directory before reading it. 3. Quote every path expansion and use `--` to terminate command options: ```bash ls -- "$skill_path/" head -20 -- "$skill_path/SKILL.md" ``` 4. Replace unquoted `find` substitutions with quoted paths: ```bash find "$skill_path" -type f \( \ -name '*.py' -o -name '*.sh' -o -name '*.md' -o -name '*.json' \ -o -name '*.yaml' -o -name '*.js' -o -name '*.cjs' \ -o -name '*.mjs' -o -name '*.ts' \ \) ``` 5. Avoid `for f in $(find ...)`. Use null-delimited records so filenames cannot be split or reinterpreted: ```bash find "$skill_path/scripts" -type f -name '*.py' -print0 | while IFS= read -r -d '' f; do if python3 -m py_compile "$f"; then printf 'OK: %s\n' "$f" else printf 'SYNTAX ERR: %s\n' "$f" >&2 fi done ``` 6. Prefer structured filesystem tools that accept a path argument directly instead of generating shell command strings. 7. Reject unexpected control characters and shell metacharacters as defense in depth, but do not use filtering as a substitute for argument-safe execution and correct quoting. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:231
Finding

Mandatory Audit Report Write Violates the Declared Read-Only Security Boundary

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill declares a strict no-write safety rule in its red-line guidance, but later mandates writing an audit report and supports a fix workflow that modifies files. This contradiction can cause an agent to perform filesystem writes in contexts where the user or platform expects read-only behavior, weakening safety guarantees and increasing the chance of unintended file modification.

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 105)May include surrounding context.

md
按照 [references/check-rules.md](./references/check-rules.md) 逐条执行静态检查。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
按照 [references/check-rules.md](./references/check-rules.md) 逐条执行静态检查。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
按照 [references/check-rules.md](./references/check-rules.md) 逐条执行静态检查。

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

In the fix section, the skill again states a red line of 'do not execute any write operation' while the same section requires creating backups and editing files. Conflicting instructions around write permissions are dangerous because agents may ignore the stricter constraint, mis-handle consent boundaries, or apply writes unexpectedly during remediation flows.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/check-rules.md (reported line 518)May include surrounding context.

md
### D5-W3 配置文件明文凭证扫描(3分,WARN,L1)

**问题**:D5-E1 只扫**脚本赋值语句**里的明文凭证,不扫配置文件内容(config.json / .env / *.yaml)。

**判定**:
- 扫 `{skill}/` 下所有 `.json/.yaml/.yml/.env/.ini/.toml` 文件内容

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The primary heading and descriptive content switch into Chinese and present the skill guidance in that language without indicating that users may choose another language. This is a natural-language locale policy concern because the file imposes a language preference rather than offering bilingual or opt-in behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The title explicitly presents the rules in Chinese only, and the document consistently uses Chinese throughout without offering any language choice or opt-in. Under the policy for natural-language violations, forcing a specific language/locale without user choice is a reportable issue unless the constraint is documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

All user-facing instructional content in this file is written in Chinese, and the file does not offer an alternative language or state that the skill is intentionally limited to a Chinese-speaking or region-specific audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This markdown template is written as a fixed Chinese output format, beginning with a Chinese title and section naming, and does not indicate any option for the user to choose another language. Under the language/locale policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.