Back to skill

Security audit

sx-security-audit

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed security-audit tool, but it can copy shell credential values into saved reports that may later be shared externally.

Review this skill before installing. It appears to be a genuine security-audit utility, not malware, but run it only where saved reports and terminal output are protected. Do not send reports to Feishu or webhooks unless you have checked them for secrets, and avoid following the unpinned global install examples without pinning versions and using an isolated environment.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
scripts/security_audit.py:947
Finding

Shell Credentials Are Copied into Persistent Audit Reports

Content
View full analysis
50 else m for m in matches[:3]] results.append(AuditResult( category="密钥与凭据安全", name=f"Shell 配置明文密钥: {rc_file.name}", status="fail", severity="high", description=f"发现 {len(matches)} 处明文导出密钥: {'; '.join(sanitized)}", impact=str(rc_file), fix="将密钥移至 .env 文件或密钥管理服务,不在 shell 配置中硬编码", )) ``` ### Technical Analysis The shell-security check reads files such as `.bashrc`, `.zshrc`, `.bash_profile`, and `.profile`, then searches for exported variables whose names suggest that they contain keys, tokens, secrets, or passwords. The code treats truncation to 50 characters as sanitization. This is not effective redaction: - Values shorter than or equal to 50 characters are included in full. - The first 50 characters of longer credentials are disclosed. - Many API keys, passwords, and access tokens are short enough to be exposed completely. - Even a credential prefix can disclose sensitive operational information or be sufficient for abuse in formats where the meaningful secret appears near the beginning. The resulting description is passed to both Markdown and JSON report generators. Reports are saved to disk, and the Markdown report is also printed to standard output unless quiet mode is enabled. The separate Feishu sender can subsequently process and transmit report-derived content, increasing the number of locations through which the data may be exposed. ### Attack Path 1. A legitimate user or attacker-controlled setup places a credential in a shell initialization file, for example as an exported token. 2. The user ...[truncated 1323 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
references/dependency-audit.md:66
Finding

Security Documentation Recommends Unpinned Third-Party Tool Installation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (82)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose is local security auditing, but the behavior described by the findings includes external report delivery to Feishu/Webhook/OpenClaw APIs and access to user-home configuration and environment variables. That mismatch can mislead users into exposing secrets, audit results, or system details to external services under the guise of a local scan, which materially increases exfiltration risk.

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

md
python3 scripts/security_audit.py

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/security_audit.py

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/security_audit.py

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/security_audit.py

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/security_audit.py

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/security_audit.py

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/security_audit.py

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- [代码安全最佳实践](references/code-security.md)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/code-security.md (reported line 140)May include surrounding context.

1. 子进程执行检查

python
# ❌ 不推荐 - 直接执行用户输入
subprocess.run(user_command, shell=True)

# ✅ 推荐 - 使用参数列表
subprocess.run(['ls', '-la', path], shell=False)

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · references/permissions.md (reported line 8)May include surrounding context.

md
### 敏感文件最小权限
| 文件类型 | 推荐权限 | 命令 | 说明 |
|-----------|-----------|-------|------|
| SSH 私钥 | 600 | `chmod 600 ~/.ssh/id_rsa` | 仅所有者可读写 |
| SSH 目录 | 700 | `chmod 700 ~/.ssh` | 仅所有者可访问 |
| AWS 凭据 | 600 | `chmod 600 ~/.aws/credentials` | 保护 AWS 密钥 |
| GPG 目录 | 700 | `chmod 700 ~/.gnupg` | 保护 GPG 密钥 |

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · references/permissions.md (reported line 25)May include surrounding context.

md
### 敏感文件最小权限
| 文件类型 | 推荐权限 | 命令 | 说明 |
|-----------|-----------|-------|------|
| SSH 私钥 | 600 | `chmod 600 ~/.ssh/id_rsa` | 仅所有者可读写 |
| SSH 目录 | 700 | `chmod 700 ~/.ssh` | 仅所有者可访问 |
| AWS 凭据 | 600 | `chmod 600 ~/.aws/credentials` | 保护 AWS 密钥 |
| GPG 目录 | 700 | `chmod 700 ~/.gnupg` | 保护 GPG 密钥 |

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · references/permissions.md (reported line 26)May include surrounding context.

md
### 敏感文件最小权限
| 文件类型 | 推荐权限 | 命令 | 说明 |
|-----------|-----------|-------|------|
| SSH 私钥 | 600 | `chmod 600 ~/.ssh/id_rsa` | 仅所有者可读写 |
| SSH 目录 | 700 | `chmod 700 ~/.ssh` | 仅所有者可访问 |
| AWS 凭据 | 600 | `chmod 600 ~/.aws/credentials` | 保护 AWS 密钥 |
| GPG 目录 | 700 | `chmod 700 ~/.gnupg` | 保护 GPG 密钥 |

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · references/permissions.md (reported line 10)May include surrounding context.

md
|-----------|-----------|-------|------|
| SSH 私钥 | 600 | `chmod 600 ~/.ssh/id_rsa` | 仅所有者可读写 |
| SSH 目录 | 700 | `chmod 700 ~/.ssh` | 仅所有者可访问 |
| AWS 凭据 | 600 | `chmod 600 ~/.aws/credentials` | 保护 AWS 密钥 |
| GPG 目录 | 700 | `chmod 700 ~/.gnupg` | 保护 GPG 密钥 |
| OpenClaw 配置 | 600/700 | `chmod 700 ~/.openclaw` | 保护配置 |
| 日志文件 | 600/644 | `chmod 600 logs/*.log` | 控制日志访问 |

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/secrets-detection.md (reported line 143)May include surrounding context.

text
.gitignore
---------
.env
.env.local
config/secrets.json

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 · scripts/security_audit.py (reported line 960)May include surrounding context.

python
```
.gitignore
---------
.env
.env.local
config/secrets.json
```

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/secrets-detection.md (reported line 144)May include surrounding context.

.gitignore

.env .env.local config/secrets.json

text

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/secrets-detection.md (reported line 145)May include surrounding context.


.env .env.local config/secrets.json

text

4. **使用掩码显示**

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/security_audit.py (reported line 714)May include surrounding context.

python
---------
.env
.env.local
config/secrets.json
```

4. **使用掩码显示**

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · scripts/security_audit.py (reported line 182)May include surrounding context.

python
print_header("🔒 检查敏感文件权限")

    sensitive_files = [
        (Path.home() / ".ssh", 0o700),
        (Path.home() / ".ssh" / "id_rsa", 0o600),
        (Path.home() / ".ssh" / "id_ed25519", 0o600),
        (Path.home() / ".aws" / "credentials", 0o600),

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · scripts/security_audit.py (reported line 183)May include surrounding context.

python
print_header("🔒 检查敏感文件权限")

    sensitive_files = [
        (Path.home() / ".ssh", 0o700),
        (Path.home() / ".ssh" / "id_rsa", 0o600),
        (Path.home() / ".ssh" / "id_ed25519", 0o600),
        (Path.home() / ".aws" / "credentials", 0o600),

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · scripts/security_audit.py (reported line 184)May include surrounding context.

python
print_header("🔒 检查敏感文件权限")

    sensitive_files = [
        (Path.home() / ".ssh", 0o700),
        (Path.home() / ".ssh" / "id_rsa", 0o600),
        (Path.home() / ".ssh" / "id_ed25519", 0o600),
        (Path.home() / ".aws" / "credentials", 0o600),

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/security_audit.py (reported line 206)May include surrounding context.

python
severity="high",
                description=f"文件权限过于宽松: {oct(actual_mode)}, 期望: {oct(expected_mode)}",
                impact=str(path),
                fix=f"chmod {oct(expected_mode)[2:]} {path}",
            ))
        else:
            results.append(AuditResult(

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
88% confidence
Finding

The script iterates over the entire process environment and classifies potentially sensitive variables, which is legitimate for an audit tool but still collects credential-bearing data. In this skill context, that behavior is more dangerous because results are later reported and may be written to disk, increasing the chance of exposing secret names and security-sensitive metadata.

Content

Scanner excerpt · scripts/security_audit.py (reported line 645)May include surrounding context.

python
exposed = []

    for env_name, env_value in os.environ.items():
        for pattern, desc in sensitive_env_patterns:
            if pattern.search(env_name):
                # 检查值是否是真实密钥(非占位符)

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 · scripts/security_audit.py (reported line 712)May include surrounding context.

python
return results

    sensitive_gitignore_entries = [
        '.env', '.env.local', '.env.production',
        '*.pem', '*.key', '*.p12',
        'credentials.json', 'secrets.json', 'service-account.json',
        '.secret', '*.secret',

Static analysis

Detected: suspicious.dynamic_code_execution, suspicious.exposed_secret_literal

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/security_audit.py:408

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/code-security.md:92