Skip to content

ajtazer/heckit / skills/cve-hunting/command-injection

command-injection

Verified

Detect OS command injection via shell execution sinks where user-controlled input reaches system commands without proper sanitization.

FileKindSize
SKILL.mdskill md4.6 KB
references/false-positive-indicators.mdmarkdown1.5 KB
references/poc-skeleton.mdmarkdown2.0 KB
references/sinks.mdmarkdown3.0 KB

references/false-positive-indicators.md

View on GitHub
# False Positive Indicators -- Command Injection

## When Command Injection is NOT Exploitable

### 1. Uses Argument Arrays (No Shell)

The command uses the array/list form of execution:
```js
cp.execFile('convert', [userInput, 'output.png']);  // No shell
cp.spawn('git', ['clone', url]);  // No shell (default)
```

**Caveat**: Argument injection is still possible. Check for `--flag` injection with git, ffmpeg, and other tools that accept command-execution flags.

### 2. Input is Hardcoded or From Config

The command string contains no external input. Trace ALL parts of the command string -- even if the command name is hardcoded, arguments might come from user input.

### 3. Input Has Strict Allowlist Validation

User input is validated against a strict allowlist before use. Blocklist validation (rejecting specific characters) is almost always bypassable -- only allowlist validation is reliable.

### 4. Proper Escaping Applied

Language-specific escaping is correctly applied to ALL user-controlled parts:
- PHP: `escapeshellarg()`
- Python: `shlex.quote()`
- Ruby: `Shellwords.escape()`

### 5. Read-Only Command With No Side Effects

The command only reads data. Caveat: even read-only commands can leak sensitive data if the attacker controls the file path.

### 6. Sandboxed/Containerized Environment

Container with no sensitive data, chroot, seccomp profile. Still report but note reduced impact.

### 7. Node.js Runtime Rejection

Node.js rejects null bytes in execFile arguments but most shell metacharacters pass through in exec().
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall