{"id":"CVE-2026-31994","aliases":["CVE-2026-31994","GHSA-mqr9-vqhq-3jxw"],"related":[],"kind":"vulnerability","state":"published","title":"OpenClaw < 2026.2.19 - Local Command Injection via Unsafe cmd Argument Handling in Windows Scheduled Task Script Generation","summary":"OpenClaw versions prior to 2026.2.19 contain a local command injection vulnerability in Windows scheduled task script generation due to unsafe handling of cmd metacharacters and expansion-sensitive characters in gateway.cmd files. Local attackers with control over service script generation arguments can inject arbitrary commands by providing metacharacter-only values or CR/LF sequences that execute unintended code in the scheduled task context.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"OpenClaw versions prior to 2026.2.19 contain a local command injection vulnerability in Windows scheduled task script generation due to unsafe handling of cmd metacharacters and expansion-sensitive characters in gateway.cmd files. Local attackers with control over service script generation arguments can inject arbitrary commands by providing metacharacter-only values or CR/LF sequences that execute unintended code in the scheduled task context.","source":"cvelist"},{"lang":"en","text":"### Summary\nOpenClaw Windows Scheduled Task script generation allowed unsafe argument handling in generated `gateway.cmd` files. In vulnerable versions, cmd metacharacter-only values could be emitted without safe quoting/escaping, which could lead to unintended command execution when the scheduled task runs.\n\n### Details\nThe issue affected Windows daemon startup script generation in `src/daemon/schtasks.ts`.\n\nVulnerable behavior included:\n- Incomplete cmd argument quoting for metacharacter-only values.\n- Incomplete handling of cmd expansion-sensitive characters in script arguments.\n- Missing CR/LF guards for script-rendered fields.\n\nThe fix hardens Windows script generation by:\n- Separating schtasks argument quoting from batch script argument quoting.\n- Quoting cmd metacharacter arguments and escaping `%` / `!` expansion cases.\n- Rejecting CR/LF in command arguments, task descriptions, and rendered environment assignments.\n- Adding regression tests for metacharacter and line-break injection paths.\n\n### Impact\nThis issue is local to Windows deployments and requires control over values that feed service script generation (for example install-time/runtime arguments or environment-derived values). It can result in unintended command execution in the scheduled task context.\n\n### Affected Packages / Versions\n- Package: `openclaw` (npm)\n- Vulnerable versions: `<= 2026.2.17`\n- Patched version: `>= 2026.2.19` (planned next npm release)\n- Latest published npm version at update time (2026-02-19): `2026.2.17`\n\n### Fix Commit(s)\n- `280c6b117b2f0e24f398e5219048cd4cc3b82396`\n\nOpenClaw thanks @tdjackey for reporting.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Versiones de OpenClaw anteriores a la 2026.2.19 contienen una vulnerabilidad de inyección de comandos local en la generación de scripts de tareas programadas de Windows debido a un manejo inseguro de metacaracteres de cmd y caracteres sensibles a la expansión en los archivos gateway.cmd. Atacantes locales con control sobre los argumentos de generación de scripts de servicio pueden inyectar comandos arbitrarios al proporcionar valores que solo contienen metacaracteres o secuencias CR/LF que ejecutan código no deseado en el contexto de la tarea programada.","source":"nvd"}],"published":"2026-03-03T21:37:29.000Z","modified":"2026-06-23T16:14:22.640Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-78","CWE-116"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"2026.2.19","status":"affected"}],"vendor":"OpenClaw","product":"OpenClaw","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2026.2.19"}],"ecosystem":"npm","package":"openclaw","purl":"pkg:npm/openclaw","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2026.2.19"}],"vendor":"openclaw","product":"openclaw","cpe":"cpe:2.3:a:openclaw:openclaw:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/openclaw/openclaw/security/advisories/GHSA-mqr9-vqhq-3jxw","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/openclaw/openclaw/commit/280c6b117b2f0e24f398e5219048cd4cc3b82396","tags":["patch","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/openclaw-local-command-injection-via-unsafe-cmd-argument-handling-in-windows-scheduled-task","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31994","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/openclaw/openclaw","tags":["package"],"sources":["ghsa"]}],"credits":["tdjackey"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-03-19T16:08:52.427Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31994","url":"https://www.cve.org/CVERecord?id=CVE-2026-31994","licence":"CVE Terms of Use","modified":"2026-06-23T16:14:22.640Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mqr9-vqhq-3jxw","url":"https://github.com/advisories/GHSA-mqr9-vqhq-3jxw","licence":"CC-BY-4.0","modified":"2026-03-19T21:41:21.015Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31994","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31994","licence":"Public domain","modified":"2026-06-17T10:34:53.957Z"}],"updatedAt":"2026-11-25T22:59:16.160Z","epss":{"score":0.00664,"percentile":0.53003,"date":"2026-12-01T12:00:22.000Z"}}