Agent skill
security-scan
Schneller Security-Scan der Speicher Analyse Tauri-App (React + TypeScript Frontend). Prüft Command Injection, XSS, Path Traversal und Tauri-Sicherheitskonfiguration. Aufruf mit /security-scan [datei-oder-modul oder "all"].
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/security-scan-haenel881988-speicher-analyse
SKILL.md
Security-Scan
Du führst einen fokussierten Security-Scan der Speicher Analyse Tauri-App durch.
Argument
$ARGUMENTS = Dateipfad, Modulname ODER all für vollständigen Scan
Prüfkategorien
1. Command Injection (KRITISCH)
Rust-Backend (src-tauri/src/commands/cmd_*.rs):
SICHER: let safe = param.replace("'", "''"); let script = format!("... '{}'", safe);
UNSICHER: let script = format!("... '{}'", param); // param kommt vom Frontend!
Prüfschritte:
- Grep nach
format!(in allencmd_*.rsDateien - Für jedes Match: Parameter VOR format!() mit
.replace("'", "''")escaped? - Ausnahme: Hardcoded Strings ohne User-Parameter sind OK
2. XSS (KRITISCH)
React-Frontend (src/views/*.tsx, src/components/*.tsx):
In React ist XSS deutlich seltener, weil JSX automatisch escaped. Prüfe:
UNSICHER: dangerouslySetInnerHTML={{ __html: userInput }}
SICHER: {variable} in JSX (automatisch escaped)
SICHER: dangerouslySetInnerHTML={{ __html: sanitizedStaticHtml }}
Prüfschritte:
- Grep nach
dangerouslySetInnerHTMLin allen TSX-Dateien - Für jedes Match: Wird der Inhalt sanitisiert oder ist er vertrauenswürdig?
- Grep nach direkter DOM-Manipulation (
document.getElementById,innerHTML)
3. Path Traversal (HOCH)
Rust-Backend:
- Grep nach
tokio::fs::,std::fs::,Path::new(in cmd_*.rs - Kommt der Pfad aus einem Frontend-Parameter?
- Wird der Pfad validiert?
4. Tauri-Konfiguration (HOCH)
src-tauri/tauri.conf.json:
security.cspist NICHTnulloder leerwithGlobalTauriisttrue(React-App brauchtwindow.__TAURI__)- Capabilities minimal konfiguriert
src-tauri/src/lib.rs:
4. tauri-plugin-single-instance registriert
5. Alle Commands in generate_handler![] auch in commands/ definiert
5. Parameter-Validierung (MITTEL)
- IP-Adressen: Per Regex validiert?
- Enum-Werte: Per
matchauf Whitelist? - Pfade: Auf Existenz geprüft?
- Strings: Für PowerShell escaped?
Scan-Ablauf
Ganzes Modul (/security-scan privacy)
- Lies
src-tauri/src/commands/cmd_privacy.rs - Lies
src/views/PrivacyView.tsx - Prüfe Kategorien 1-3, 5
Vollständiger Scan (/security-scan all)
- Rust-Backend: Lies alle
src-tauri/src/commands/cmd_*.rs - Konfiguration: Lies
src-tauri/tauri.conf.json - App-Setup: Lies
src-tauri/src/lib.rs - React-Frontend: Grep alle
src/views/*.tsxundsrc/components/*.tsxnachdangerouslySetInnerHTML,document.getElementById, direkte DOM-Manipulation - API-Bridge: Lies
src/api/tauri-api.ts(keine unvalidierten Durchreichungen?) - Prüfe ALLE 5 Kategorien
Ausgabeformat
## Security-Scan: [Datei/Modul/Gesamt]
### Zusammenfassung
- Geprüfte Dateien: X
- Kritische Funde: X
- Hohe Funde: X
- Mittlere Funde: X
### Kritisch (sofort beheben)
| # | Typ | Datei:Zeile | Code-Ausschnitt | Empfehlung |
### Hoch (vor nächstem Release beheben)
| # | Typ | Datei:Zeile | Problem | Empfehlung |
### Sicher
- Was korrekt umgesetzt ist
Typ-Kürzel
| Kürzel | Bedeutung |
|---|---|
| CMD-INJ | Command Injection (PowerShell) |
| XSS | Cross-Site Scripting (dangerouslySetInnerHTML) |
| PATH-TRAV | Path Traversal |
| CFG | Konfigurationsproblem |
| VALID | Fehlende Validierung |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?