The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-31994

CVE-2026-31994: Openclaw Command Injection Vulnerability

CVE-2026-31994 is a command injection vulnerability in Openclaw affecting versions before 2026.2.19. Attackers can execute arbitrary commands via Windows scheduled tasks. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: March 20, 2026

CVE-2026-31994 Overview

CVE-2026-31994 is a local command injection vulnerability affecting OpenClaw versions prior to 2026.2.19. The vulnerability exists in the Windows scheduled task script generation functionality 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.

Critical Impact

Local attackers can achieve arbitrary command execution within the Windows scheduled task context, potentially leading to system compromise, privilege escalation, or persistent access on affected Windows systems running vulnerable OpenClaw versions.

Affected Products

  • OpenClaw versions prior to 2026.2.19 (Node.js package)
  • Microsoft Windows (as the target operating system)

Discovery Timeline

  • 2026-03-19 - CVE-2026-31994 published to NVD
  • 2026-03-19 - Last updated in NVD database

Technical Details for CVE-2026-31994

Vulnerability Analysis

This vulnerability is classified as CWE-78 (Improper Neutralization of Special Elements used in an OS Command), commonly known as OS Command Injection. The flaw resides in the schtasks.ts daemon component responsible for generating Windows scheduled task scripts.

The core issue stems from inadequate input sanitization when constructing command-line arguments for Windows batch scripts. The original quoteCmdArg function failed to properly handle several categories of dangerous characters:

  1. CR/LF Sequences: Carriage return (\r) and line feed (\n) characters could be injected to break out of the intended command context and inject new commands on separate lines
  2. CMD Metacharacters: Special characters like %, !, &, |, <, >, ^, (, and ) were not properly escaped, allowing command chaining and redirection
  3. Empty Values: Metacharacter-only inputs could result in empty quoted strings that alter command parsing behavior

Root Cause

The root cause is insufficient input validation and improper escaping of user-controlled input when generating Windows CMD script content. The original quoteCmdArg function only handled spaces, tabs, and double quotes, leaving critical CMD metacharacters and line break sequences unescaped. This allowed attackers who could influence script generation arguments to inject arbitrary commands into the generated scheduled task scripts.

Attack Vector

This is a local attack vector requiring the attacker to have local access to the system and the ability to control arguments passed to the service script generation functionality. Exploitation does not require user interaction but does require low-level privileges on the target system.

An attacker could craft malicious input containing:

  • CR/LF sequences to inject new command lines
  • CMD metacharacters (&, |, etc.) for command chaining
  • Environment variable expansion characters (%, !) for variable manipulation

When the vulnerable scheduled task script is executed by Windows Task Scheduler, the injected commands run in the security context of the scheduled task.

typescript
// Security patch in src/daemon/schtasks.ts - fix(daemon): harden windows schtasks script quoting
   return path.join(stateDir, scriptName);
 }
 
-function quoteCmdArg(value: string): string {
+function assertNoCmdLineBreak(value: string, field: string): void {
+  if (/[\r\n]/.test(value)) {
+    throw new Error(`${field} cannot contain CR or LF in Windows task scripts.`);
+  }
+}
+
+function quoteSchtasksArg(value: string): string {
   if (!/[ \t"]/g.test(value)) {
     return value;
   }
   return `"${value.replace(/"/g, '\\"')}"`;
 }
 
+function quoteCmdScriptArg(value: string): string {
+  assertNoCmdLineBreak(value, "Command argument");
+  if (!value) {
+    return '""';
+  }
+  const escaped = value.replace(/"/g, '\\"').replace(/%/g, "%%").replace(/!/g, "^!");
+  if (!/[ \t"&|<>^()%!]/g.test(value)) {
+    return escaped;
+  }
+  return `"${escaped}"`;
+}
+
+function unescapeCmdScriptArg(value: string): string {

Source: GitHub Commit

Detection Methods for CVE-2026-31994

Indicators of Compromise

  • Presence of gateway.cmd files containing unexpected command sequences or multiple command separators (&, |, &&, ||)
  • Scheduled task scripts with embedded CR/LF characters or unusual line structures
  • Windows Task Scheduler logs showing unexpected command executions originating from OpenClaw-related tasks
  • Suspicious process spawning from scheduled task contexts that deviate from expected OpenClaw behavior

Detection Strategies

  • Monitor Windows Task Scheduler for tasks associated with OpenClaw that execute unexpected commands or spawn child processes
  • Implement file integrity monitoring on gateway.cmd and related scheduled task script files for unauthorized modifications
  • Deploy endpoint detection rules to identify command injection patterns in CMD script arguments, particularly sequences containing %, !, &, |, or CR/LF characters
  • Review OpenClaw service logs for errors related to argument parsing or script generation failures

Monitoring Recommendations

  • Enable Windows Process Creation auditing (Event ID 4688) with command-line logging to capture scheduled task executions
  • Configure SentinelOne Singularity to monitor for suspicious command chaining patterns in scheduled task contexts
  • Implement behavioral detection for processes spawned by Task Scheduler that attempt to execute reconnaissance or post-exploitation commands
  • Audit and inventory all OpenClaw installations to identify systems running vulnerable versions prior to 2026.2.19

How to Mitigate CVE-2026-31994

Immediate Actions Required

  • Upgrade OpenClaw to version 2026.2.19 or later immediately on all affected Windows systems
  • Audit existing scheduled tasks created by OpenClaw for signs of tampering or injected commands
  • Review and regenerate any gateway.cmd files created by vulnerable OpenClaw versions
  • Restrict local access to systems running OpenClaw to minimize the attack surface for local privilege escalation

Patch Information

The vulnerability has been addressed in OpenClaw version 2026.2.19. The fix introduces comprehensive input validation through the assertNoCmdLineBreak function that explicitly rejects CR/LF characters, and the new quoteCmdScriptArg function properly escapes CMD metacharacters including %, !, and other shell-sensitive characters.

Patch details are available in the GitHub Commit and the GitHub Security Advisory.

Workarounds

  • If immediate patching is not possible, restrict local user access to systems running vulnerable OpenClaw versions
  • Implement strict input validation at the application layer before passing arguments to OpenClaw service script generation
  • Monitor and restrict permissions on directories where scheduled task scripts are generated
  • Consider temporarily disabling OpenClaw scheduled task functionality until the patch can be applied
bash
# Verify OpenClaw version and upgrade
npm list openclaw
npm update openclaw@2026.2.19

# Audit existing scheduled tasks for suspicious content
schtasks /query /fo LIST /v | findstr /i "openclaw"

# Review gateway.cmd files for injected commands
dir /s /b "gateway.cmd" 2>nul

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechOpenclaw

  • SeverityMEDIUM

  • CVSS Score6.9

  • EPSS Probability0.13%

  • Known ExploitedNo
  • CVSS 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-78
  • Technical References
  • VulnCheck Advisory on Command Injection
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-35641: Openclaw RCE Vulnerability

  • CVE-2026-35650: Openclaw RCE Vulnerability

  • CVE-2026-35643: Openclaw Openclaw RCE Vulnerability

  • CVE-2026-32917: Openclaw Remote Command Injection Flaw
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English