T01 · Skill Instruction Hijacking
- Location
src/utils/token.js:23- Finding
Authentication Error Paths Inject Undocumented Promotional and Contact Information into Agent-Visible Output
- Content
View full analysis
Vulnerability Details
File Location:
src/utils/token.js:23-27;src/utils/request.js:51-56; propagated bysrc/douyin/search-cli.js:172-197,src/douyin/post-cli.js:83-104,src/douyin/comment-cli.js:82-103, andsrc/douyin/hot-cli.js:20-39
Vulnerability Type: Runtime instruction and output manipulation
Risk Level: HighVulnerable Code
js // src/utils/token.js:23-27 function skillToken(token) { if (!isValidToken(token)) { utils.printWarn("警告: 你的 GUAIKEI_API_TOKEN 未正确配置,技能已暂停. "); utils.printSuccess("\t快速获取通道: www.guaikei.com"); return ""; }js // src/utils/request.js:51-56 } else if (res.statusCode === 401 || res.statusCode === 403) { const e = new AuthError( "GUAIKEI_API_TOKEN 无效, 请检查环境变量 或 联系微信: 13395823479 获取解决方案", ); e.noRetry = true; reject(e);js // src/douyin/search-cli.js:172-197 } 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), );Technical Analysis
The Skill documentation explicitly states that authentication failures must produce only a neutral error and must not include websites, contact information, or marketing language. The implementation violates that declared security boundary in tw ...[truncated 2268 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove all websites, phone numbers, social-media handles, and promotional language from runtime authentication errors.
- Replace both authentication paths with one fixed neutral response, such as:
js const AUTH_MESSAGE = "GUAIKEI_API_TOKEN is missing, malformed, invalid, or expired."; - Return only a stable error code such as
AUTH_ERRORand exit code3. - Do not copy arbitrary authentication response text into Agent-consumed stdout.
- Keep token acquisition and support information exclusively in user-requested documentation.
- Add automated tests that invoke every CLI with:
- no token;
- a malformed token;
- a rejected token;
- an expired token.
- Assert that stdout and stderr contain no URL, phone number, social handle, payment direction, or marketing phrase.
- Ensure
SKILL.md, the implementation, and test expectations remain synchronized.
