Back to skill

Security audit

Privacy Scanner

Security checks for vulnerabilities and agentic risk

Overview

This privacy-scanning skill does what it says, but it may reveal the secrets it finds in its scan output.

Review before installing or running in shared terminals, CI, or agent environments. Use it only on intended project directories, avoid uploading scan logs, and prefer a version that redacts matched secret values while reporting only file paths, line numbers, and finding types.

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

Warning
Location
scripts/privacy-scan.sh:92
Finding
Unredacted Sensitive Values Are Printed to Scan Output<![CDATA[ ## Vulnerability Details **File Location**: `scripts/privacy-scan.sh`, lines 92–98 and representative output at lines 118–119 **Vulnerability Type**: Sensitive information exposure through diagnostic output **Risk Level**: Medium ### Vulnerable Code ```bash results=$(grep -rn --include="*.sh" --include="*.md" --include="*.json" --include="*.yaml" --include="*.yml" --include="*.ts" --include="*.js" --include="*.plist" \ "$pattern" "$SCAN_DIR" 2>/dev/null | head -5 || true) echo "$results" ``` A representative caller subsequently prints the complete matching lines: ```bash if [ -n "$results" ]; then fail "发现疑似真实 Webhook URL:" echo "$results" | while IFS= read -r line; do echo " $line"; done else pass "无真实 Webhook URL" fi ``` The same output pattern is used across checks for API keys, bearer tokens, passwords, JWTs, database connection strings, webhooks, and private-key content. ### Technical Analysis The scanner invokes `grep -rn`, which returns the file path, line number, and complete text of every matching line. Those results are emitted verbatim to standard output. Because the patterns are specifically designed to locate secrets, the displayed line can contain the complete secret rather than merely identifying its location. Output may consequently be retained in CI logs, terminal recordings, Agent transcripts, build artifacts, or centralized log aggregation systems. This expands access to a secret beyond the users and processes that could read the original file. A privacy scanner only needs to identify the affected file, line number, and secret type. Printing the underlying value is unnecessary for the declared functionality. ### Attack Path 1. A scanned repository contains a real API token, password, webhook URL, JWT, database credential, or other supported secret. 2. A user or automated pipeline runs `privacy-scan.sh` against that repository. 3. `grep -rn` captures the complete line containing the secret. 4. The scrip ...[truncated 1207 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not print complete matching lines. Report only the file path, line number, and finding category. 2. Prefer output such as: ```text path/to/file:42: [REDACTED API KEY] ``` 3. Use file-only reporting when line-level detail is unnecessary: ```bash grep -rl --include="*.sh" --include="*.md" ... "$pattern" "$SCAN_DIR" ``` 4. If line numbers are required, parse the `grep -n` result and replace the content after the location fields with a fixed redaction marker. 5. Do not attempt generic redaction by printing part of a secret. Even prefixes, suffixes, or surrounding connection-string components may expose sensitive metadata. 6. Add regression tests containing synthetic secrets and assert that none of the secret values appear in standard output or standard error. 7. Document that scan output is security-sensitive and should not be uploaded or retained until all output paths have been made safe. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (11)

Credential Access

High
Category
Privilege Escalation
Content
| 6 | 内网 IP | `192.168.x.x`, `10.x.x.x` | ⚠️ 警告 |
| 7 | 邮箱地址 | `user@domain.com` | ⚠️ 警告 |
| 8 | 手机号 | 中国大陆 11 位 | ❌ 失败 |
| 9 | 敏感文件 | `.env`, `credentials.json`, 私钥 | ❌ 失败 |
| 10 | 密码/Secret | `password="xxx"`, `secret="xxx"` | ❌ 失败 |
| 11 | Discord Webhook | `discord.com/api/webhooks/` | ❌ 失败 |
| 12 | Slack Webhook | `hooks.slack.com/services/` | ❌ 失败 |
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| 6 | 内网 IP | `192.168.x.x`, `10.x.x.x` | ⚠️ 警告 |
| 7 | 邮箱地址 | `user@domain.com` | ⚠️ 警告 |
| 8 | 手机号 | 中国大陆 11 位 | ❌ 失败 |
| 9 | 敏感文件 | `.env`, `credentials.json`, 私钥 | ❌ 失败 |
| 10 | 密码/Secret | `password="xxx"`, `secret="xxx"` | ❌ 失败 |
| 11 | Discord Webhook | `discord.com/api/webhooks/` | ❌ 失败 |
| 12 | Slack Webhook | `hooks.slack.com/services/` | ❌ 失败 |
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| 6 | 内网 IP | `192.168.x.x`, `10.x.x.x` | ⚠️ 警告 |
| 7 | 邮箱地址 | `user@domain.com` | ⚠️ 警告 |
| 8 | 手机号 | 中国大陆 11 位 | ❌ 失败 |
| 9 | 敏感文件 | `.env`, `credentials.json`, 私钥 | ❌ 失败 |
| 10 | 密码/Secret | `password="xxx"`, `secret="xxx"` | ❌ 失败 |
| 11 | Discord Webhook | `discord.com/api/webhooks/` | ❌ 失败 |
| 12 | Slack Webhook | `hooks.slack.com/services/` | ❌ 失败 |
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
# 9. 敏感文件
print_header "9. 敏感文件"
sensitive_found=false
for file in ".env" "credentials.json" "secrets.json" "id_rsa" "id_ed25519" ".pem" ".key" ".p12" ".pfx"; do
    matches=$(find "$SCAN_DIR" -name "*$file*" -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null || true)
    if [ -n "$matches" ]; then
        fail "发现敏感文件: $file"
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
# 9. 敏感文件
print_header "9. 敏感文件"
sensitive_found=false
for file in ".env" "credentials.json" "secrets.json" "id_rsa" "id_ed25519" ".pem" ".key" ".p12" ".pfx"; do
    matches=$(find "$SCAN_DIR" -name "*$file*" -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null || true)
    if [ -n "$matches" ]; then
        fail "发现敏感文件: $file"
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The entire skill description and operating instructions are written in Chinese, including required publishing steps, with no indication that users may choose another language or that the skill is intended only for a Chinese-speaking or region-specific audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The trigger description is broad enough that the skill may activate on common terms like “publish” or generic privacy-check phrases, causing it to run in situations the user did not clearly intend. Over-broad invocation increases the chance of scanning unintended directories or files, which can expose local metadata or create unnecessary access to sensitive content.

Natural-Language Policy Violations

Medium
Confidence
86% confidence
Finding
The skill metadata and content are written entirely in Chinese and appear to prescribe that locale without stating any user-choice behavior. This can lead to misunderstandings of warnings, consent, or scan results for users expecting another language, which is a safety and usability issue in a tool handling sensitive data.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This shell script presents its help text, status messages, warnings, and results in Chinese only, including the usage output and all scan findings. That creates a language/locale policy issue because the skill forces a specific language for all users without opt-in or justification for a region-specific audience.

Session Persistence

Medium
Category
Rogue Agent
Content
local results
    if [ -n "$exclude_placeholder" ]; then
        results=$(grep -rn --include="*.sh" --include="*.md" --include="*.json" --include="*.yaml" --include="*.yml" --include="*.ts" --include="*.js" --include="*.plist" \
            "$pattern" "$SCAN_DIR" 2>/dev/null | grep -v "$exclude_placeholder" | head -5 || true)
    else
        results=$(grep -rn --include="*.sh" --include="*.md" --include="*.json" --include="*.yaml" --include="*.yml" --include="*.ts" --include="*.js" --include="*.plist" \
Confidence
75% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Session Persistence

Medium
Category
Rogue Agent
Content
local results
    if [ -n "$exclude_placeholder" ]; then
        results=$(grep -rn --include="*.sh" --include="*.md" --include="*.json" --include="*.yaml" --include="*.yml" --include="*.ts" --include="*.js" --include="*.plist" \
            "$pattern" "$SCAN_DIR" 2>/dev/null | grep -v "$exclude_placeholder" | head -5 || true)
    else
        results=$(grep -rn --include="*.sh" --include="*.md" --include="*.json" --include="*.yaml" --include="*.yml" --include="*.ts" --include="*.js" --include="*.plist" \
Confidence
75% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Static analysis

No suspicious patterns detected.