process-execution-security
Command injection elimination, strict binary allowlisting, sanitized environment variables, execution timeouts, and process group reaping
- License 许可
- MIT
- 所属仓库
- poppyTM/oride
- 最近更新
- 2026-09-30
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- process-execution-security
- description
- Command injection elimination, strict binary allowlisting, sanitized environment variables, execution timeouts, and process group reaping
02 资源文件 7
- 参考文档checks/process-execution-security-checklist.md600 B
- 参考文档examples/safe_subprocess_execution.md1.8 KB
- 参考文档manifest.json1.8 KB
- 参考文档references/command-injection-prevention.md1.8 KB
- 脚本scripts/check_subprocess_usage.sh63 B
- 脚本scripts/verify.sh4.0 KB
- 参考文档templates/process-execution-security-report.md1.1 KB
03 SKILL.md 正文
Subprocess & Execution Security
1. Command Injection Elimination
Never pass raw formatted strings to a shell interpreter (/bin/sh -c, cmd.exe). Always execute commands using direct argument vectors (exec.Command(binary, arg1, arg2)) where arguments are passed as isolated strings without shell parsing.
2. Strict Binary Allowlisting
Execute only binaries present on an explicit, pre-approved project allowlist (e.g. git, go, npm, cargo, prumo). Reject execution of arbitrary or user-specified binaries not registered in the project capability policy.
3. Environment Variable Sanitization
Never inherit the full environment of the parent process. Construct an isolated environment slice containing only necessary, sanitized variables (e.g. PATH, HOME, LANG). Strip API keys, tokens, and credentials.
4. Working Directory Confinement
Confine subprocess execution strictly within the current project repository root directory. Validate that the working directory exists and is owned by the current user before launching.
5. Mandatory Execution Timeouts
Always bind subprocess lifecycles to an explicit context with timeout (context.WithTimeout). Default to a 60-second limit for developer commands and 10 seconds for diagnostics, preventing runaway deadlocks.
6. Output Buffer Limiting
Wrap stdout and stderr capture buffers with bounded readers (io.LimitReader) to prevent unbounded subprocess output from consuming all system RAM.
7. Privilege Demotion
Execute all subprocesses under the current unprivileged user. Explicitly forbid execution under root/superuser accounts. Block commands attempting sudo, su, or setuid elevation.
8. Process Group Cleanup & Orphan Reaping
Configure child processes with a dedicated process group (Setpgid: true). On cancellation or timeout, send SIGKILL to the entire process group (-pgid) to guarantee zero orphaned background processes.
9. Banned Construct Scanners
Run automated static checks across the project codebase to detect and ban dangerous dynamic execution functions (eval(), exec(), system(), popen(), Function()).
10. Process Audit Journal
Log every command invocation to .prumo/history/journal.json: capture binary name, sanitized argument list, working directory, start time, duration, exit code, and captured error output.
04 同仓库更多 Skills
zoom-reflow
暂无简介
wireframe-styleguide
暂无简介
visual-regression
Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates
ui-implementation
Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.
tui-editor-engine
Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.
tree-sitter-context-indexing
暂无简介