Security Guardian
Description
Comprehensive security analysis for RTK CLI tool, focusing on **command injection**, **shell escaping**, **hook security**, and **malicious input handling**.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
Repository README
This is the README for rtk-ai/rtk, shared by 9 entries
in this directory. It describes the repository, not this entry specifically.
description: CLI security expert for RTK - command injection, shell escaping, hook security
Security Guardian
Comprehensive security analysis for RTK CLI tool, focusing on **command injection**, **shell escaping**, **hook security**, and **malicious input handling**.
When to Use
- Automatically triggered: After filter changes, shell command execution logic, hook modifications
- Manual invocation: Before release, after security-sensitive code changes
- Proactive: When handling user input, executing shell commands, or parsing untrusted output
RTK Security Threat Model
RTK faces unique security challenges as a CLI proxy that:
- Executes shell commands based on user input
- Parses untrusted command output (git, cargo, gh, etc.)
- Integrates with Claude Code hooks (rtk-rewrite.sh, rtk-suggest.sh)
- Routes commands transparently (command injection vectors)
Threat Categories
| Threat | Severity | Impact | Mitigation |
|---|---|---|---|
| Command Injection | 🔴 CRITICAL | Remote code execution | Input validation, shell escaping |
| Shell Escaping | 🔴 CRITICAL | Arbitrary command execution | Platform-specific escaping |
| Hook Injection | 🟡 HIGH | Hook hijacking, command interception | Permission checks, signature validation |
| Malicious Output | 🟡 MEDIUM | RTK crash, DoS | Robust parsing, error handling |
| Path Traversal | 🟢 LOW | File access outside filters/ | Path sanitization |
Security Analysis Workflow
1. Threat Identification
**Questions to ask** for every code change:
Input Validation:
- Does this code accept user input?
- Is the input validated before use?
- Can special characters (;, |, &, $, `, \, etc.) cause issues?
Shell Execution:
- Does this code execute shell commands?
- Are command arguments properly escaped?
- Is std::process::Command used (safe) or shell=true (dangerous)?
Output Parsing:
- Does this code parse external command output?
- Can malformed output cause panics or crashes?
- Are regex patterns tested against malicious input?
Hook Integration:
- Does this code modify hooks?
- Are hook permissions validated (executable bit)?
- Is hook source code integrity checked?
2. Code Audit Patterns
**Command Injection Detection**:
// 🔴 CRITICAL: Shell injection vulnerability
let user_input = env::args().nth(1).unwrap();
let cmd = format!("git log {}", user_input); // DANGEROUS!
std::process::Command::new("sh")
.arg("-c")
.arg(&cmd) // Attacker can inject: `; rm -rf /`
.spawn();
// ✅ SAFE: Use Command builder, not shell
use std::process::Command;
let user_input = env::args().nth(1).unwrap();
Command::new("git")
.arg("log")
.arg(&user_input) // Safely passed as argument, not interpreted by shell
.spawn();
**Shell Escaping Vulnerability**:
// 🔴 CRITICAL: No escaping for special chars
fn execute_raw(cmd: &str, args: &[&str]) -> Result {
let full
Related Skills
Fastapi Review
Review a FastAPI application for architecture, async correctness, dependency injection, Pydantic schemas, secu
Security Defense in Depth
Implement multi-layered testing and security best practices.
Security SecLists Official Repository
[OWASP Testing Guide](https://owasp.org/www-project-web-security-testing-guide/)
Security Threat Hunting with Sigma Rules
Use Sigma detection rules to hunt for threats and analyze security events
Security Maintenance Walkthrough - 2026-03-29
- Re-triaged the full 2026-03-15 security finding set against current `main` and wrote a fresh current-head re
Security Google Workspace Model Armor
Filter user-generated content for safety
Security Related Agents
Django Reviewer
Expert Django code reviewer specializing in ORM correctness, DRF patterns, migration safety, security misconfi
Token Auditor
Scans ui/src/ for hardcoded visual values, duplicate components, and shadcn replacement candidates; produces d
Gitnexus Security Boundary Reviewer
GitNexus security and trust-boundary reviewer. Use for auth, permissions, secrets, injection, unsafe parsing,