跳到主要内容
知仓学习社ZHICANG

skill-security-auditor

>

读凭据执行命令读文件严重 18 · 高危 9borghei/Claude-Skills

它会碰到什么

扫了多少7 个文本文件,68 KB
它会碰到什么读凭据执行命令读文件
命中总数48 处
命中统计严重 18 · 高 9 · 中 12 · 低 0
逐条看命中(27 条严重或高危)
  • 严重 references/audit-output-and-workflow.md:29cred-paths
    Pattern: open(os.path.expanduser("~/.ssh/id_rsa"))
  • 严重 references/audit-output-and-workflow.md:29cred-paths
    Pattern: open(os.path.expanduser("~/.ssh/id_rsa"))
  • 严重 references/audit-output-and-workflow.md:104cred-paths
    - [ ] No reads from ~/.ssh, ~/.aws, ~/.config, or other user directories
  • 严重 references/audit-output-and-workflow.md:104cred-paths
    - [ ] No reads from ~/.ssh, ~/.aws, ~/.config, or other user directories
  • 严重 references/audit-output-and-workflow.md:108deserialize-unsafe
    - [ ] No pickle.loads() or unsafe YAML loading
  • 严重 references/audit-output-and-workflow.md:112meta-injection
    - [ ] No "ignore previous instructions" or similar overrides
  • 严重 references/audit-output-and-workflow.md:126cred-paths
    - [ ] No .env or credential files
  • 严重 references/threat-model-and-patterns.md:44cred-paths
    ├── Environment files (.env, .env.local)
  • 严重 references/threat-model-and-patterns.md:44cred-paths
    ├── Environment files (.env, .env.local)
  • 严重 references/threat-model-and-patterns.md:88cred-paths
    r"~/.ssh",
  • 严重 references/threat-model-and-patterns.md:89cred-paths
    r"~/.aws",
  • 严重 scripts/code_scanner.py:124cred-paths
    "regex": r"['\"]~/\.ssh",
  • 严重 scripts/code_scanner.py:126cred-paths
    "fix": "Remove filesystem access to ~/.ssh entirely",
  • 严重 scripts/code_scanner.py:129cred-paths
    "regex": r"['\"]~/\.aws",
  • 严重 scripts/code_scanner.py:131cred-paths
    "fix": "Remove filesystem access to ~/.aws entirely",
  • 严重 scripts/code_scanner.py:177yaml-unsafe
    "risk": "yaml.load() without SafeLoader executes arbitrary Python",
  • 严重 SKILL.md:25cred-paths
    - **Code execution risk detection** — command injection (`os.system`, `subprocess shell=True`, backticks), `eval`/`exec`/`compile`, obfuscation (base64/hex/`chr
  • 严重 SKILL.md:25cred-paths
    - **Code execution risk detection** — command injection (`os.system`, `subprocess shell=True`, backticks), `eval`/`exec`/`compile`, obfuscation (base64/hex/`chr
  • scripts/code_scanner.py:54exec-spawn
    "risk": "Arbitrary code execution via eval()",
  • scripts/code_scanner.py:55exec-spawn
    "fix": "Replace eval() with ast.literal_eval() or explicit parsing",
  • scripts/code_scanner.py:81exec-spawn
    "risk": "Shell command injection via os.system()",
  • scripts/code_scanner.py:82exec-spawn
    "fix": "Use subprocess.run() with a list of arguments and shell=False",
  • scripts/code_scanner.py:86exec-spawn
    "risk": "Shell command injection via os.popen()",
  • scripts/code_scanner.py:87exec-spawn
    "fix": "Use subprocess.run() with a list of arguments and shell=False",
  • scripts/code_scanner.py:92exec-shell-true
    "fix": "Remove shell=True and pass command as a list of arguments",
  • scripts/code_scanner.py:232exec-shell-true
    "fix": "Ensure command is passed as a list and shell=True is not used",
  • scripts/code_scanner.py:294exec-shell-true
    # Downgrade subprocess without shell=True to INFO

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Skill Security Auditor

Scan and audit AI agent skills for security risks before installation. Performs static analysis on code files for dangerous patterns, scans markdown files for prompt injection, validates dependency supply chains, checks file system boundaries, and detects obfuscation. Produces a structured PASS / WARN / FAIL verdict with findings categorized by severity and actionable remediation guidance.

Keywords: skill security, AI security, prompt injection, code audit, supply chain, dependency scanning, data exfiltration, credential harvesting, obfuscation detection, pre-install security

Core Capabilities

  • Code execution risk detection — command injection (os.system, subprocess shell=True, backticks), eval/exec/compile, obfuscation (base64/hex/chr()), network exfiltration, credential harvesting (~/.ssh, ~/.aws), privilege escalation.
  • Prompt injection detection — system-prompt overrides, role hijacking, safety bypass, hidden zero-width/HTML-comment instructions, data-extraction directives, excessive-permission requests.
  • Supply chain analysis — known-vulnerable pins, typosquatting, unpinned versions, inline pip/npm install, low-reputation packages.
  • File system & structure validation — out-of-scope paths, hidden/credential files, unexpected binaries, escaping symlinks, oversized payloads.
  • Verdict & reporting — PASS / WARN / FAIL with severity-categorized findings, remediation, and a strict mode for CI gates.

When to Use

  • Evaluating a skill from an untrusted source before installation
  • Pre-install security gate for CI/CD pipelines
  • Auditing a skill directory or git repository for malicious code
  • Reviewing skills before adding them to a team's approved list
  • Post-incident scanning of installed skills

Clarify First

Before the audit, confirm these inputs. If any is unknown or vague, ASK — do not assume:

  • [ ] Target path — the skill file or directory to scan (the subject of every scanner)
  • [ ] Scan dimensions — code execution / prompt injection / supply chain (selects which of the three scanners run)
  • [ ] Strict mode / gate threshold — whether any HIGH finding forces FAIL (CI gate vs advisory report changes the verdict)

Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.

Tools

| Tool | Purpose | Command |

|------|---------|---------|

| code_scanner.py | Scan Python scripts for eval/exec, subprocess, network exfiltration, credential harvesting, obfuscation, unsafe imports | python scripts/code_scanner.py <target> --strict --json |

| prompt_injection_scanner.py | Scan markdown/text for prompt-injection patterns and hidden directives | python scripts/prompt_injection_scanner.py <target> --strict --json |

| supply_chain_checker.py | Check imports/requirements for typosquatting, unpinned versions, inline installs | python scripts/supply_chain_checker.py <target> --strict --json |

All tools take a target (file or directory), and support --strict (any HIGH → FAIL) and --json.

References

Load the reference that matches the task — keep this file lean and pull detail on demand:

  • [references/threat-model-and-patterns.md](references/threat-model-and-patterns.md) — the attack-vector threat model, trust boundaries, full regex pattern sets for code-execution and prompt-injection detection, and known evasion techniques. Read when deciding what to scan for or tuning detection.
  • [references/audit-output-and-workflow.md](references/audit-output-and-workflow.md) — the report format, verdict criteria (incl. strict mode), CI/CD integration YAML, and the manual audit checklist. Read when producing or interpreting an audit.
  • [references/quality-and-best-practices.md](references/quality-and-best-practices.md) — static-analysis limitations, common pitfalls, best practices, troubleshooting matrix, and success criteria. Read before shipping or relying on an audit.

Scope & Limitations

This skill covers:

  • Static pattern-based detection of dangerous code constructs in Python, Bash, JavaScript, and TypeScript files
  • Prompt injection scanning across all markdown files within a skill package
  • Dependency supply chain validation for requirements.txt and package.json
  • File structure boundary checks including symlinks, binaries, hidden files, and oversized payloads

This skill does NOT cover:

  • Runtime or dynamic analysis — code is never executed during the audit (see skill-tester for runtime validation)
  • Live CVE database lookups or real-time vulnerability feeds (see dependency-auditor for active CVE scanning)
  • Infrastructure-level security controls such as network segmentation, container hardening, or cloud IAM policies (see infrastructure-compliance-auditor in ra-qm-team)
  • Compliance framework certification against ISO 27001, SOC 2, GDPR, or other regulatory standards (see information-security-manager-iso27001 and gdpr-dsgvo-expert in ra-qm-team)

Integration Points

| Skill | Integration | Data Flow |

|-------|-------------|-----------|

| dependency-auditor | Feed audit findings into live CVE scanning for flagged dependencies | Security audit report → dependency-auditor for real-time vulnerability lookup |

| ci-cd-pipeline-builder | Embed the audit workflow as a required check in generated CI/CD pipelines | Pipeline template ← audit job YAML from this skill's CI/CD section |

| skill-tester | Run dynamic runtime tests on skills that pass static analysis | PASS verdict from this skill → skill-tester for behavioral validation |

| infrastructure-compliance-auditor | Extend auditing scope from skill-level to infrastructure-level security controls | Skill audit findings → infrastructure auditor for environment-wide posture review |

| env-secrets-manager | Cross-reference credential harvesting findings with secrets management policy | Credential-access flags from audit → env-secrets-manager for policy verification |

| pr-review-expert | Surface audit findings as inline PR review comments on flagged lines | Audit report line references → PR review annotations for developer visibility |

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。