Back to skill

Security audit

Cargo Toml Validator

Security checks for vulnerabilities and agentic risk

Overview

This skill is a focused local Cargo.toml checker, with only a low-risk terminal-output spoofing issue for malicious manifest text.

Reasonable to install for local Cargo.toml validation. Be careful when running the default text or summary output on untrusted manifests, because crafted values could affect terminal display; prefer JSON output for untrusted inputs or automated processing.

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

Note
Location
scripts/cargo_toml_validator.py:899
Finding

Terminal Control-Sequence Injection Through Unsanitized Manifest Values

Content
View full analysis
Remediation
View remediation
str: text = str(value) return "".join( ch if ch in "\n\t" or ord(ch) >= 0x20 and ord(ch) != 0x7F else repr(ch)[1:-1] for ch in text ) ``` 2. Prefer escaping control characters visibly rather than silently removing them. For example, render an escape byte as `\x1b` so reviewers can identify malformed or hostile manifest values. 3. Sanitize data at the output boundary rather than relying only on individual validation rules. This ensures future rules cannot accidentally introduce the same issue: ```python message = sanitize_terminal(f["message"]) detail = sanitize_terminal(f.get("detail", "")) lines.append(f"[{sev}] {f['rule_id']}: {message}") if detail: lines.append(f" {detail}") ``` 4. Ensure the title and supplied file path are sanitized as well, because the path is also displayed in text output. 5. Consider providing a strict output mode that rejects manifest values containing terminal control characters. 6. Recommend JSON output for automated processing and untrusted manifests, while retaining proper sanitization in text and summary output. 7. Add regression tests using values containing ESC, BEL, carriage return, backspace, and OSC-like sequences. Verify that raw control bytes never appear in formatted text output. ]]>
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