Back to skill

Security audit

Validator

Security checks for vulnerabilities and agentic risk

Overview

This is a mostly coherent input-validation utility, but it needs review because some validators can make network requests and the JSON/YAML file validators contain command-execution vulnerabilities with crafted filenames.

Review before installing. Use this only in a constrained environment, avoid validating untrusted JSON/YAML filenames, avoid entering real payment card numbers on the command line, and disable or isolate network access if checking untrusted URLs or domains. There is no evidence of intentional exfiltration or persistence, but the unsafe filename handling should be fixed before broad use.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
}" [ ! -f "$file" ] && { fail "File not found: $file"; return 1; } if python3 -c "import json; json.load(open('$file'))" 2>/dev/null; then local size size=$(wc -c < "$file") pass "$file (${size} bytes, valid JSON)" else fail "$file" python3 -c " import json try: json.load(open('$file')) except json.JSONDecodeError as e: print(' Error: line {}, col {}: {}'.format(e.lineno, e.colno, e.msg)) " 2>/dev/null return 1 fi } ``` ### Technical ...[truncated 2001 chars]:101
Finding

Arbitrary Python Code Execution Through JSON Filename Injection

Content
View full analysis
}" [ ! -f "$file" ] && { fail "File not found: $file"; return 1; } if python3 -c "import json; json.load(open('$file'))" 2>/dev/null; then local size size=$(wc -c < "$file") pass "$file (${size} bytes, valid JSON)" else fail "$file" python3 -c " import json try: json.load(open('$file')) except json.JSONDecodeError as e: print(' Error: line {}, col {}: {}'.format(e.lineno, e.colno, e.msg)) " 2>/dev/null return 1 fi } ``` ### Technical Analysis The `file` argument is controlled by the caller and is interpolated directly into Python source supplied through `python3 -c`. Quoting the shell expansion does not protect the resulting Python program. A filename containing Python quote and syntax characters can terminate the `open('...')` expression and append additional Python statements. The same unsafe interpolation occurs in both the initial validation command and the error-reporting command. The preceding `-f` check does not prevent exploitation. An attacker with permission to create files can create a file whose literal filename contains the injection payload. The generated Python code can then refer to a separate ordinary file while executing appended statements. ### Attack Path 1. An attacker creates a specially named file containing characters that terminate the Python string and function calls. 2. If needed, the attacker also creates the ordinary file referenced by the injected Python expression. 3. The attacker or Agent invokes: ```bash scripts/script.sh json "" ``` 4. Bash expands the filename into the double-quoted `python3 -c` argument. 5. Python interprets part of the f ...[truncated 686 chars]
Remediation
View remediation
/dev/null; then # ... fi ``` Implement error reporting using the same argument-based approach: ```bash python3 - "$file" <<'PYEOF' import json import sys try: with open(sys.argv[1]) as stream: json.load(stream) except json.JSONDecodeError as error: print( " Error: line {}, col {}: {}".format( error.lineno, error.colno, error.msg ) ) sys.exit(1) PYEOF ``` Additional hardening measures include: - Use `with open(...)` so file handles are reliably closed. - Treat filenames as opaque data throughout the implementation. - Add regression tests using filenames containing single quotes, double quotes, semicolons, parentheses, whitespace, and newline characters. - Run the validator with the minimum filesystem and operating-system privileges required. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
}" [ ! -f "$file" ] && { fail "File not found: $file"; return 1; } if python3 -c " import sys try: import yaml yaml.safe_load(open('$file')) sys.exit(0) except ImportError: # Fallback: basic syntax check with open('$file') as f: for i, line in enumerate(f, 1): if '\t' in line: print(' Warning: tab character on line {}'.format(i)) sys.exit(0) except yaml.YAMLError as e: print(' Error: {}'.format(e)) sys.exit(1) " 2>/dev/null; then ...[truncated 1928 chars]:122
Finding

Arbitrary Python Code Execution Through YAML Filename Injection

