Back to skill

Security audit

计划验证器

Security checks for vulnerabilities and agentic risk

Overview

This skill should be reviewed because it presents itself as a pre-execution safety validator, but the bundled validator is mostly a placeholder and can give false assurance.

Install only if you treat this as a draft or reference example, not as a real safety gate. Do not rely on it to approve agent plans until it actually parses plan files, validates schemas, checks real tool capabilities and permissions, and fails closed on uncertainty.

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/planning_validator.py:21
Finding
Fail-Open Plan Validator Provides False Security Assurance## Vulnerability Details **File Location**: `scripts/planning_validator.py:21-44` **Vulnerability Type**: Ineffective validation and unconditional security approval **Risk Level**: Medium ### Vulnerable Code ```python def validate_plan(self, plan_data): """Validate a plan structure""" errors = [] # Check required fields for field in self.required_fields: if field not in plan_data: errors.append(f"Missing required field: {field}") # Check tool availability for step in plan_data.get('steps', []): if 'tool' not in step: errors.append("Step missing tool field") return {'valid': len(errors) == 0, 'errors': errors} def check_reality(self, plan_data): """Check if plan is realistic""" return {'realistic': True, 'confidence': 0.95} def main(): parser = argparse.ArgumentParser(description="Planning Validator") parser.add_argument("--plan", help="Plan JSON file") parser.add_argument("--test", action="store_true", help="Run tests") args = parser.parse_args() validator = PlanningValidator() ``` ### Technical Analysis The validator checks only whether top-level fields exist and whether each step contains a `tool` key. Despite the comment stating “Check tool availability,” it does not confirm that a named tool exists, supports the requested operation, or is authorized for the caller. It also does not validate input types, permissions, dependencies, execution constraints, or plan feasibility. The `check_reality()` method unconditionally returns `realistic: True` with a fixed confidence of `0.95`, regardless of the supplied plan. This creates a fail-open security decision and reports unsupported confidence as if a substantive feasibility check had occurred. In addition, the command-line interface declares a `--plan` argument but does not open, parse, or validate the referenced JSON fil ...[truncated 1923 chars]
Remediation
## Remediation Suggestions 1. Read the file supplied through `--plan`, parse it with `json.load()`, and return a nonzero exit status when reading, parsing, or validation fails. 2. Enforce a strict schema: - Require the root value to be an object. - Require `steps` and `tools` to be lists and `goal` to be a nonempty string. - Require every step to be an object with a valid tool name and explicitly defined action. - Reject unknown fields where appropriate. 3. Resolve every requested tool and action against an authoritative capability registry rather than checking only for key presence. 4. Verify required permissions, authentication state, dependencies, and resource constraints before approving a plan. 5. Replace the unconditional `check_reality()` result with evidence-based checks. Return an indeterminate or failed result when feasibility cannot be established. 6. Fail closed: missing registries, unavailable dependencies, malformed plans, unknown tools, and unverified permissions must prevent approval. 7. Return structured evidence for each validation decision, including the check performed, its result, and the source of capability or permission information. 8. Add tests covering malformed JSON, incorrect data types, unknown tools, unsupported actions, missing permissions, unavailable dependencies, excessive resource requests, and attempts to bypass checks using empty or deceptive values. 9. Ensure downstream callers require successful results from every mandatory check rather than trusting a standalone boolean or fixed confidence score.
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
A plan-validation skill that does not actually validate multi-step plans, tool availability, permissions, dependencies, or feasibility undermines trust boundaries and operational safety. The context makes this more dangerous because the skill's stated purpose is specifically to prevent 'fake plan' failures; failure to do so can directly enable unsafe execution decisions based on assumed protections.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
A plan-validation skill that does not actually validate multi-step plans, tool availability, permissions, dependencies, or feasibility undermines trust boundaries and operational safety. The context makes this more dangerous because the skill's stated purpose is specifically to prevent 'fake plan' failures; failure to do so can directly enable unsafe execution decisions based on assumed protections.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
A plan-validation skill that does not actually validate multi-step plans, tool availability, permissions, dependencies, or feasibility undermines trust boundaries and operational safety. The context makes this more dangerous because the skill's stated purpose is specifically to prevent 'fake plan' failures; failure to do so can directly enable unsafe execution decisions based on assumed protections.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The skill name and entire description are presented only in Chinese, and the document does not indicate that language selection is optional or user-controlled. Under the policy, forcing a specific language without opt-in is a natural-language locale violation unless the constraint is explicitly justified.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The script advertises plan-file validation via the --plan argument, but it never opens, parses, or validates the supplied file. In a security or safety workflow, this can create a false sense of protection: callers may believe a plan was checked before execution when in reality no validation occurred, allowing unsafe or hallucinated plans to pass through unchecked.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The skill claims to perform pre-execution feasibility and reality checks, but the implementation only does shallow schema checks and returns a hardcoded realistic=True with high confidence. In the context of an agent safety skill, this is dangerous because downstream systems may trust the validator's output and execute infeasible or unsafe plans that were never meaningfully assessed.

Static analysis

No suspicious patterns detected.