CVE-2026-32063: Openclaw OpenClaw Improperly Neutralizes Line Breaks Vulnerability

HIGH
Advisory Identifier: GHSA-vffc-f7r7-rx2w
CWE-77
Published
Advisory Summary

CVE-2026-32063 is a HIGH openclaw improperly neutralizes line breaks vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting Openclaw libraries in the npm ecosystem. The issue involves openclaw improperly neutralizes line breaks in systemd unit generation enables local command execution (linux). Remediation is available by upgrading affected packages to version 2026.2.21.

CVE-2026-32063 at a Glance

CVE Identifier CVE-2026-32063
GHSA Identifier GHSA-vffc-f7r7-rx2w
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
Affected Product Openclaw
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-32063

To remediate this vulnerability, upgrade all affected Openclaw dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

openclaw fixed: 2026.2.21
npm install openclaw@2026.2.21
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls openclaw

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-32063, inspect your project dependencies using npm:

npm ls openclaw

Analyze the terminal output to locate any version of Openclaw in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2026.2.21), your application is affected.

Note: The npm ls openclaw command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In Openclaw, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```text ok ExecStartPre=/bin/touch /tmp/oc15789_rce ``` 2. Install/reinstall the gateway service (fixed port as requested): ```bash openclaw gateway install --port 15789 --force ``` 3. 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 ``` 4. Reload and restart user service: ```bash systemctl --user daemon-reload ``` ```bash systemctl --user restart openclaw-gateway.service ``` 5. 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`

CVE-2026-32063 Affected Openclaw Versions

1 component(s)
Fixed Versions:
2026.2.21
Product / Package Ecosystem Affected Versions Fixed Version
openclaw
npm
< 2026.2.21
2026.2.21

References

Frequently Asked Questions

What is CVE-2026-32063?
CVE-2026-32063 is a security vulnerability in Openclaw involving OpenClaw Improperly Neutralizes Line Breaks in systemd Unit Generation Enables Local Command Execution (Linux) under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
Which Openclaw versions are affected?
Affected versions include releases prior to 2026.2.21 across affected packages: openclaw.
What version fixes CVE-2026-32063?
Upgrading to 2026.2.21 (or the latest patched release for your respective branch) resolves the vulnerability.
Is openclaw affected?
Yes, openclaw is affected in releases prior to 2026.2.21. Upgrade your dependency to 2026.2.21 or later.
What CWE is associated with CVE-2026-32063?
CVE-2026-32063 is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') (The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2026-32063?
Run the dependency tree command: 'npm ls openclaw'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vffc-f7r7-rx2w",
  "modified" : "2026-03-16T21:51:52Z",
  "published" : "2026-03-03T21:52:54Z",
  "aliases" : [ "CVE-2026-32063" ],
  "summary" : "OpenClaw Improperly Neutralizes Line Breaks in systemd Unit Generation Enables Local Command Execution (Linux)",
  "details" : "### Summary\nA command injection vulnerability exists in OpenClaw’s Linux systemd unit generation path.\nWhen 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.\n\n---\n\n### Details\nThe issue is in `src/daemon/systemd-unit.ts`:\n\n- `renderEnvLines(...)` builds:\n- `Environment=${systemdEscapeArg(`${key}=${value}`)}`\n- No CR/LF validation is enforced for environment keys/values before writing unit lines.\n- `systemdEscapeArg(...)` uses:\n- `/[\\\\s\"\\\\\\\\]/`\n- In this regex, `\\\\s` is interpreted as a literal backslash + `s`, not a whitespace character class.\nAs a result, whitespace detection/quoting behavior is incorrect.\nBecause systemd parses unit files line-by-line, a newline inside an environment value can inject an additional directive line. Example rendered output:\n\n```ini\nEnvironment=INJECT=ok\nExecStartPre=/bin/touch /tmp/oc15789_rce\n```\n\nAt restart time, systemd executes `ExecStartPre`, enabling command execution.\n\nRelevant code path/components involved in exploitation chain:\n- `src/daemon/systemd-unit.ts`\n- `src/commands/daemon-install-helpers.ts`\n- `src/config/env-vars.ts`\n- `src/config/zod-schema.ts`\n\nTrigger conditions:\n1. Attacker can influence `config.env.vars` (directly or indirectly).\n2. Install/reinstall path is invoked to write/update the unit.\n3. Service restart occurs (`systemctl --user restart ...`).\n\n---\n\n### PoC\nEnvironment: Linux host with systemd user services enabled.\n\n1. Configure a malicious environment value in OpenClaw config (`config.env.vars`), including a newline and injected directive:\n- Key: `INJECT`\n- Value:\n```text\nok\nExecStartPre=/bin/touch /tmp/oc15789_rce\n```\n\n2. Install/reinstall the gateway service (fixed port as requested):\n```bash\nopenclaw gateway install --port 15789 --force\n```\n\n3. Inspect the generated user unit file (default path):\n```bash\n~/.config/systemd/user/openclaw-gateway.service\n```\nVerify that an injected standalone line exists:\n```ini\nExecStartPre=/bin/touch /tmp/oc15789_rce\n```\n\n4. Reload and restart user service:\n```bash\nsystemctl --user daemon-reload\n```\n```bash\nsystemctl --user restart openclaw-gateway.service\n```\n\n5. Confirm command execution side effect:\n```bash\nls -l /tmp/oc15789_rce\n```\n---\n\n### Impact\nThis is a local command execution vulnerability in OpenClaw’s systemd unit generation during install/reinstall flows.\n\n- **Type:** Command injection via newline/directive injection in unit file generation.\n- **Execution context:** Runs with the same privileges as the OpenClaw gateway service user.\n- **Affected users:** Linux deployments using systemd user services where an attacker can control `config.env.vars` and trigger install/reinstall.\n\n## Fix Commit(s)\n- `61f646c41fb43cd87ed48f9125b4718a30d38e84`",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "openclaw"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2026.2.21"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2026.2.19-2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/openclaw/openclaw/security/advisories/GHSA-vffc-f7r7-rx2w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32063"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/openclaw/openclaw/commit/61f646c41fb43cd87ed48f9125b4718a30d38e84"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/openclaw/openclaw"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/openclaw-command-injection-via-newline-in-systemd-unit-generation"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-03T21:52:54Z",
    "nvd_published_at" : "2026-03-11T14:16:28Z"
  }
}