Back to skill

Security audit

抖音评论采集(会话制)

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with Douyin comment collection, but it uses saved/shared credentials over an insecure default connection and can perform paid steps without executable confirmation enforcement.

Review before installing. Use this only if you trust the backend account service and are comfortable with tokens and collected comment data being sent to it. Set a verified HTTPS base URL before logging in if possible, avoid relying on shared or legacy XHS config files, monitor credit use carefully, and treat exported CSVs and local token config as sensitive.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
src/config.js:18
Finding

Bearer Token and Account Data Transmitted over Plaintext HTTP by Default

Content
View full analysis

Vulnerability Details

File Location: src/config.js:18-21, with authenticated transmission in src/client.js:49-76 and cli.js:335-337
Vulnerability Type: Plaintext transmission of authentication credentials
Risk Level: High

Vulnerable Code

javascript
// The service currently lacks a correctly configured HTTPS certificate.
// The default therefore remains HTTP.
const DEFAULT_BASE_URL = 'http://st.aidata366.com';

Authenticated API requests subsequently attach the bearer token:

javascript
res = await fetch(this.baseUrl + '/api/v1' + apiPath, {
  method,
  headers: {
    ...(body ? { 'Content-Type': 'application/json' } : {}),
    ...(this.token ? { Authorization: `Bearer ${this.token}` } : {}),
    ...headers,
  },
  body: body ? JSON.stringify(body) : undefined,
  signal: ctrl.signal,
});

CSV export requests independently use the same plaintext destination and credential:

javascript
const res = await fetch(
  `${cfg.baseUrl}/api/v1/dy/comments/sessions/${encodeURIComponent(sessionId)}/export`,
  { headers: { Authorization: `Bearer ${cfg.token}` }, signal: dlCtrl.signal });

Technical Analysis

The built-in service URL uses HTTP rather than HTTPS. Once a user authenticates, most API operations include a reusable bearer token in the Authorization header. The CSV export path also attaches that token directly.

Although src/client.js prints a warning when a token is sent over HTTP, the warning does not block the request or require explicit consent. HTTP provides neither transport confidentiality nor authenticated server identity. Any party with an on-path network position can inspect the bearer token, observe returned comment data, or modify requests and responses.

This is reachable under the standard documented workflow because users are instructed to register or log in, after which the token is stored and automatically used with the default base URL.

Attack Path

  1. The user registers or logs in, and t ...[truncated 1359 chars]
Remediation
View remediation

Remediation Suggestions

  1. Configure the service with a valid TLS certificate and change DEFAULT_BASE_URL to an HTTPS URL.
  2. Reject authenticated requests to HTTP endpoints by default rather than merely printing a warning.
  3. If private development endpoints must support HTTP, require an explicit per-request unsafe override and clearly distinguish it from production configuration.
  4. Never allow the unsafe HTTP override for the built-in public service endpoint.
  5. Keep TLS certificate verification enabled. Remove or tightly restrict the process-wide NODE_TLS_REJECT_UNAUTHORIZED=0 mechanism.
  6. Rotate tokens that may previously have crossed untrusted networks over HTTP.
  7. Consider short-lived, scoped tokens and server-side revocation controls to reduce the impact of credential interception.
  8. Add tests verifying that requests carrying an Authorization header are rejected unless the effective URL uses validated HTTPS.

T09 · Insecure Skill Coding Practices

Warning
Location
cli.js:254
Finding

Paid Step Operations Do Not Enforce the Required User Confirmation

Content
View full analysis

Vulnerability Details

File Location: cli.js:254-293; the confirmation requirement is documented in SKILL.md:55-73
Vulnerability Type: Missing authorization enforcement for charged operations
Risk Level: Medium

Vulnerable Code

The page collection path performs the charged request immediately:

javascript
data = await client.stepDyCommentSession(sessionId, 'page');

The reply-expansion path behaves the same way:

javascript
data = await client.stepDyCommentSession(sessionId, 'expand', root);

The underlying client directly submits the operation:

javascript
stepDyCommentSession(sessionId, type, rootCid = '') {
  return this.request('POST', `/dy/comments/sessions/${encodeURIComponent(sessionId)}/step`, {
    body: { type, root_cid: rootCid }, timeoutMs: 200000,
  });
}

Technical Analysis

The Skill documentation defines an explicit authorization boundary: the agent must report the estimated price before the first charged step, wait for user confirmation, and obtain further confirmation after every page or reply expansion.

The executable does not enforce this boundary. cmdStep accepts a valid session ID and immediately invokes the charged API operation. It has no confirmation flag, interactive prompt, approval token, maximum-step limit, or proof that the user approved the specific operation and cost.

