Back to skill

Security audit

Missing Input Validation

Security checks for vulnerabilities and agentic risk

Overview

This skill gives normal defensive coding advice about validating inputs, with one debugging tip that users should apply carefully to avoid exposing sensitive raw values.

Installers should treat this as a focused secure-coding skill. When applying it, keep validation errors clear but avoid logging or returning raw sensitive input; prefer field names, expected constraints, correlation IDs, and redacted or truncated values when needed.

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

Unsafe Reflection of Untrusted Values in Error Messages

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 27
Vulnerability Type: Unsafe error handling and potential sensitive-data disclosure
Risk Level: Medium

Code Snippet:

markdown
- When an invariant is checked, include the unexpected value in the error so debugging is possible.

Technical Analysis

The instruction broadly recommends including unexpected, potentially untrusted values in error messages. Because validation errors may be returned to clients, recorded in application logs, displayed in terminals, or rendered by monitoring interfaces, reflecting raw values without safeguards can expose sensitive information or create an injection path.

An attacker could supply values containing credentials, personal information, newline characters, terminal escape sequences, markup, or excessively large content. If the generated implementation follows this guidance literally, those values may cause log injection, terminal manipulation, unsafe content rendering, log amplification, or disclosure of confidential data.

Attack Path

  1. An attacker submits an invalid value through an external trust boundary such as an HTTP request, CLI argument, file, API response, or user message.
  2. The value contains sensitive content or a crafted payload, such as forged log lines, control characters, terminal escape sequences, or markup.
  3. Input validation rejects the value and, following the Skill's instruction, embeds the raw unexpected value in an error.
  4. The application returns or records the error in a client response, log, terminal, monitoring platform, or web-based error viewer.
  5. The attacker-controlled value may disclose sensitive information, corrupt log integrity, manipulate terminal output, or become unsafe content in downstream systems.

Impact Assessment

This issue does not directly grant operating-system privileges or unauthorized code execution. Its primary impact is on confidentiality ...[truncated 328 chars]

Remediation
View remediation

Remediation Suggestions

Replace the instruction with guidance that distinguishes safe diagnostic metadata from raw input values:

  • Prefer reporting the field name, expected type or range, failure reason, and a correlation identifier.
  • Do not include passwords, tokens, session identifiers, personal data, or other secrets in errors or logs.
  • Keep client-facing errors generic and place necessary diagnostic details only in access-controlled server logs.
  • If recording an input value is essential, apply explicit redaction, strict length limits, and contextual encoding.
  • Escape or remove newline characters, control characters, and terminal escape sequences before logging.
  • Ensure web-based error and log interfaces encode content for the relevant output context.
  • Configure retention and access controls for logs that may contain user-supplied data.

A safer replacement would be:

markdown
- When an invariant fails, report the field name, expected constraint, and a correlation ID. Do not include raw untrusted values unless they have been redacted, escaped, and truncated; never expose sensitive values in client-facing errors.
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep