T09 · Insecure Skill Coding Practices
- Location
SKILL.md:47- Finding
Mattermost bearer token exposed through command-line arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does the advertised WhatsApp QR-linking job, but it also uses a stored Mattermost bearer token and direct API calls to post the QR in threads, which deserves manual review before installation.
Install only if you are comfortable letting this skill initiate a WhatsApp device-linking session after confirmation and, in Mattermost threads, read a local OpenClaw config token to upload and post the QR. Prefer a brokered or scoped messaging tool over raw bearer-token curl commands, and rotate or narrowly scope the Mattermost token if this workflow is used.
SKILL.md:47Mattermost bearer token exposed through command-line arguments
scripts/qr_decode.py:58Unbounded QR dimensions allow local memory-exhaustion denial of service
The description understates the operational behavior: the skill does more than passive QR generation by initiating a WhatsApp linking flow and directing the agent to perform time-sensitive actions immediately. This mismatch can mislead reviewers and users about what the skill actually does, reducing informed consent and increasing the chance of unintended account-linking operations.
The description understates the operational behavior: the skill does more than passive QR generation by initiating a WhatsApp linking flow and directing the agent to perform time-sensitive actions immediately. This mismatch can mislead reviewers and users about what the skill actually does, reducing informed consent and increasing the chance of unintended account-linking operations.
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
SHIRKA_TOKEN=$(python3 -c "import json; print(json.load(open('/root/.openclaw/openclaw.json'))['env']['vars']['JENTIC_MM_SHIRKA_TOKEN'])")
# 1. Upload the file
FILE_ID=$(curl -s -X POST "https://mattermost.claw.jentic.ai/api/v4/files" \
-H "Authorization: Bearer $SHIRKA_TOKEN" \
-F "channel_id=CHANNEL_ID" \
-F "files=@/tmp/whatsapp_qr.png;filename=whatsapp_qr.png" \
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
master_fd, slave_fd = pty.openpty()
os.set_inheritable(slave_fd, True)
env = os.environ.copy()
env['COLUMNS'] = '120'
env['TERM'] = 'xterm-256color'
The skill invokes shell commands, writes files under /tmp, and reads environment-backed configuration, but it declares no explicit tool scope or permissions boundary. That increases the chance the skill is executed with broader-than-necessary capabilities and makes review, enforcement, and least-privilege controls harder.
The activation text is broad enough to match generic WhatsApp help requests, not just explicit requests to generate or scan a linking QR. In context, this is more dangerous because the skill initiates an account-linking workflow tied to a short-lived credential artifact, so accidental invocation could start a sensitive linking session the user did not clearly request.
The skill instructs the agent to read a bearer token from a local OpenClaw config file and use it for API calls. Accessing local credentials for a secondary delivery path expands the trust boundary significantly; if the skill is misused, modified, or triggered inappropriately, it can abuse stored credentials to act on Mattermost beyond the core QR-generation purpose.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
| python3 -c "import json,sys; r=json.load(sys.stdin); print(r['file_infos'][0]['id'])")
# 2. Post into the thread
curl -s -X POST "https://mattermost.claw.jentic.ai/api/v4/posts" \
-H "Authorization: Bearer $SHIRKA_TOKEN" \
-H "Content-Type: application/json" \
-d "{
The script invokes python3 and a sibling script using a relative interpreter/binary lookup and accepts a user-controlled output_path. While arguments are passed safely without a shell, this still creates execution-trust and file-write risk: a hijacked PATH could run an unexpected interpreter, and the helper script can write to arbitrary filesystem locations supplied by the caller.
f.write('\n'.join(lines))
tmpfile = f.name
try:
r = subprocess.run(
['python3', decoder, tmpfile, output_path,
'--scale', str(scale), '--quiet', str(quiet)],
capture_output=True, text=True
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
env['COLUMNS'] = '120'
env['TERM'] = 'xterm-256color'
proc = subprocess.Popen(
['openclaw', 'channels', 'login', '--channel', 'whatsapp'],
stdin=slave_fd, stdout=slave_fd, stderr=slave_fd,
close_fds=True, env=env