Back to skill

Security audit

代码沙箱

Security checks for vulnerabilities and agentic risk

Overview

This skill promises safe sandboxed execution of untrusted code but ships only Markdown guidance and examples, so users could wrongly trust isolation that is not implemented.

Install only if you treat this as advisory documentation, not a real sandbox. Do not let it execute untrusted code unless you separately provide and verify a real disposable container or VM with network, filesystem, resource, and environment isolation.

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
SKILL.md:82
Finding

Unimplemented Sandbox Controls May Cause Unsafe Execution of Untrusted Code

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 82-176
Vulnerability Type: Security controls represented as documentation rather than enforceable isolation
Risk Level: High

Vulnerable Configuration

python
NETWORK_RESTRICTIONS = {
    'allow_outbound': False,
    'allow_inbound': False,
    'allow_dns': False,
    'allow_internet': False,
}
python
FILESYSTEM_RULES = {
    'read_whitelist': ['/tmp', '/sandbox'],
    'write_whitelist': ['/tmp/sandbox'],
    'blocked_paths': [
        '/',
        '/home',
        '/root',
        '/etc',
        '/var',
        '*.key',
        '*.pem',
        '.env',
    ],
    'max_file_size': 10 * 1024 * 1024,
}
python
DANGEROUS_APIS = {
    'python': [
        'os.system',
        'os.popen',
        'subprocess',
        'eval',
        'exec',
        '__import__',
        'open'
    ],
    'javascript': [
        'eval',
        'Function',
        'require("child_process")',
        'process.binding',
        'fs.delete',
    ],
}

The documented execution process subsequently instructs the workflow to modify dangerous calls, configure a sandbox, execute the code in an isolated environment, collect results, and clean up the environment.

Technical Analysis

The project contains only SKILL.md. It does not include an executable sandbox backend, container configuration, virtual machine launcher, syscall filter, network namespace setup, filesystem isolation mechanism, or resource-limit implementation.

The displayed Python dictionaries are illustrative configuration values, not controls that the operating system or an execution engine enforces. Likewise, the listed regular expressions and API names are deny-list examples. Static deny-list matching cannot establish a security boundary and can be bypassed through aliasing, reflection, dynamic string construction, alter ...[truncated 2551 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not execute untrusted code unless a real, independently enforced sandbox backend is available and successfully initialized.
  2. Implement isolation outside the guest code using a container or virtual machine with:
    • A dedicated unprivileged user and no host-user namespace equivalence.
    • No outbound or inbound network interface and no DNS access.
    • A minimal read-only root filesystem.
    • A newly created writable temporary directory with strict size limits.
    • No mounts containing the host project, home directory, credentials, sockets, or environment files.
    • Linux capabilities removed and privilege escalation disabled.
    • A restrictive syscall policy, mandatory access controls, and process-count limits.
    • Enforced CPU, memory, disk, thread, process, and wall-clock limits.
  3. Treat pattern scanning only as defense in depth. Do not use regex or API deny lists as the primary security boundary.
  4. Fail closed when any isolation control cannot be verified. Never fall back to local interpreter or shell execution.
  5. Run each submission in a fresh disposable environment and destroy it after collecting size-limited output.
  6. Remove secrets from the sandbox environment, sanitize inherited environment variables, and prevent access to host service sockets and metadata endpoints.
  7. Add automated adversarial tests covering obfuscated imports, dynamic evaluation, alternate network clients, filesystem traversal, subprocess creation, fork bombs, resource exhaustion, and native-code escape attempts.
  8. Clearly distinguish illustrative policy from implemented behavior in the documentation and avoid reporting controls as active unless the backend confirms their enforcement.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • 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 (10)

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 · SKILL.md (reported line 107)May include surrounding context.

md
'/var',
        '*.key',
        '*.pem',
        '.env',
    ],
    'max_file_size': 10 * 1024 * 1024,  # 10MB
}

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 · SKILL.md (reported line 159)May include surrounding context.

md
'/var',
        '*.key',
        '*.pem',
        '.env',
    ],
    'max_file_size': 10 * 1024 * 1024,  # 10MB
}

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 · SKILL.md (reported line 203)May include surrounding context.

python
def dangerous_code():
    import os
    os.system('rm -rf /')  # ❌ 拦截!

# 错误: 检测到危险操作 "rm -rf /"
# 建议: 这是破坏性操作,禁止执行

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 · SKILL.md (reported line 205)May include surrounding context.

python
def dangerous_code():
    import os
    os.system('rm -rf /')  # ❌ 拦截!

# 错误: 检测到危险操作 "rm -rf /"
# 建议: 这是破坏性操作,禁止执行

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 · SKILL.md (reported line 256)May include surrounding context.

python
def dangerous_code():
    import os
    os.system('rm -rf /')  # ❌ 拦截!

# 错误: 检测到危险操作 "rm -rf /"
# 建议: 这是破坏性操作,禁止执行

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · SKILL.md (reported line 203)May include surrounding context.

python
def dangerous_code():
    import os
    os.system('rm -rf /')  # ❌ 拦截!

# 错误: 检测到危险操作 "rm -rf /"
# 建议: 这是破坏性操作,禁止执行

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · SKILL.md (reported line 205)May include surrounding context.

import os os.system('rm -rf /') # ❌ 拦截!

错误: 检测到危险操作 "rm -rf /"

建议: 这是破坏性操作,禁止执行

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · SKILL.md (reported line 256)May include surrounding context.

md
SANDBOX_REJECT = {
    'status': 'rejected',
    'reason': 'dangerous_pattern',
    'pattern': 'rm -rf /',
    'line': 5,
    'suggestion': '删除根目录是破坏性操作',
}

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation phrases '安全执行 / 沙箱运行 / 验证代码' are broad and could cause the skill to trigger in contexts where users merely discuss code safety rather than explicitly requesting sandbox execution. For a code-execution-oriented skill, unintended invocation increases the chance that untrusted code is processed or execution guidance is followed without sufficient user confirmation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description is presented in Chinese, and the document continues primarily in Chinese with some English labels, but it does not state that language output follows user preference or offers an opt-in choice. This can violate a language/locale policy where skills should not force a language without user selection.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.