T09 · Insecure Skill Coding Practices
- Location
scripts/wechat-image-loader.ts:33- Finding
Arbitrary URL and Local File Loading Through Image Sources
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This WeChat publishing skill is mostly coherent, but it includes high-impact login, credential, network, and runtime behaviors that need review before use.
Install only if you trust the publisher and the article inputs. Avoid enabling Telegram QR forwarding unless you fully control the bot and chat, do not process untrusted Markdown or image URLs, prefer a preinstalled trusted Bun runtime over `npx -y bun`, and store WeChat AppSecrets in a protected secret store or locked-down local file.
scripts/wechat-image-loader.ts:33Arbitrary URL and Local File Loading Through Image Sources
scripts/wechat-article.ts:189Mutable Registry Package Execution Through Unpinned npx Bootstrap
references/api-setup.md:29Plaintext AppSecret Storage Without Mandatory Permission or Version-Control Protection
scripts/cdp.ts:49Shell Command Injection in WSL Home-Path Conversion
The pattern is a strong match because the skill reads externally supplied credentials from environment variables and uses them to send a WeChat login QR to a webhook-like Telegram endpoint. In an agent skill, exfiltration of authentication artifacts through an undisclosed outbound channel is highly dangerous and consistent with credential harvesting behavior.
tions {
title: string;
content?: string;
htmlFile?: string;
markdownFile?: string;
theme?: string;
color?: string;
citeStatus?: boolean;
author?: string;
summary?: string;
images?: string[];
contentImages?: ImageInfo[];
submit?: boolean;
profileDir?: string;
cdpPort?: number;
}
async function sendQrToTelegram(session: ChromeSession): Promise<void> {
const botToken = process.env.TELEGRAM_BOT_TOKEN;
const chatId = process.env.TELEGRAM_CHAT_ID;
if (!botToken || !chatId) return;
// Wait for QR to render before extracting
await sleep(2000);
try {
// Try to extract QR image from DOM first (avoids full-page screenshot noise)
const domResult = await session.cdp.send<{ result: { value: string } }>('Runtime.evaluate', {
expression: `
(function() {
const selectors = [
'.login__type__container__scan img',
'.login_img img',
'#login_container img',
'.qrcode img',
'im
The troubleshooting section says a WeChat login QR image can be sent to Telegram using TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. Forwarding authentication QR codes to a third-party service is an external transmission of a login artifact that could let anyone with Telegram access hijack the WeChat session.
The troubleshooting section says a WeChat login QR image can be sent to Telegram using TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. Forwarding authentication QR codes to a third-party service is an external transmission of a login artifact that could let anyone with Telegram access hijack the WeChat session.
The troubleshooting section says a WeChat login QR image can be sent to Telegram using TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. Forwarding authentication QR codes to a third-party service is an external transmission of a login artifact that could let anyone with Telegram access hijack the WeChat session.
The troubleshooting section says a WeChat login QR image can be sent to Telegram using TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. Forwarding authentication QR codes to a third-party service is an external transmission of a login artifact that could let anyone with Telegram access hijack the WeChat session.
The troubleshooting section says a WeChat login QR image can be sent to Telegram using TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. Forwarding authentication QR codes to a third-party service is an external transmission of a login artifact that could let anyone with Telegram access hijack the WeChat session.
The troubleshooting section says a WeChat login QR image can be sent to Telegram using TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. Forwarding authentication QR codes to a third-party service is an external transmission of a login artifact that could let anyone with Telegram access hijack the WeChat session.
The troubleshooting section says a WeChat login QR image can be sent to Telegram using TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. Forwarding authentication QR codes to a third-party service is an external transmission of a login artifact that could let anyone with Telegram access hijack the WeChat session.
The troubleshooting section says a WeChat login QR image can be sent to Telegram using TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. Forwarding authentication QR codes to a third-party service is an external transmission of a login artifact that could let anyone with Telegram access hijack the WeChat session.
The troubleshooting section says a WeChat login QR image can be sent to Telegram using TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. Forwarding authentication QR codes to a third-party service is an external transmission of a login artifact that could let anyone with Telegram access hijack the WeChat session.
Referenced artifact was not completely inspected
| `scripts/wechat-article.ts` | Article posting via browser (文章) |
Referenced artifact was not completely inspected
| `scripts/wechat-api.ts` | Article posting via API (文章) |
Referenced artifact was not completely inspected
| `scripts/md-to-wechat.ts` | Markdown → WeChat-ready HTML with image placeholders |
Referenced artifact was not completely inspected
| `scripts/check-permissions.ts` | Verify environment & permissions |
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# remote_publish_host: server.example.com
# remote_publish_user: deploy
# remote_publish_port: 22
# remote_publish_identity_file: ~/.ssh/id_ed25519
# remote_publish_known_hosts_file: ~/.ssh/known_hosts
# remote_publish_strict_host_key_checking: accept-new
# remote_publish_connect_timeout: 10
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# remote_publish_user: deploy
# remote_publish_port: 22
# remote_publish_identity_file: ~/.ssh/id_ed25519
# remote_publish_known_hosts_file: ~/.ssh/known_hosts
# remote_publish_strict_host_key_checking: accept-new
# remote_publish_connect_timeout: 10
# remote_publish_proxy_jump: bastion.example.com
The skill workflow includes guided setup and use of API credentials and access tokens, which are sensitive secrets, but the permissions model is not narrowly declared and storage is only loosely described as .baoyu-skills/.env. In this context, credential handling is high impact because compromise would allow unauthorized publication or account abuse.
| Issue | Fix |
|-------|-----|
| Missing API credentials | Follow guided setup in Step 2 |
| Access token error | Verify credentials valid and not expired |
| Not logged in (browser) | First run opens browser — scan QR to log in. Set `TELEGRAM_BOT_TOKEN` + `TELEGRAM_CHAT_ID` to receive the QR image via Telegram |
| Chrome not found | Set `WECHAT_BROWSER_CHROME_PATH` |
| Title/summary missing | Use auto-generation or provide manually |
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Where to save? A) Project-level: .baoyu-skills/.env (this project only) B) User-level: ~/.baoyu-skills/.env (all projects)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Where to save? A) Project-level: .baoyu-skills/.env (this project only) B) User-level: ~/.baoyu-skills/.env (all projects)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Where to save? A) Project-level: .baoyu-skills/.env (this project only) B) User-level: ~/.baoyu-skills/.env (all projects)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
3. Copy AppID and AppSecret
Where to save?
A) Project-level: .baoyu-skills/.env (this project only)
B) User-level: ~/.baoyu-skills/.env (all projects)
```
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
3. Copy AppID and AppSecret
Where to save?
A) Project-level: .baoyu-skills/.env (this project only)
B) User-level: ~/.baoyu-skills/.env (all projects)
```
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
3. Copy AppID and AppSecret
Where to save?
A) Project-level: .baoyu-skills/.env (this project only)
B) User-level: ~/.baoyu-skills/.env (all projects)
```
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
3. Copy AppID and AppSecret
Where to save?
A) Project-level: .baoyu-skills/.env (this project only)
B) User-level: ~/.baoyu-skills/.env (all projects)
```
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
3. Copy AppID and AppSecret
Where to save?
A) Project-level: .baoyu-skills/.env (this project only)
B) User-level: ~/.baoyu-skills/.env (all projects)
```
Detected: suspicious.dangerous_exec, suspicious.env_credential_access