GHSA-VFFC-F7R7-RX2W: Systemd Unit Injection in OpenClaw Enables Local Command Execution
Vulnerability ID: GHSA-VFFC-F7R7-RX2W
CVSS Score: 8.2
Published: 2026-03-03
A critical systemd unit injection vulnerability exists in OpenClaw versions prior to the February 20, 2026 patch. The vulnerability resides in the buildSystemdUnit function, which fails to properly sanitize newline characters in user-controlled inputs (such as environment variables) during the generation of systemd service files. This allows local attackers to inject arbitrary systemd directives, such as ExecStartPre, resulting in the execution of malicious commands with the privileges of the OpenClaw service (potentially root) upon service startup or restart.
TL;DR
OpenClaw fails to sanitize newlines in generated systemd unit files. Attackers can inject malicious directives (e.g., ExecStartPre) via environment variables, achieving Local Command Execution (LCE) when the service starts.
Technical Details
- CVSS v3.1: 8.2 (High)
- Attack Vector: Local (AV:L)
- CWE ID: CWE-93
- CWE Name: Improper Neutralization of CRLF Sequences
- Impact: Local Command Execution / Privilege Escalation
- Patch Date: 2026-02-20
Affected Systems
- Linux systems using systemd
- OpenClaw deployments on Linux
-
openclaw: < 2026.02.20 (Fixed in:
2026.02.20 (Commit 61f646c))
Code Analysis
Commit: 61f646c
Fix systemd unit generation injection vulnerability
Mitigation Strategies
- Upgrade OpenClaw to a patched version immediately.
- Restrict permissions on OpenClaw configuration files to prevent unauthorized modification.
- Harden systemd service configurations using
systemd-analyze securityguidelines.
Remediation Steps:
-
Identify Vulnerable Installations: Check for
openclawnpm packages installed globally or locally with versions prior to Feb 20, 2026. -
Apply Update: Run
npm update -g openclawor pull the latest docker image ensuring the version includes commit61f646c. Verify the installed version is post-2026.02.20. -
Audit Existing Units: Inspect
/etc/systemd/system/and~/.config/systemd/user/for OpenClaw-generated service files. Look for suspicious multi-lineEnvironmentdirectives or unexpectedExeccommands. -
Reload Daemon: After patching, force a regeneration of unit files and run
systemctl daemon-reload.
References
Read the full report for GHSA-VFFC-F7R7-RX2W on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)