Summary
OpenClaw before 2026.3.11 contains an approval integrity flaw where system.run approvals do not correctly bind mutable file operands for certain script runners such as tsx and jiti.
An attacker can obtain approval for benign script commands, then rewrite the referenced script files on disk and have the modified code execute under the previously approved run context.
Affected context
This vulnerability appears in OpenClaw deployments that:
- Use system.run to execute scripts through runners like tsx or jiti
- Rely on an approval flow that records high-level commands or entry points, but not immutable versions of the underlying script content
- Allow scripts or their dependencies to remain writable after approval is granted
In such setups, the authorization decision is tied to a script path or command rather than the exact code image that was reviewed and approved.
Exploit preconditions
- Attack surface: The system.run approval and execution pipeline in OpenClaw
- Required access: Ability to submit jobs or requests for approval, and write access to the underlying script files or their directories
- Trigger point: Execution of a previously approved system.run command where the script file has been altered after approval
- Why exploitation is possible: The approval mechanism does not bind the authorization decision to a specific, immutable version of the script. For certain runners, it authorizes a path or invocation instead of the exact file content or digest, allowing code changes post-approval without revalidation.
Why this happens
The root cause is a broken authorization design where approvals are not tightly coupled to the exact resource state they are intended to govern.
Instead of tying approval to an immutable artifact (e.g., content hash, locked version, or read-only file), the system.run workflow approves an invocation that depends on mutable script files for tsx, jiti, and similar runners.
This aligns with CWE-863: Incorrect Authorization, because the system authorizes subsequent executions based on an earlier decision that assumed the script remained unchanged, failing to re-check authorization when the underlying operands are modified.
Potential impact
- Execution of modified, unreviewed scripts under a previously approved context
- Privilege escalation if approved runs use elevated permissions or sensitive environments
- Bypass of change control and code review processes for production scripts
- Introduction of backdoors, data exfiltration logic, or malicious behavior into trusted automation
- Undermining of audit trails, as logs may show an approved command while different code actually ran
General mitigation guidance
Effective mitigation focuses on binding approvals to immutable code and tightening authorization boundaries:
- Associate approvals with content-addressed artifacts (e.g., cryptographic hashes, signed bundles, or versioned images) rather than file paths or generic commands.
- Enforce read-only or locked-down permissions on scripts after they are approved so they cannot be altered without re-approval.
- Require re-approval whenever the script content, hash, or version changes, and surface this clearly in the approval UI or workflow.
- Separate roles for who can modify scripts and who can approve executions, reducing the risk that a single actor can both change and run unreviewed code.
- Design system.run policies that explicitly constrain which runners, directories, and projects are eligible for high-privilege approvals, favoring least-privilege execution contexts.
How teams detect issues like this
Detection strategies should aim to surface authorization gaps and post-approval changes:
- Implement monitoring or hooks that compute and log content hashes of scripts at approval time and at execution time, flagging mismatches.
- Use file integrity monitoring on directories containing approved scripts to alert on modifications after approval.
- During code review, look for approval workflows that reference mutable paths or patterns instead of immutable artifacts and versions.
- Apply policy-as-code or security gate checks in CI/CD to ensure that approved executions are only allowed on artifacts produced by the pipeline, not arbitrary filesystem paths.
- Apply static or configuration analysis tools to identify usages of system.run that do not specify fixed versions, content digests, or read-only locations, and to enforce organizational policies around approvals and execution.

