Back to skill

Security audit

skill-medic

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious because it reports risks around access scope and persistent changes, alongside a possible script substitution weakness; the review is incomplete.

Consider avoiding installation until you have reviewed the reported access scope and rubric-update behavior. The scan is partial: 32 of 36 components were fully inspected, four were partially inspected, and static analysis of tool-misuse patterns was degraded, so the findings do not provide complete coverage.

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
references/cli-guide.md
Finding

Workspace-controlled scripts can impersonate the installed Skill CLI

Content
View full analysis

Impact

The substituted script executes arbitrary Python with the Agent process's operating-system permissions before the actual inventory inspection. This permits unauthorized file access or modification within those permissions.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (14)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

该脚本以自身所在项目目录为根进行检查,其主要功能与声明明确排除的内部质量自检直接重合。所提供代码未实现安装清单枚举、跨 Skill 对比、成熟度评级或处置建议。虽然一致性检查可能作为更大审计流程的辅助工具,但该脚本呈现的是独立的项目自检用途,与声明边界存在实质差异。未发现网络通信、文件写入或破坏性操作。

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · medic_tools/run.py (reported line 45)May include surrounding context.

python
#   文件系统扫描仅用于补充路径/静态指标,禁止因为"目录探测不到"就判定没有 Skill
SKILLS_DIR_CANDIDATES = [
    os.path.join(".trae", "skills"),    # Trae IDE
    os.path.join(".claude", "skills"),  # Claude Code
    os.path.join(".cursor", "skills"),  # Cursor
    os.path.join(".codex", "skills"),   # OpenAI Codex
    "skills",                            # 通用约定

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · medic_tools/run.py (reported line 47)May include surrounding context.

python
os.path.join(".trae", "skills"),    # Trae IDE
    os.path.join(".claude", "skills"),  # Claude Code
    os.path.join(".cursor", "skills"),  # Cursor
    os.path.join(".codex", "skills"),   # OpenAI Codex
    "skills",                            # 通用约定
]
GLOBAL_SKILLS_DIRS = [                                  # 全局 Skill 候选目录(§9.1,探测不到不阻断)

The manifest sets a fixed zh-CN locale without user opt-in or a domain-specific justification.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The language: zh-CN configuration establishes a specific language/locale without offering a user choice. Auditing installed AI skills is not inherently region-specific, and the manifest provides no justification for this restriction.

Content

No source excerpt is available for this finding.

The rubric-update workflow directs changes to the skill's scoring documentation and CHANGELOG, exceeding its stated audit-and-recommend purpose.

Medium
Category
Excessive Agency
Confidence
91% confidence
Finding

The workflow permits persistent changes to the scoring rubric, documentation, and CHANGELOG based on web research, without a separate approval step. Because research can start automatically on first use or when the rubric is stale, an audit request can unexpectedly become a self-modification operation, allowing untrusted external recommendations to influence future assessments.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Tainted flow: 'path' from os.environ.get (line 174, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · medic_tools/run.py (reported line 175)May include surrounding context.

python
def save_medic_json(project_root: str, filename: str, data) -> str:
    """把中间产物落盘到 .medic/(自动创建目录),返回文件路径"""
    path = os.path.join(medic_dir(project_root), filename)
    with open(path, 'w', encoding='utf-8') as f:
        json.dump(data, f, ensure_ascii=False, indent=2)
    return path

Tainted flow: 'ap_path' from os.environ.get (line 887, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · medic_tools/run.py (reported line 888)May include surrounding context.

python
appendix_dir = medic_dir(project_root)
        ap_path = os.path.join(appendix_dir, f"skill_audit_appendix_{_safe_filename(dom)}.md")
        with open(ap_path, 'w', encoding='utf-8') as f:
            f.write("\n".join(A))
        appendix_paths.append(ap_path)

The --scope option filters results only after scanning skills outside the requested scope.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The scan action calls scan_skills before applying --scope, so a workspace-only request still reads global skill documents and traverses their reference directories, and a global-only request still accesses workspace skills. This violates the advertised access scope and can expose out-of-scope paths through warnings or duplicate-source metadata, although the provided code shows no network exfiltration.

Content

No source excerpt is available for this finding.

Tainted flow: 'path' from os.environ.get (line 2002, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · medic_tools/run.py (reported line 2023)May include surrounding context.

python
print(f"Warning: {path} 读取失败,已备份为 {_bak} 并重建")
                    scores = {}
            scores[base] = {**scores.get(base, {}), **signals}  # 保留既有键(含 LLM 追加的 llm_scores),不整条覆盖
            with open(path, 'w', encoding='utf-8') as f:
                json.dump(scores, f, ensure_ascii=False, indent=2)
            print(json.dumps({"saved": path, "skills": list(scores.keys())}, ensure_ascii=False))
        else:

Tainted flow: '_inv_now' from os.environ.get (line 2102, credential/environment) → shutil.copyfile (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · medic_tools/run.py (reported line 2106)May include surrounding context.

python
_inv_last = os.path.join(medic_dir(project_root), "_medic_last_inventory.json")
        if os.path.isfile(_inv_now):
            try:
                shutil.copyfile(_inv_now, _inv_last)
            except OSError as e:
                print(f"Warning: 归档上次清单失败(历史对比可能缺失或陈旧): {e}")
        inventory = scan_skills(project_root)

Tainted flow: 'report_path' from os.environ.get (line 2121, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · medic_tools/run.py (reported line 2122)May include surrounding context.

python
report_dir = medic_dir(project_root)
        ts_file = datetime.now().strftime("%Y%m%d_%H%M%S_%f")[:-3]  # 毫秒级,避免同秒覆盖
        report_path = os.path.join(report_dir, f"skill_audit_report_{ts_file}.md")
        with open(report_path, 'w', encoding='utf-8') as f:
            f.write(content)

        # 落盘本次清单(增量模式 diff 与历史对比的基础)

Tainted flow: 'inv_path' from os.environ.get (line 2126, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · medic_tools/run.py (reported line 2127)May include surrounding context.

python
# 落盘本次清单(增量模式 diff 与历史对比的基础)
        inv_path = os.path.join(report_dir, "_medic_inventory.json")
        with open(inv_path, 'w', encoding='utf-8') as f:
            json.dump(inventory, f, ensure_ascii=False, indent=2)

        conflict_count = sum(len(v) for k, v in conflicts.items() if k != "C4_infra")

The manifest fixes the skill locale to zh-CN without user opt-in.

Low
Category
Output Handling
Confidence
89% confidence
Finding

L008 declares language: zh-CN without offering a language choice or stating that the user's preferred language takes precedence. The skill performs general Skill auditing, so its purpose does not justify a region-specific locale restriction.

Content

No source excerpt is available for this finding.