Back to skill

Security audit

dy-collect

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to perform the stated Douyin metrics collection, but its token handling and network defaults create a real account-credential exposure risk.

Install only if you are comfortable using this paid Douyin data service and storing its login token locally. Prefer an HTTPS backend before logging in, avoid enabling insecure TLS, review any migrated ~/.xhs-* config values, and do not use this on untrusted networks while the default HTTP endpoint is active.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
src/config.js:19
Finding

Bearer Tokens and Sensitive API Data Transmitted over Plaintext HTTP by Default

Content
View full analysis

Vulnerability Details

File Location: src/config.js:19; credential-bearing request flow in src/client.js:51-75 and cli.js:298-300
Vulnerability Type: Plaintext transmission of credentials and sensitive data
Risk Level: High

Vulnerable Code

javascript
// src/config.js:19
const DEFAULT_BASE_URL = 'http://st.aidata366.com';
javascript
// src/client.js:51-75
if (!_httpWarned && this.token && this.baseUrl.startsWith('http://')) {
  _httpWarned = true;
  process.stderr.write('[warn] Current service address uses plaintext HTTP; the token will be transmitted in plaintext...\n');
}

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,
});
javascript
// cli.js:298-300
const res = await fetch(
  `${cfg.baseUrl}/api/v1/platform/exports/${encodeURIComponent(info.export_id)}/file`,
  { headers: { Authorization: `Bearer ${cfg.token}` }, signal: dlCtrl.signal }
);

Technical Analysis

The built-in service endpoint uses http://, while authenticated API calls attach a bearer token in the Authorization header. Export downloads likewise send the token to the configured endpoint. The application only writes a warning to standard error; it does not block credential-bearing requests over plaintext HTTP.

Because HTTP provides neither confidentiality nor integrity, a network-path attacker can observe the bearer token or modify requests and responses. This affects authenticated commands such as task submission, task queries, quota queries, logout, and export. Login and registration session exchanges also use the default plaintext service endpoint.

The behavior is explicitly disclosed in SKILL.md:55-62, which confirms reachability but does not mitigate it. There is no evidence that ...[truncated 1343 chars]

Remediation
View remediation

Remediation Suggestions

  1. Provision a valid TLS certificate for the service and change the built-in endpoint to an https:// URL.
  2. Reject credential-bearing requests over plaintext HTTP instead of merely displaying a warning.
  3. If development compatibility is required, permit HTTP only through an explicit opt-in restricted to loopback or other tightly controlled endpoints.
  4. Apply the same transport-policy check to the direct export download path in cli.js, not only requests made through ApiClient.
  5. Avoid disabling TLS certificate validation in production. Replace self-signed or hostname-mismatched certificates with a valid certificate chain.
  6. Rotate bearer tokens that have previously been transmitted over plaintext networks and consider short token lifetimes and revocation support.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
92% confidence
Finding

The skill presents itself as a simple data-collection tool, but it also documents local config file writes, persistent token storage in the user's home directory, base-URL reconfiguration, and reuse of an 'xhs' shared path. Those are security-sensitive behaviors because they affect credential persistence, cross-skill token sharing, and potential redirection of authenticated traffic to attacker-controlled infrastructure. The context makes this more dangerous because the same document explicitly warns that the default transport is plaintext HTTP, so persisted tokens and configurable endpoints create a clear credential-compromise path.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill presents itself as a simple data-collection tool, but it also documents local config file writes, persistent token storage in the user's home directory, base-URL reconfiguration, and reuse of an 'xhs' shared path. Those are security-sensitive behaviors because they affect credential persistence, cross-skill token sharing, and potential redirection of authenticated traffic to attacker-controlled infrastructure. The context makes this more dangerous because the same document explicitly warns that the default transport is plaintext HTTP, so persisted tokens and configurable endpoints create a clear credential-compromise path.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares no explicit tool scope even though its documented behavior clearly requires shell, network, and access to local configuration/token files. Without an allowlist, an agent runtime may grant broader-than-necessary capabilities, increasing the chance of unintended command execution, credential exposure, or abuse of host resources. The risk is amplified because the skill itself instructs storing and using authentication tokens from the user home directory.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L006 将技能触发范围扩展到用户只要提到“视频数据/播放量/社媒指数”等词就可使用本 skill,但这些词缺少明确上下文约束,不足以限定为“抖音公开视频互动数采集”场景。虽然同句也列出了较具体的触发词,但该宽泛兜底条件仍可能让普通数据讨论误触发技能。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code embeds the primary CLI description, usage text, and operational prompts entirely in Chinese, which imposes a specific language on users. The policy allows locale constraints only when documented and justified or when users are given a choice, neither of which appears here.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
98% confidence
Finding

allowInsecureTls disables TLS certificate validation process-wide by setting NODE_TLS_REJECT_UNAUTHORIZED=0. That allows man-in-the-middle interception of all subsequent HTTPS requests in the process, defeating server authentication and exposing bearer tokens and collected data to tampering or theft.

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
95% confidence
Finding

The manifest describes a tool for collecting/exporting Douyin video interaction counts such as likes, comments, favorites, shares, and views from batches of video links. This client also exposes full comment-session workflows, including creating, stepping through, finishing, and listing comment collection sessions for both generic comments and Douyin-specific comments, which is materially broader than simple interaction-metric collection.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest positions the skill specifically as a Douyin video metrics collector. The code includes a separate '/comments/sessions' API described as 'xhs_comments v2', indicating support for another platform’s comment collection workflow, which is outside the declared Douyin-only purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code automatically reads a token, base_url, and insecure flag from another skill's legacy config path and imports them into this skill's active configuration. This creates unintended credential and trust-boundary sharing between separate skills/services, which can cause this skill to authenticate as the user to the wrong backend, inherit an unsafe transport setting, or exfiltrate requests to an attacker-controlled legacy base URL if that file was previously poisoned.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This file's natural-language comments and emitted error/help text are entirely in Chinese, including user-facing guidance such as login and retry instructions. Because the file does not offer a language choice or document that the skill is intentionally limited to a Chinese-speaking context, it creates a language/locale policy concern under the natural-language policy rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The package description is entirely in Chinese and does not indicate that the skill is region-specific or that users may interact in another language. This can violate language/locale policy when a skill implicitly assumes a single language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This JavaScript file uses Chinese-only natural-language descriptions and warning messages, including user-visible stderr output, with no indication that users may choose another language. The policy scope includes natural-language content in code comments and string literals, so a fixed locale without opt-in is a language policy violation.

Content

No source excerpt is available for this finding.