Security Guardian
Description
Comprehensive security analysis for RTK CLI tool, focusing on **command injection**, **shell escaping**, **hook security**, and **malicious input handling**.
Installation
claude install-skill https://github.com/rtk-ai/rtk README
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
- undefined
RTK Security Threat Model
RTK faces unique security challenges as a CLI proxy that:
- undefined
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
Defense in Depth
Implement multi-layered testing and security best practices.
Security community SecLists Official Repository
[OWASP Testing Guide](https://owasp.org/www-project-web-security-testing-guide/)
Security community Threat Hunting with Sigma Rules
Use Sigma detection rules to hunt for threats and analyze security events
Security community Maintenance Walkthrough - 2026-03-29
- Re-triaged the full 2026-03-15 security finding set against current `main` and wrote a fresh current-head report in `docs/maintainers/security-findings-triage-2026-03-29-refresh.md`. - Added a match
Security community Google Workspace Model Armor
Filter user-generated content for safety
Security community Google Workspace Alert Center
Manage security alerts
Security community Related Agents
Accessibility Audit
| You are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive tec... | - | [wshobson/agents](https://github.com/wshobson/agents) |
wcag-audit-patterns
| Comprehensive guide to auditing web content against WCAG 2.2 guidelines with actionable remediation... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Deps Audit
| You are a dependency security expert specializing in vulnerability scanning, license compliance, and... | - | [wshobson/agents](https://github.com/wshobson/agents) |