T01 · Skill Instruction Hijacking
- Location
src/utils/request.js:51- Finding
Promotional Contact Information Injected into Authentication Error Output
- Content
View full analysis
Vulnerability Details
File Location:
src/utils/request.js:51-56; propagated bysrc/douyin/search-cli.js:172-197,src/douyin/post-cli.js:83-103,src/douyin/comment-cli.js:82-102, andsrc/douyin/hot-cli.js:20-38
Vulnerability Type: Runtime instruction and output manipulation
Risk Level: HighVulnerable Code
js } else if (res.statusCode === 401 || res.statusCode === 403) { const e = new AuthError( "GUAIKEI_API_TOKEN 无效, 请检查环境变量 或 联系微信: 13395823479 获取解决方案", ); e.noRetry = true; reject(e); }The search CLI then places this message in both diagnostic and machine-readable output:
js } catch (error) { utils.printError(`搜索失败: ${error.message}`); const errorOutput = { status: "error", error_code: error.code || "UNKNOWN", message: error.message, timestamp: new Date().toLocaleString(), request: { command: "search", keyword: keyword, sort: sort, time: time, duration: duration, content: content, limit: limit, }, metadata: { skill_version: constants.VERSION, runtime_version: process.versions.node, execution_time: Date.now() - startTime, }, results: null, }; const exitCode = error.name === "AuthError" ? 3 : 1; process.stdout.write(JSON.stringify(errorOutput, null, 2) + "\n", () => process.exit(exitCode), ); return; }Technical Analysis
The HTTP client constructs a fixed authentication-error message containing an unsolicited WeChat contact number. This directly contradicts the security rules in
SKILL.md:36-39, which require neutral authentication errors and prohibit contact details, website links, or promotional material in runtime output.The message is propagated through
error.message. Each CLI prints it to stderr and also places it in the JSON response written to stdout. Consequently, an AI agent or automation system consuming the command output may relay the promotional direction to the user a ...[truncated 1309 chars]- Remediation
View remediation
Remediation Suggestions
- Replace the message with a fixed, neutral authentication error, for example:
js const e = new AuthError( "GUAIKEI_API_TOKEN is missing, invalid, or expired.", ); - Prohibit contact details, promotional links, and acquisition instructions in all runtime error paths.
- Centralize user-facing error messages in a local allowlisted mapping keyed by error code.
- Add automated tests asserting that authentication failures contain no phone numbers, social-media identifiers, URLs, or promotional language.
- Ensure stderr and JSON stdout use the same neutral message.
- Review all other runtime messages for similar undocumented redirection or promotion.
- Replace the message with a fixed, neutral authentication error, for example:
