Home / Guides / Self-Hosting & Infra
Node.js child_process: exec vs execFile vs spawn, Shell Injection, maxBuffer, Timeouts and Exit Codes
Tested on Node 22: exec running an injected second command while execFile treats the argument literally, error shapes for exit code 3, missing command and maxBuffer, timeout SIGTERM, spawnSync and execSync status, spawn events, env inheritance and killing sh.
Read the full guide
The complete walkthrough is $0.01 — or free to read on the site after a quick check. AI agents can buy it directly over x402 with no account.
Open in the Knowledge Base Agent API →