Content
View full analysis
}" [ ! -f "$file" ] && { fail "File not found: $file"; return 1; } if python3 -c " import sys try: import yaml yaml.safe_load(open('$file')) sys.exit(0) except ImportError: # Fallback: basic syntax check with open('$file') as f: for i, line in enumerate(f, 1): if '\t' in line: print(' Warning: tab character on line {}'.format(i)) sys.exit(0) except yaml.YAMLError as e: print(' Error: {}'.format(e)) sys.exit(1) " 2>/dev/null; then pass "$file (valid YAML)" else fail "$file" return 1 fi } ``` ### Technical Analysis The caller-controlled `file` value is inserted into two Python string literals in a dynamically generated `python3 -c` program: ```python yaml.safe_load(open('$file')) ``` and: ```python with open('$file') as f: ``` A crafted filename can terminate either string literal and alter the structure of the generated Python program. This permits arbitrary Python statements to be introduced before the remainder of the generated line is neutralized or incorporated into the payload. The use of `yaml.safe_load` protects against unsafe YAML object deserialization, but it does not address source-code injection occurring before YAML parsing. The shell file-existence check likewise does not sanitize the filename. ### Attack Path 1. An attacker creates a file whose literal name contains a Python injection payload. 2. The attacker invokes: ```bash scripts/script.sh yaml "" ``` 3. The filename passes the shell `-f` check because the specially named file exists. 4. Bash embeds the filename in the multiline Python source. 5. Python parses the in ...[truncated 613 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:21
Finding

Redirect-Enabled Server-Side Request Forgery in URL Validation

Content
View full analysis
}" if echo "$url" | grep -qE '^https?://[a-zA-Z0-9.-]+(\.[a-zA-Z]{2,})(:[0-9]+)?(/.*)?$'; then pass "$url" if command -v curl >/dev/null 2>&1; then local code code=$(curl -sL -o /dev/null -w '%{http_code}' --max-time 5 "$url" 2>/dev/null || echo "000") echo " HTTP status: $code" fi else fail "$url — must start with http:// or https://" return 1 fi } ``` ### Technical Analysis The command makes an outbound request to any URL that satisfies a syntactic regular expression. It does not resolve the hostname and reject loopback, private, link-local, reserved, or cloud metadata addresses before connecting. The `-L` option instructs `curl` to follow redirects. Consequently, an attacker can submit a syntactically valid URL under an attacker-controlled public domain and return a redirect to an otherwise disallowed internal address. Validation is only applied to the original textual URL, not to each redirect destination. DNS resolution is also not constrained. A valid dotted hostname may resolve directly to a private or loopback address, and DNS rebinding may cause different resolutions across checks and connection attempts. Although the response body is discarded, the HTTP status is returned and the request itself is performed. This creates a blind SSRF primitive with a limited status-code oracle. ### Attack Path 1. An attacker controls a domain that satisfies the URL regular expression. 2. The attacker configures the domain to resolve to an internal address or to return an HTTP redirect to an internal service, loopback interface, link-local metadata endpoint, or priva ...[truncated 1028 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose understates the skill's actual behavior: it performs additional validations beyond the description and includes outbound network checks for URLs and domains. This mismatch is dangerous because operators may invoke or approve the skill assuming it is a local format validator, when it can trigger external requests, leak sensitive inputs to third parties, or violate sandbox and privacy expectations.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises executable behavior through shell-based commands but declares no explicit tool scope or permissions, so users and hosting systems cannot accurately constrain what it may access. Because the documented commands include shell execution and environment use, this creates an avoidable trust gap and increases the chance of unintended command or network capability being granted.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The URL validator performs a live HTTP request with curl, and the domain validator later performs DNS resolution, which goes beyond local format validation. This creates network side effects from user-supplied input, enabling SSRF-like behavior, internal network probing, metadata service access attempts, or unintended disclosure of queried targets in environments where the skill runs with network access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script implements additional capabilities beyond the declared skill description, including IP, domain, JSON, YAML, CSV, and credit-card validation. Undeclared functionality weakens transparency and reviewability, which can cause downstream systems or users to invoke sensitive or unexpected behaviors without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script accepts and processes full payment card numbers without any user-facing warning, masking, or disclosure about sensitive-data handling. In an agent or logged execution environment, card numbers may be exposed via command history, telemetry, stdout, or orchestration logs, increasing PCI/privacy risk even if the script only performs local validation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

A URL 'validation' feature that may invoke curl is not purely syntactic validation; it can generate outbound traffic to attacker-controlled or internal endpoints. Without a warning, users may pass sensitive or untrusted URLs expecting local checking, creating SSRF-style probing, metadata access attempts, or disclosure of validation activity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

Domain validation that performs DNS lookups introduces external network interaction and potential data leakage, but the skill does not warn users about this behavior. Even though DNS checks are lower impact than full HTTP requests, they can still expose queried domains, interact with internal resolvers, and violate assumptions that validation is offline-only.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

While validating a card number with a Luhn check can fit a generic validator, identifying and reporting card brand goes beyond simple format/rule enforcement described in the manifest. This adds payment-data-specific processing not clearly justified by the stated input-validation scope.

Content

No source excerpt is available for this finding.