Back to skill

Security audit

tldr-cmd: CLI command TL;DR

Security checks across malware telemetry and agentic risk

Overview

The skill is mostly a normal command-summary helper, but it can execute the requested local command with `--help` despite saying it does not run the command.

Install only if you are comfortable with the skill potentially running the named command with `--help`. Avoid using it on untrusted command names, paths, or environments where PATH may be attacker-controlled; a safer version would parse man pages only or strictly allowlist commands and add timeout/output limits.

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
bin/tldr-cmd:35
Finding
Unrestricted Local Executable Invocation Through User-Controlled Command Input<![CDATA[ ## Vulnerability Details **File Location**: `bin/tldr-cmd`, lines 35–39 **Vulnerability Type**: Unrestricted execution of a user-selected local program **Risk Level**: High ### Vulnerable Code ```bash if [[ -z "$about" && -z "$usage" ]] && command -v "$cmd" >/dev/null 2>&1; then help="$("$cmd" --help 2>&1 || true)" if [[ -n "$help" ]]; then about="$(printf '%s\n' "$help" | head -1 | tr -s ' \t' ' ' | sed 's/^ *//;s/ *$//')" usage="$cmd [options]" ``` ### Technical Analysis The positional argument assigned to `cmd` is controlled by the caller. If no usable man-page description or synopsis is found, the script resolves that value with `command -v` and directly executes the selected program with `--help`. The quoted expansion prevents shell metacharacters inside `cmd` from being interpreted as additional shell syntax, so this is not conventional shell command injection. It nevertheless allows the caller to select an arbitrary executable, including an executable referenced by an absolute path, relative path, or attacker-influenced `PATH`. Passing `--help` does not make an executable safe. A program may ignore that argument and perform arbitrary actions before returning help output. The `|| true` expression only suppresses a nonzero exit status and does not prevent the program's side effects. This behavior also conflicts with the statement in `SKILL.md` that the Skill “does **not** run the command,” potentially causing callers to pass untrusted command names under an incorrect security assumption. The command output is captured without a timeout or size limit. A selected executable can therefore also hang the Skill or generate enough output to consume excessive memory. ### Attack Path 1. An attacker creates or identifies an executable that performs harmful actions regardless of receiving `--help`. 2. The attacker supplies its absolute path, relative path, or name as the first argument to `bin/tldr-cmd`. Alternatively, the attacker plac ...[truncated 1287 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the executable fallback and limit the Skill to parsing trusted, non-executing documentation sources such as locally installed man pages. 2. If fallback execution is an essential feature, use a strict allowlist of commands that have been reviewed as safe to invoke with `--help`. 3. Reject command values containing `/` and validate names against a conservative pattern such as `^[A-Za-z0-9._+-]+$`. This reduces path-based selection but must not replace an allowlist. 4. Resolve allowed commands against trusted system directories rather than an inherited, potentially attacker-controlled `PATH`. 5. Execute any unavoidable fallback in a sandbox with minimal privileges, a sanitized environment, no sensitive working-directory access, restricted filesystem access, disabled network access, and resource limits. 6. Apply a short timeout and a strict output-size limit to prevent hanging processes and memory exhaustion. 7. Update `SKILL.md` to disclose accurately that the fallback executes the requested program. If execution is removed, retain and enforce the existing non-execution guarantee. ]]>
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

VirusTotal

VirusTotal findings are pending for this skill version.

View on VirusTotal

Static analysis

No suspicious patterns detected.