{"id":"CVE-2026-22217","aliases":["CVE-2026-22217","GHSA-p4wh-cr8m-gm6c"],"related":[],"kind":"vulnerability","state":"published","title":"OpenClaw 2026.2.22 < 2026.2.23 - Arbitrary Binary Execution via $SHELL Environment Variable Trusted Prefix Fallback","summary":"OpenClaw version 2026.2.22 prior to 2026.2.23 contains an arbitrary code execution vulnerability in shell-env that allows attackers to execute attacker-controlled binaries by exploiting trusted-prefix fallback logic for the $SHELL variable. An attacker can influence the $SHELL environment variable on systems with writable trusted-prefix directories such as /opt/homebrew/bin to execute arbitrary binaries in the OpenClaw process context.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"OpenClaw version 2026.2.22 prior to 2026.2.23 contains an arbitrary code execution vulnerability in shell-env that allows attackers to execute attacker-controlled binaries by exploiting trusted-prefix fallback logic for the $SHELL variable. An attacker can influence the $SHELL environment variable on systems with writable trusted-prefix directories such as /opt/homebrew/bin to execute arbitrary binaries in the OpenClaw process context.","source":"cvelist"},{"lang":"en","text":"### Summary\n`shell-env` fallback trusted prefix-based executable paths for `$SHELL`, allowing execution of attacker-controlled binaries in local/runtime-env influence scenarios.\n\n### Details\nIn affected versions, shell selection accepted either:\n1. a shell listed in `/etc/shells`, or\n2. any executable under hardcoded trusted prefixes (`/bin`, `/usr/bin`, `/usr/local/bin`, `/opt/homebrew/bin`, `/run/current-system/sw/bin`).\n\nThe selected shell was then executed as a login shell (`-l -c 'env -0'`) for PATH/environment probing.\n\nOn systems where a trusted-prefix directory is writable (for example common Homebrew layouts under `/opt/homebrew/bin`) and runtime `$SHELL` can be influenced, this enabled attacker-controlled binary execution in OpenClaw process context.\n\nThe fix removes the trusted-prefix executable fallback and now trusts only shells explicitly registered in `/etc/shells`; otherwise it falls back to `/bin/sh`.\n\n### Affected Packages / Versions\n- Package: `openclaw` (npm)\n- Affected versions: `>= 2026.2.22, <= 2026.2.22-2`\n- Latest published vulnerable version: `2026.2.22-2`\n- Patched versions (released): `>= 2026.2.23`\n\n### Fix Commit(s)\n- `ff10fe8b91670044a6bb0cd85deb736a0ec8fb55`\n\n### Release Process Note\nThis advisory sets `patched_versions` to the released version (`2026.2.23`).\nThis advisory now reflects released fix version `2026.2.23`.\n\nOpenClaw thanks @tdjackey for reporting.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Las versiones de OpenClaw 2026.2.22 y anteriores a la 2026.2.23 contienen una vulnerabilidad de ejecución de código arbitrario en shell-env que permite a los atacantes ejecutar binarios controlados por el atacante explotando la lógica de respaldo de prefijo de confianza para la variable $SHELL. Un atacante puede influir en la variable de entorno $SHELL en sistemas con directorios de prefijo de confianza escribibles como /opt/homebrew/bin para ejecutar binarios arbitrarios en el contexto del proceso de OpenClaw.","source":"nvd"}],"published":"2026-03-03T21:36:16.000Z","modified":"2026-06-23T16:13:53.929Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N","score":5.8,"rating":"MEDIUM"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N","score":5.8,"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:L","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"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-184","CWE-829"],"affected":[{"ranges":[{"type":"semver","introduced":"2026.2.22","fixed":"2026.2.23","status":"affected"}],"vendor":"OpenClaw","product":"OpenClaw","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2026.2.22","status":"affected","fixed":"2026.2.23"}],"ecosystem":"npm","package":"openclaw","purl":"pkg:npm/openclaw","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"2026.2.22","fixed":"2026.2.23"}],"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-p4wh-cr8m-gm6c","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/openclaw/openclaw/commit/ff10fe8b91670044a6bb0cd85deb736a0ec8fb55","tags":["patch","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/openclaw-arbitrary-binary-execution-via-shell-environment-variable-trusted-prefix-fallback","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22217","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-18T16:01:34.013Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-22217","url":"https://www.cve.org/CVERecord?id=CVE-2026-22217","licence":"CVE Terms of Use","modified":"2026-06-23T16:13:53.929Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p4wh-cr8m-gm6c","url":"https://github.com/advisories/GHSA-p4wh-cr8m-gm6c","licence":"CC-BY-4.0","modified":"2026-06-08T23:30:14.508Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-22217","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22217","licence":"Public domain","modified":"2026-06-17T10:19:34.193Z"}],"updatedAt":"2026-11-25T22:59:16.074Z","epss":{"score":0.00146,"percentile":0.04054,"date":"2026-12-01T12:00:22.000Z"}}