T09 · Insecure Skill Coding Practices
- Location
scripts/gateway-qr.sh:81- Finding
Arbitrary Python Code Execution Through Unescaped Configuration Values
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill does what it claims, but it handles a live gateway login token too loosely and includes a script injection flaw that should be reviewed before installation.
Install only if you are comfortable with a skill reading your OpenClaw Gateway auth token. Treat any generated QR image or terminal QR as a password, avoid running it in logged or shared terminals, delete ~/.openclaw/media/clawket-qr.png after pairing, and rotate the Gateway token if the payload has been exposed. The script should be fixed to avoid printing the token, set restrictive file permissions, clean up the QR, and pass config values to Python as data rather than source code.
scripts/gateway-qr.sh:81Arbitrary Python Code Execution Through Unescaped Configuration Values
scripts/gateway-qr.sh:91Gateway Authentication Token Disclosed Through Terminal Output
scripts/gateway-qr.sh:7Persistent Token-Bearing QR File Created Without Explicit Access Controls
This skill explicitly generates and sends a QR code containing a live Gateway auth token, but it provides no warning that the PNG and terminal-rendered QR are effectively bearer credentials. A user could forward, screenshot, store, or display the code insecurely, allowing anyone who scans it to authenticate to the local OpenClaw Gateway.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
## Troubleshooting
- If `qrencode` is not installed: `brew install qrencode` (macOS) / `sudo apt install qrencode` (Linux) / `choco install qrencode` (Windows)
- If the LAN IP detection fails, the script falls back to `127.0.0.1`
- The token is read directly from the JSON config file (not via `openclaw config get` which redacts it)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
## Troubleshooting
- If `qrencode` is not installed: `brew install qrencode` (macOS) / `sudo apt install qrencode` (Linux) / `choco install qrencode` (Windows)
- If the LAN IP detection fails, the script falls back to `127.0.0.1`
- The token is read directly from the JSON config file (not via `openclaw config get` which redacts it)
The script prints the full QR payload to the terminal, and that payload contains the gateway authentication token. Anyone with terminal visibility, shell history capture, screen recording, logging, or shoulder-surfing access can recover the token and authenticate to the local gateway, which exceeds the stated need of simply generating a QR code.
The terminal output discloses a sensitive bearer-style token without warning or minimization, creating an unnecessary secret exposure channel. In practice, terminals are often logged, copied into support chats, or visible to other local users, so disclosure can lead to unauthorized mobile pairing or gateway access.
No suspicious patterns detected.