Messages written to standard error are advisory only and occur as part of the same execution path. They do not prevent an agent, automation script, or direct caller from invoking one or several charged operations without the required approval.

Attack Path

  1. A free start operation creates a valid collection session.
  2. The CLI returns a valid session identifier and estimated page count.
  3. An agent or automated workflow invokes step --session ... --page before receiving the required user approval.
  4. The CLI performs the charged API request because it validates only the session identifier and authenticati ...[truncated 773 chars]
Remediation
View remediation

Remediation Suggestions

  1. Enforce confirmation in the executable rather than relying exclusively on Skill text.
  2. Require an approval artifact bound to:
    • The session identifier.
    • The operation type (page or expand).
    • The root comment identifier where applicable.
    • The exact maximum charge.
    • A short expiration time.
  3. For interactive use, prompt for explicit confirmation immediately before sending the charged request.
  4. For agent and non-interactive use, require a dedicated confirmation parameter containing a server-issued or locally generated approval token. A generic --yes flag alone should not authorize an unlimited sequence of steps.
  5. Make each approval valid for only one charged operation.
  6. Have the server reject charged steps that lack a valid approval artifact if server changes are possible.
  7. Return the exact expected charge before authorization and verify the charge does not exceed the approved amount.
  8. Add automated tests proving that an unconfirmed step request fails without consuming credits.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose focuses on comment collection, but the skill also reads and writes credential/config files, resolves auth and endpoints from local/environment sources, and defaults to a plaintext HTTP backend. This hidden operational behavior materially expands the trust boundary and can expose tokens or route traffic to unsafe endpoints without clear user awareness.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill exposes shell, network, and environment-driven behavior but does not declare an explicit tool scope or permissions boundary. That increases the chance an agent can invoke broader capabilities than users expect, especially since the skill also handles tokens, local files, and remote requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The description says the skill should be used whenever the user mentions phrases like "评论分析" or "评论区舆情", alongside broader wording such as when the user 'needs' comment collection/export/analysis. These phrases are broad and can overlap with ordinary discussion or analysis requests, without clear boundaries or negative examples limiting when the skill should activate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file mandates that the agent send the registration/login guidance '原样发给用户', and the required script is entirely in Chinese. This imposes a specific language on user-facing interaction without opt-in or any stated region-specific justification.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
99% confidence
Finding

The allowInsecureTls function globally sets NODE_TLS_REJECT_UNAUTHORIZED=0, disabling certificate validation for the entire Node.js process. That enables man-in-the-middle interception of HTTPS traffic, including bearer tokens and collected comment data, and can silently affect all subsequent requests made by this process, not just this client.

Content

Scanner excerpt · src/client.js (reported line 17)May include surrounding context.

js
/** 忽略 HTTPS 证书校验 (服务端自签/域名不匹配证书时由 insecure 配置开启)。进程级。 */
function allowInsecureTls() {
  process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
}

/** 业务错误: code 为后端错误码 (1001/1002/3001/...) */

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a skill specifically for stepwise Douyin video comment collection and CSV export, but this client also includes generic '/platform/tasks' and '/platform/exports' methods parameterized by arbitrary capability and items. Those APIs suggest support for broader platform collection jobs not justified by the declared single-purpose Douyin comment workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest scope is Douyin comment acquisition, but the code also implements a parallel 'comments session' API documented as 'xhs_comments v2'. Supporting another platform’s comment collection is a clear semantic expansion beyond what the skill claims to do.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill declares itself as a Douyin comment collection tool, but its configuration is bound to shared xhs-platform/xhs-convert paths and defaults. That creates cross-skill credential and state sharing, which can expose unrelated tokens to this skill and violate least-privilege and user expectations even if done for convenience rather than overtly malicious reasons.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code automatically reads and migrates tokens, base URLs, and insecure transport settings from another skill's legacy configuration without the user explicitly requesting it. In the context of a Douyin comment scraper, that behavior is not justified by the stated purpose and can silently import credentials from an unrelated tool, enabling unintended access, account confusion, or propagation of insecure settings.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file specifies output conventions and error/help text entirely in Chinese, and several emitted messages are hard-coded in Chinese. This can violate a language/locale policy when the skill does not provide user opt-in or document that it is intentionally region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The package description at L05 is entirely in Chinese, which imposes a specific language on users without any visible opt-in or explanation that the skill is intended only for a Chinese-language audience. This matches the policy category for language or locale constraints expressed in natural language.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The header comment says this output contract is aligned to a '转链 skill', which conflicts with the current skill being a Douyin comment collection tool. The error messaging also hardcodes guidance like 'login --link' and generic link-based captcha handling, which does not match the manifest's described step-by-step comment collection workflow.

Content

No source excerpt is available for this finding.