T09 · Insecure Skill Coding Practices
- Location
scripts/apply-patches.sh:145- Finding
JavaScript Source Injection Through Unescaped Environment Variables
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill openly patches a local Lark plugin, but its auto-apply script makes persistent installed-code changes and unsafely embeds environment values into JavaScript source.
Review the patch script before installing, run it only from a clean environment, set BOT_OPEN_ID and BOT_NAME to simple expected values, and keep a backup or versioned copy of the claw-lark dist files so the plugin can be restored if the patch breaks or captures unsafe input.
scripts/apply-patches.sh:145JavaScript Source Injection Through Unescaped Environment Variables
The skill includes operational steps that rely on environment variables such as BOT_OPEN_ID and BOT_NAME, but it declares no explicit tool scope or permissions metadata. That mismatch is risky because it obscures the skill's runtime assumptions and can lead an agent or operator to expose environment data or execute the skill with broader capabilities than intended.
The skill tells the user to run an auto-apply shell script immediately, while the document itself states that it patches compiled plugin dist files directly. Encouraging execution of a modification script without an inline warning, review guidance, backup steps, or integrity checks is dangerous because it can cause silent code changes in production-facing plugin files and normalize running unreviewed scripts.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
- ✅ Exact match `m.id.open_id === BOT_OPEN_ID`
### Thread Reply
- ❌ `client.im.message.create()` + `root_id` → only associates, doesn't create thread
- ❌ `thread_id` as `receive_id` → 400 error
- ✅ `client.im.message.reply()` + `reply_in_thread: true` → creates thread
Line L26 specifies the bot name in Chinese without any indication that language choice is configurable or user-selected. This can violate language/locale policy expectations when a skill implicitly fixes output or identity to a specific language without opt-in.