-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
Security: Insecure Default Tool Policies, Privilege Escalation, and Windows Command Injection #16323
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
securitySecurity documentationSecurity documentationstaleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Description
A deep security audit of the OpenClaw codebase revealed several vulnerabilities that could lead to Remote Code Execution (RCE), Privilege Escalation, and Command Injection, particularly on Windows systems.
Identified Vulnerabilities
-
Insecure Default Tool Policies (Critical)
- Issue: The system defaults to allowing all tools (including
exec) if no specific policy is defined for a user or group. - Impact: Untrusted users on messaging platforms could execute arbitrary commands if the operator hasn't explicitly configured a restrictive policy.
- Issue: The system defaults to allowing all tools (including
-
Privilege Escalation via Session Directives (High)
- Issue: Directives like
/exec host=gatewaywere being parsed and persisted in the session state even if the sender was not authorized to execute them. - Impact: Unauthorized users could potentially influence the execution environment of subsequent legitimate commands.
- Issue: Directives like
-
Command Injection on Windows (High)
- Issue: The
runCommandWithTimeoutfunction usedshell: trueimplicitly for non-executable files on Windows. - Impact: Attackers could inject shell metacharacters into command arguments, leading to arbitrary command execution on the host Windows machine.
- Issue: The
-
Insecure Trusted Proxy Configuration (Medium)
- Issue: Using
auth.mode = 'trusted-proxy'without definingtrustedProxiesallows any client to spoof identity headers. - Impact: Identity theft and unauthorized access to the Gateway.
- Issue: Using
Proposed Fixes
The fixes for these issues have been implemented in Pull Request #16320.
- Changed default tool policy to "Deny-All".
- Explicitly clear unauthorized directives during parsing.
- Disabled implicit shell on Windows and used
cmd.exe /cspecifically for batch files with verbatim arguments. - Added audit checks for trusted-proxy misconfigurations.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
securitySecurity documentationSecurity documentationstaleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.