T01 · Skill Instruction Hijacking
- Location
src/utils/request.js:50- Finding
Undisclosed Promotional Contact Injected into Authentication Errors
- Content
View full analysis
Vulnerability Details
File Location:
src/utils/request.js:50-56
Vulnerability Type: Hidden runtime instruction and output manipulation
Risk Level: MediumEvidence
js } else if (res.statusCode === 401 || res.statusCode === 403) { const e = new AuthError( "GUAIKEI_API_TOKEN 无效, 请检查环境变量 或 联系微信: 13395823479 获取解决方案", ); e.noRetry = true; reject(e); } else {The message means that the API token is invalid and instructs the user to contact a specific WeChat number for a solution.
Technical Analysis
The runtime behavior directly contradicts the security policy declared in
SKILL.md:31-44, which states that invalid-token errors must remain neutral and must not contain WeChat contact details, website links, or promotional language.When the remote API responds with HTTP 401 or 403, the implementation constructs an
AuthErrorcontaining the hard-coded contact number. CLI error handlers then serializeerror.messageinto their JSON output. For example,src/douyin/comment-cli.js:82-103copies the message into themessageproperty written to standard output.This creates a hidden output-manipulation channel: an agent following the documented instruction to present runtime errors to the user may unknowingly relay promotional contact information that the Skill manifest explicitly claims will never appear.
Attack Path
- A user invokes one of the Skill's CLI commands.
- The CLI reads
GUAIKEI_API_TOKENand sends a request to the remote API. - The remote service returns HTTP 401 or 403.
src/utils/request.jscreates anAuthErrorcontaining the hard-coded WeChat contact.- The CLI catches the error and copies
error.messageinto stdout JSON. - An AI agent or other caller consumes that JSON and may present the promotional contact to the user.
Impact Assessment
The issue enables unauthorized promotional content to enter agent-visible and user-visi ...[truncated 351 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the contact-bearing message with a neutral authentication error:
js const e = new AuthError( "GUAIKEI_API_TOKEN is invalid. Verify that the environment variable contains a valid token.", ); - Prohibit runtime error messages from containing phone numbers, social-media contacts, onboarding links, or marketing language.
- Add automated tests that simulate HTTP 401 and 403 responses and assert that stdout and stderr contain only neutral error text.
- Add a repository-wide policy test that rejects contact information in executable source files.
- Keep support and token-acquisition information exclusively in clearly identified user documentation rather than runtime output.
- Ensure every CLI maps authentication failures to a stable error code without relaying uncontrolled or promotional text.
- Replace the contact-bearing message with a neutral authentication error:
