Wysoka

OpenClaw Improperly Neutralizes Line Breaks in systemd Unit Generation Enables Local Command Execution (Linux)

  • Ujawniono: 03.03.2026
  • Aktualizacja: 11.10.2026 10:22

Summary

A command injection vulnerability exists in OpenClaw’s Linux systemd unit generation path. When rendering Environment= entries, attacker-controlled values are not rejected for CR/LF, and systemdEscapeArg() uses an incorrect whitespace-matching regex. This allows newline injection to break out of an Environment= line and inject standalone systemd directives (for example, ExecStartPre=). On service restart, the injected command is executed, resulting in local arbitrary command execution (local RCE) under the gateway service user.


Details

The issue is in src/daemon/systemd-unit.ts:

  • renderEnvLines(...) builds:
  • Environment=${systemdEscapeArg(${key}=${value})}
  • No CR/LF validation is enforced for environment keys/values before writing unit lines.
  • systemdEscapeArg(...) uses:
  • /[\\s"\\\\]/
  • In this regex, \\s is interpreted as a literal backslash + s, not a whitespace character class. As a result, whitespace detection/quoting behavior is incorrect. Because systemd parses unit files line-by-line, a newline inside an environment value can inject an additional directive line. Example rendered output:
ini
Environment=INJECT=ok
ExecStartPre=/bin/touch /tmp/oc15789_rce

At restart time, systemd executes ExecStartPre, enabling command execution.

Relevant code path/components involved in exploitation chain:

  • src/daemon/systemd-unit.ts
  • src/commands/daemon-install-helpers.ts
  • src/config/env-vars.ts
  • src/config/zod-schema.ts

Trigger conditions:

  1. Attacker can influence config.env.vars (directly or indirectly).
  2. Install/reinstall path is invoked to write/update the unit.
  3. Service restart occurs (systemctl --user restart ...).

PoC

Environment: Linux host with systemd user services enabled.

  1. Configure a malicious environment value in OpenClaw config (config.env.vars), including a newline and injected directive:
  • Key: INJECT
  • Value:
ok
ExecStartPre=/bin/touch /tmp/oc15789_rce
  1. Install/reinstall the gateway service (fixed port as requested):
bash
openclaw gateway install --port 15789 --force
  1. Inspect the generated user unit file (default path):
bash
~/.config/systemd/user/openclaw-gateway.service

Verify that an injected standalone line exists:

ini
ExecStartPre=/bin/touch /tmp/oc15789_rce
  1. Reload and restart user service:
bash
systemctl --user daemon-reload
bash
systemctl --user restart openclaw-gateway.service
  1. Confirm command execution side effect:
bash
ls -l /tmp/oc15789_rce

Impact

This is a local command execution vulnerability in OpenClaw’s systemd unit generation during install/reinstall flows.

  • Type: Command injection via newline/directive injection in unit file generation.
  • Execution context: Runs with the same privileges as the OpenClaw gateway service user.
  • Affected users: Linux deployments using systemd user services where an attacker can control config.env.vars and trigger install/reinstall.

Fix Commit(s)

  • 61f646c41fb43cd87ed48f9125b4718a30d38e84

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Paczka npm openclaw < 2026.2.21 2026.2.21

Odnośniki

Ocena CVSS -
Wektor CVSS
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Słabość (CWE)
CWE-77
Platforma
npm
Paczka
openclaw
Ujawniono
03.03.2026
Aktualizacja
11.10.2026 10:22

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-vffc-f7r7-rx2w - CC BY 4.0

Historia podatności: openclaw

Wszystkie opisane podatności tej paczki (Paczka npm), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (589) w archiwum
Wszystkich wpisów
589
Pierwsza → ostatnia
02.2026 10.2026
Bez poprawki
9
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 20
  • Wysoka 215
  • Średnia 300
  • Niska 54

Ujawnienia w latach

  1. 2026: 589
Istotność:
  1. Wysoka · 8.8 CVE-2026-53836 < 2026.5.12 2026.5.12
  2. Wysoka · 8.8 CVE-2026-53811 < 2026.5.7 2026.5.7
  3. Wysoka · 8.8 CVE-2026-53806 < 2026.5.12 2026.5.12
  4. Wysoka · 7.8 CVE-2026-53813 < 2026.4.25 2026.4.25
  5. Wysoka · 7.5 CVE-2026-53834 < 2026.4.27 2026.4.27
  6. Wysoka · 8.3 CVE-2026-32905 < 2026.5.4 2026.5.4
  7. Krytyczna CVE-2026-34507 < 2026.4.29 2026.4.29
  8. Wysoka CVE-2026-53823 < 2026.5.3 2026.5.3
  9. Wysoka · 8.4 CVE-2026-53814 < 2026.5.20 2026.5.20
  10. Wysoka · 8.0 CVE-2026-53817 < 2026.5.22 2026.5.22
  11. Wysoka · 6.5 CVE-2026-53815 < 2026.5.19 2026.5.19
  12. Wysoka · 8.1 CVE-2026-53849 < 2026.5.7 2026.5.7
  13. Wysoka · 7.1 CVE-2026-53853 < 2026.5.12 2026.5.12
  14. Wysoka · 8.1 CVE-2026-53857 < 2026.5.3 2026.5.3
  15. Wysoka · 8.1 CVE-2026-53855 < 2026.4.2 2026.4.2
  16. Wysoka · 8.1 CVE-2026-53866 < 2026.5.12 2026.5.12
  17. Wysoka · 8.1 CVE-2026-53864 < 2026.5.26 2026.5.26
  18. Wysoka · 7.8 CVE-2026-44114 < 2026.4.20 2026.4.20
  19. Krytyczna · 9.8 CVE-2026-44109 < 2026.4.15 2026.4.15
  20. Krytyczna · 8.1 CVE-2026-43585 < 2026.4.15 2026.4.15
  21. Wysoka · 8.8 CVE-2026-43530 >= 2026.2.23, < 2026.4.12 2026.4.12
  22. Wysoka · 8.8 CVE-2026-42434 >= 2026.4.5, < 2026.4.10 2026.4.10
  23. Wysoka · 7.5 CVE-2026-42437 >= 2026.4.9, < 2026.4.10 2026.4.10
  24. Wysoka CVE-2026-41393 < 2026.3.31 2026.3.31
  25. Krytyczna · 8.2 CVE-2026-41296 < 2026.3.31 2026.3.31
  26. Wysoka · 8.8 CVE-2026-41352 < 2026.3.31 2026.3.31
  27. Wysoka · 7.8 CVE-2026-41396 < 2026.3.31 2026.3.31
  28. Wysoka · 7.3 CVE-2026-41380 < 2026.3.28 2026.3.28
  29. Wysoka · 8.6 CVE-2026-35641 < 2026.3.24 2026.3.24
  30. Wysoka CVE-2026-35636 >= 2026.3.11, < 2026.3.28 2026.3.28
  31. Krytyczna CVE-2026-35625 <= 2026.3.24 brak poprawki
  32. Wysoka · 7.5 CVE-2026-35650 < 2026.3.22 2026.3.22
  33. Wysoka · 8.8 CVE-2026-35643 < 2026.3.22 2026.3.22
  34. Wysoka · 7.5 CVE-2026-32846 < 2026.03.28 2026.03.28
  35. Wysoka · 8.8 CVE-2026-33573 < 2026.3.11 2026.3.11
  36. Krytyczna · 9.9 CVE-2026-22172 < 2026.3.12 2026.3.12
  37. Wysoka · 8.8 CVE-2026-32915 < 2026.3.11 2026.3.11
  38. Krytyczna · 9.4 CVE-2026-32916 >= 2026.3.7, < 2026.3.11 2026.3.11
  39. Wysoka · 7.6 CVE-2026-32055 < 2026.2.26 2026.2.26
  40. Wysoka · 7.1 ghsa-gp3q-wpq4-5c5h < 2026.2.26 2026.2.26
  41. Wysoka · 7.4 CVE-2026-3690 < 2026.2.19 2026.2.19
  42. Wysoka ghsa-jxrq-8fm4-9p58 < 2026.2.22 2026.2.22
  43. Wysoka ghsa-659f-22xc-98f2 < 2026.2.22 2026.2.22
  44. Wysoka ghsa-w7j5-j98m-w679 < 2026.2.21 2026.2.21
  45. Wysoka · 7.8 CVE-2026-32015 >= 2026.1.21, < 2026.2.19 2026.2.19
  46. OpenClaw Improperly Neutralizes Line Breaks in systemd Unit Generation Enables Local Command Execution (Linux) ten wpis
    Wysoka CVE-2026-32063 < 2026.2.21 2026.2.21
  47. Wysoka · 7.5 CVE-2026-32030 < 2026.2.19 2026.2.19
  48. Wysoka · 7.7 CVE-2026-32064 < 2026.2.21 2026.2.21
  49. Wysoka · 6.0 CVE-2026-28393 >= 2.0.0-beta3, < 2026.2.14 2026.2.14
  50. Wysoka · 8.8 ghsa-943q-mwmv-hhvh < 2026.2.14 2026.2.14
  51. Wysoka · 5.9 CVE-2026-28464 < 2026.2.12 2026.2.12
  52. Wysoka · 8.1 CVE-2026-28453 < 2026.2.14 2026.2.14
  53. Wysoka CVE-2026-3689 < 2026.2.21 2026.2.21
  54. Wysoka ghsa-7xmq-g46g-f8pv < 2026.3.1 2026.3.1
  55. Krytyczna CVE-2026-31999 >= 2026.2.26, < 2026.3.1 2026.3.1
  56. Wysoka · 5.4 CVE-2026-28479 < 2026.2.15 2026.2.15
  57. Wysoka CVE-2026-27001 < 2026.2.15 2026.2.15
  58. Wysoka · 7.1 CVE-2026-28468 >= 2026.1.29-beta.1, < 2026.2.14 2026.2.14
  59. Wysoka · 7.5 CVE-2026-29611 < 2026.2.14 2026.2.14
  60. Wysoka · 7.6 CVE-2026-27487 < 2026.2.14 2026.2.14
  61. Wysoka · 7.2 CVE-2026-28456 >= 2026.1.5, < 2026.2.14 2026.2.14
  62. Wysoka ghsa-w5c7-9qqw-6645 < 2026.2.13 2026.2.13
  63. Wysoka · 7.5 CVE-2026-29609 < 2026.2.14 2026.2.14
  64. Wysoka CVE-2026-26323 >= 2026.1.8, < 2026.2.14 2026.2.14
  65. Wysoka · 7.6 CVE-2026-26322 < 2026.2.14 2026.2.14
  66. Wysoka · 7.5 CVE-2026-26321 < 2026.2.14 2026.2.14
  67. Wysoka CVE-2026-26320 >= 2026.2.6-0, < 2026.2.14 2026.2.14
  68. Wysoka · 8.1 CVE-2026-28447 >= 2026.1.20, < 2026.2.1 2026.2.1
Pokaż więcej (15) Widać 220 z 235

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.