/

CVE-2026-10219

Severity:

HIGH RISK

(7.3)

OS Command Injection in GoClaw write_file Tool

CVE-2026-10219

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77, CWE-78

Impact:

Remote Code Execution

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

GoClaw's write_file tool contains an OS command injection issue in the FsBridge.WriteFile function, allowing untrusted input to influence command execution within the sandboxed filesystem bridge.

When an attacker can remotely supply file paths or related parameters to this tool, they may gain the ability to execute arbitrary operating system commands on the host running GoClaw.

Affected context

The vulnerability occurs in GoClaw deployments using the write_file tool, which relies on the FsBridge.WriteFile implementation in internal/sandbox/fsbridge.go.

It is relevant in contexts where:

  • User-controlled data is passed as arguments to the write_file tool (e.g., file paths, filenames, or auxiliary parameters)
  • That data is ultimately used to construct or invoke OS-level commands
  • The GoClaw instance is exposed over a network (e.g., web interface, API, or automation pipeline) so that untrusted parties can reach the affected functionality

The issue is more impactful when the GoClaw process runs with elevated privileges or has access to sensitive files and services.

Exploit preconditions

  • Attack surface: Network-accessible interfaces, APIs, or workflows that invoke the write_file tool (directly or indirectly).
  • Required access: Ability to provide or influence the parameters passed into FsBridge.WriteFile (such as file names, paths, or options).
  • Trigger point: Execution of a code path where FsBridge.WriteFile constructs and runs an OS command based on those parameters.
  • Why exploitation is possible: Input values are incorporated into OS command execution without robust validation, sanitization, or safe API usage, enabling crafted input to break out of expected command context and inject additional commands.

Why this happens

The underlying bug belongs to the OS command injection class, as described by CWE-78: Improper Neutralization of Special Elements used in an OS Command and closely related to CWE-77.

Conceptually, FsBridge.WriteFile appears to build and invoke shell commands (or shell-interpreted arguments) using values derived from user-controlled input.

Without strict quoting, escaping, or use of non-shell-based APIs, special characters and separators (such as command terminators or operators) can alter the intended command structure, causing the system to execute additional or entirely different commands.

This pattern reflects an insecure design where dynamic command strings or arguments trust external input instead of treating it as untrusted data that must be constrained and passed through safer, parameterized execution primitives.

Potential impact

  • Remote execution of arbitrary OS commands with the privileges of the GoClaw process
  • Reading, modifying, or deleting files accessible to the application account
  • Pivoting to other services or components reachable from the compromised host
  • Bypassing sandbox or filesystem isolation guarantees provided by the write_file tool
  • Disruption of service, including system instability or denial of service

General mitigation guidance

Effective mitigation focuses on eliminating data-driven command construction and tightening trust boundaries around filesystem operations:

  • Prefer safe, native APIs (e.g., direct file I/O and library calls) instead of composing shell commands for file writes or path handling.
  • If OS-level utilities are unavoidable, use parameterized command execution where each argument is passed as a separate parameter, not concatenated into a single shell-processed string.
  • Enforce strict validation on any user-controlled input used in file operations: constrain to expected patterns (such as whitelisted directories, filename formats, and extensions) and reject or neutralize unexpected characters.
  • Apply least-privilege principles to the GoClaw runtime, reducing the damage potential if a command injection occurs (e.g., limited filesystem access, non-root user).
  • Separate high-risk tooling from core services where possible, so that misuse of the write_file tool does not expose higher-privilege environments.

How teams detect issues like this

Detection can combine code-centric and operational approaches:

  • Static analysis: Configure rules to flag dynamic command construction (e.g., uses of os/exec with string concatenation) where user input or network-sourced data flows into command or argument parameters.
  • Code review: Examine filesystem bridge and tooling components for any reliance on shell commands for basic file operations, unvalidated path handling, or manual escaping logic.
  • Security testing: Use fuzzing or targeted penetration testing to exercise the write_file tool with crafted filenames and paths, observing whether unexpected commands are executed.
  • Runtime monitoring: Monitor logs and process activity for unusual command invocations originating from the GoClaw process, especially commands not expected in normal workflows or containing user-derived values.

Sources

SourceLink
github.comgithub.com/nextlevelbuilder/goclaw/
github.comgithub.com/nextlevelbuilder/goclaw/issues/1121
github.comgithub.com/nextlevelbuilder/goclaw/pull/1155
vuldb.comvuldb.com/cve/CVE-2026-10219
vuldb.comvuldb.com/submit/821939
vuldb.comvuldb.com/vuln/367498
vuldb.comvuldb.com/vuln/367498/cti

Frequently asked

questions

Yes. The description indicates the vulnerability can be triggered remotely when an attacker can send input to the write_file tool interface or any higher-level feature that uses FsBridge.WriteFile.

An attacker needs the ability to control or significantly influence parameters passed into the write_file tool, typically via an exposed API endpoint, web UI, or integration that accepts external input and forwards it to FsBridge.WriteFile.

Replace any shell-based file operations with direct filesystem APIs, or at minimum use parameterized command execution where user input is never concatenated into a shell command string. Pair this with strong validation and whitelisting of paths and file names.

Establish a secure coding policy that forbids dynamic command construction with untrusted input, encourages using native APIs for filesystem and OS operations, and integrates automated checks (static analysis and code review checklists) to detect command injection patterns early in the development lifecycle.

Find out what's already
exploitable in your codebase.