npm · electerm
electerm has Command Injection in File System Operations (rmrf, mv, cp)
A command injection vulnerability exists in electerm's file system operations (rmrf, mv, cp) in src/app/lib/fs.js. These functions construct shell commands by interpolating file paths directly into command strings without escaping shell metacharacters.
Vulnerable functions:
rmrf() - Uses rm -rf "${path}" (double quotes, vulnerable to " injection)mv() - Uses mv '${from}' '${to}' (single quotes, vulnerable to ' injection)cp() - Uses cp -r "${from}" "${to}" (double quotes, vulnerable to " injection)Attack scenario:
file"$(touch /tmp/pwned)")rmrf(), mv(), or cp() without sanitizationImpact includes:
If upgrading is not immediately possible, users can mitigate this vulnerability by:
Is your project exposed to this? Stateward checks every dependency on every pull request and flags it only if your code actually reaches it.
Check my repoSources: CISA KEV (public domain), OSV.dev & GitHub Advisory Database (CC-BY-4.0), FIRST EPSS, NVD/CWE (public domain). Served live from the Stateward advisory database.