| Version | Supported |
|---|---|
| 0.1.x | ✅ |
If you discover a security vulnerability, please send an email to the maintainer. All security vulnerabilities will be promptly addressed.
ElixirClaw is a node client for OpenClaw Gateway. The primary security concerns are:
- Command Injection - Malicious commands injected through
system.run - Path Traversal - Access to unauthorized files via path manipulation
- Denial of Service - Resource exhaustion via large messages
- Unauthorized Access - Gateway connection without proper authentication
All system commands are sanitized before execution:
# Sanitize command argumentsdefpsanitize_command_args(args)whenis_list(args)domax_args=50max_arg_length=10000iflength(args)>max_argsdo{:error,:too_many_args}elsesanitized=Enum.map(args,&to_string/1)sanitized=Enum.map(sanitized,&sanitize_single_arg/1)sanitized=Enum.take(sanitized,max_args)sanitized=Enum.map(sanitized,fnarg->String.slice(arg,0,max_arg_length)end){:ok,sanitized}endend- Maximum 50 arguments per command
- Maximum 10000 characters per argument
- Control characters stripped
- Whitespace trimmed
Notification arguments are escaped to prevent shell injection:
defpsanitize_shell_arg(arg)whenis_binary(arg)doarg|>String.replace("\\","\\\\")# Escape backslashes|>String.replace("\"","\\\"")# Escape quotes|>String.slice(0,1000)# Limit lengthendCamera devices are validated before use:
defpvalidate_device(device)whenis_binary(device)dosafe = device |> String.replace(~r/[^a-zA-Z0-9_\-\.\/], "", global: true) |> String.slice(0, 255)
if safe == device or safe == "", do: {:ok, safe}, else: {:error, :invalid_device}
end- Only alphanumeric characters, underscores, hyphens, dots, and slashes allowed
- Maximum 255 characters
Protocol messages are limited to prevent DoS:
@max_message_size1_000_000# 1MB limitAll node operations require explicit capability grants:
defpcheck_cap(cap)doconfig=Application.get_all_env(:elixir_claw)||%{}allowed=config[:caps]||[]ifcapinallowed||allowed==:alldo{:ok,cap}else{:error,:capability_not_allowed}endendSystem commands can be restricted to an allowlist:
defpvalidate_command(cmd)whenis_binary(cmd)andbyte_size(cmd)>0doconfig=Application.get_all_env(:elixir_claw)||%{}allowed=config[:allowed_commands]||[]allowed_commands=[:all|allowed]if:allinallowed_commands||cmdinallowed_commandsdo{:ok,cmd}else{:error,:command_not_allowed}endendAll gateway connections use TLS:
defpconnect_gateway(host,port,token)do# TLS connection with certificate verificationendRestrict Capabilities
config:elixir_claw,caps: ["camera.snap","screen.snap"],# Only allow what's neededallowed_commands: ["echo","date"]# Whitelist specific commands
Enable TLS Verification
config:elixir_claw,verify_ssl: true
Set Resource Limits
config:elixir_claw,max_command_timeout: 30_000,# 30 seconds maxmax_message_size: 1_000_000# 1MB max
- v0.1.0 (2026-02-19)
- Fixed command injection vulnerability in
system.run - Added input sanitization for all user-controlled inputs
- Implemented capability-based access control
- Added message size limits
- Fixed command injection vulnerability in
For security issues, please contact the maintainer directly.