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:
{
"cwe_ids": [
"CWE-78"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-02T19:22:31Z",
"nvd_published_at": null,
"severity": "HIGH"
}