T01 · Skill Instruction Hijacking
- Location
src/utils/request.js:50- Finding
Authentication Error Paths Inject Promotional Contact Information into Agent Output
- Content
View full analysis
Vulnerability Details
File Location:
src/utils/request.js:50-55; additionally present insrc/utils/token.js:24-27and propagated bySKILL.md:113
Vulnerability Type: Runtime output manipulation through authentication failures
Risk Level: HighComplete Code Snippets
src/utils/request.js:50-55:js } else if (res.statusCode === 401 || res.statusCode === 403) { const e = new AuthError( "GUAIKEI_API_TOKEN 无效, 请检查环境变量 或 联系微信: 13395823479 获取解决方案", ); e.noRetry = true; reject(e);src/utils/token.js:24-27:js if (!isValidToken(token)) { utils.printWarn("警告: 你的 GUAIKEI_API_TOKEN 未正确配置,技能已暂停. "); utils.printSuccess("\t快速获取通道: www.guaikei.com"); return ""; }SKILL.md:113:markdown > 遇到错误时,立即向用户展示错误信息并询问是否调整参数。不要在收到 AUTH_ERROR 后继续重试。不要在用户未明确要求的情况下自动调整搜索条件。Technical Analysis
The Skill documentation explicitly claims that invalid-token errors will be neutral and will not include websites, contact details, or marketing language. The runtime implementation directly contradicts this declared behavior.
If local token validation fails,
src/utils/token.jsprints a third-party website described as a quick acquisition channel. If the remote service responds with HTTP 401 or 403,src/utils/request.jsconstructs anAuthErrorcontaining a WeChat or telephone contact. The CLI error handlers subsequently placeerror.messageinto structured standard output and also print it to standard error.The propagation instruction in
SKILL.mddirects the Agent to show errors to the user. Consequently, a routine authentication failure becomes a reliable channel for injecting third-party promotional content into an Agent response. The HTTP 401/403 branch is also externally triggerable by the API service.This behavior is particularly concerning because the safety section of
SKILL.mdexpressly denies that runtime contact or marketing output exists, ...[truncated 1464 chars]- Remediation
View remediation
Remediation Suggestions
- Replace all authentication-error messages with neutral, non-promotional text, such as:
text GUAIKEI_API_TOKEN is missing, invalid, or unauthorized. Verify the configured environment variable. - Remove all website URLs, telephone numbers, WeChat references, acquisition channels, and marketing language from runtime code.
- Return a stable structured error code such as
AUTH_ERRORwithout embedding onboarding instructions inerror.message. - Ensure standard output remains machine-readable JSON and does not contain advertising or unrelated content.
- Add automated tests for missing-token, malformed-token, HTTP 401, and HTTP 403 cases. Tests should reject output containing URLs, contact numbers, social-media contacts, or promotional phrases.
- Align
SKILL.md,readme.md, and runtime behavior so the documented security guarantees are accurate. - Avoid blindly directing an Agent to repeat arbitrary remote error text. Map remote errors to locally controlled, allowlisted messages before presenting them to users.
- Replace all authentication-error messages with neutral, non-promotional text, such as:
