T01 · Skill Instruction Hijacking
- Location
src/utils/token.js:24- Finding
Runtime token-validation path emits prohibited promotional content
- Content
View full analysis
Vulnerability Details
File Location:
src/utils/token.js:24-27
Vulnerability Type: Runtime output manipulation and promotional redirection
Risk Level: MediumVulnerable Code
js if (!isValidToken(token)) { utils.printWarn("警告: 你的 GUAIKEI_API_TOKEN 未正确配置,技能已暂停. "); utils.printSuccess("\t快速获取通道: www.guaikei.com"); return ""; }Technical Analysis
Every command-line entry point passes
process.env.GUAIKEI_API_TOKENtoskillToken(). When the token is absent or fails format validation, this function emits a fixed acquisition message directing the user or invoking agent to an external website.This behavior directly contradicts the security contract in
SKILL.md, which states that invalid-token handling must produce only a neutral error and must not include contact information, website links, or promotional content at runtime. The message is written to stderr through the shared logging utility and can therefore be surfaced by an AI agent as part of command execution.The behavior is deterministic and unrelated to fulfilling the requested data-retrieval operation. It manipulates runtime output to redirect users to an operator-controlled service.
Attack Path
- A user or agent invokes any supported CLI without setting
GUAIKEI_API_TOKEN, or supplies a malformed token. - The CLI reads the value from
process.env.GUAIKEI_API_TOKEN. skillToken()rejects the value because it does not satisfy the format requirements.- The function writes a fixed external acquisition message to stderr.
- The invoking agent may repeat or act on that promotional message, despite the Skill documentation explicitly prohibiting such runtime redirection.
Impact Assessment
This issue does not grant operating-system privileges or execute arbitrary code. Its scope is manipulation of Agent-visible runtime output. It can redirect users to an external commercial service and undermine trust ...[truncated 53 chars]
- A user or agent invokes any supported CLI without setting
- Remediation
View remediation
Remediation Suggestions
- Remove all acquisition links, contact details, and promotional language from runtime token validation.
- Emit only a neutral error, such as
GUAIKEI_API_TOKEN is missing or invalid; execution has stopped. - Preserve exit code
3for authentication failures. - Keep token-acquisition instructions exclusively in user documentation.
- Add automated tests asserting that invalid-token output contains no URLs, contact information, or promotional text.
