Scan Report
45 /100
token-watchdog
OpenClaw session cost monitor — alerts via Telegram when agent spend exceeds budget
Undeclared shell execution via execSync found in code not mentioned in SKILL.md documentation. The skill claims to 'read .jsonl files directly' but actually executes openclaw CLI commands for alerts and agent control.
Use with caution
Request maintainer to document execSync usage for shell commands. Verify openclaw CLI tool integrity. Consider using HTTP API instead of CLI for Telegram messaging.
Findings 5 items
| Severity | Finding | Location |
|---|---|---|
| High | Undeclared Shell Execution via execSync | token-watchdog.mjs:44 |
| High | Agent Control Function Not Declared | token-watchdog.mjs:56 |
| Medium | Remote Script Download Without Integrity Check | SKILL.md:29 |
| Medium | Undeclared File Write Operations | token-watchdog.mjs:83 |
| Low | Hardcoded Telegram Target ID | token-watchdog.mjs:17 |
| Resource | Declared | Inferred | Status | Evidence |
|---|---|---|---|---|
| Filesystem | READ | READ,WRITE | ✓ Aligned | token-watchdog.mjs:writeFileSync to ~/.openclaw/workspace/memory/ |
| Shell | NONE | WRITE | ✗ Violation | token-watchdog.mjs:44 execSync for openclaw CLI commands |
| Network | READ | READ | ✓ Aligned | Reads session files, sends via openclaw CLI |
2 findings
Medium External URL 外部 URL
https://ddaekeu3-cyber.github.io/synapse-ai/tools/token-watchdog/token-watchdog.mjs SKILL.md:29 Medium External URL 外部 URL
https://ddaekeu3-cyber.github.io/synapse-ai/ SKILL.md:82 File Tree
3 files · 14.6 KB · 420 lines JavaScript 1f · 328L
Markdown 1f · 82L
JSON 1f · 10L
├─
package.json
JSON
├─
SKILL.md
Markdown
└─
token-watchdog.mjs
⚠
JavaScript
Dependencies 2 items
| Package | Version | Source | Known Vulns | Notes |
|---|---|---|---|---|
Node.js built-ins | N/A | builtin | No | Uses only child_process and fs modules |
openclaw CLI | unknown | external | No | CLI tool invoked via execSync - security depends on openclaw tool integrity |
Security Positives
✓ Core functionality (session cost monitoring) appears legitimate and useful
✓ shellEscape() function provides basic protection against command injection
✓ Uses fs sync operations instead of eval() or dynamic code execution
✓ Session file reading is byte-offset based (incremental reads) - efficient approach
✓ State persistence prevents duplicate alerts on restarts