Back to skill

Security audit

dy-profile

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it says, but it sends saved login tokens over plaintext HTTP by default and can submit paid collection jobs without an executable confirmation gate.

Review carefully before installing. Use this only if you accept sending account tokens and collected data to the configured backend, and avoid the default HTTP endpoint on untrusted networks. Require explicit user approval before any collect command, especially with --force, because the CLI itself will not stop to confirm charges.

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:17
Finding

Bearer credentials and account data are transmitted over plaintext HTTP by default

Content
View full analysis

Vulnerability Details

File Location: src/config.js:17-20, src/client.js:53-70, cli.js:329-332
Vulnerability Type: Cleartext transmission of sensitive information
Risk Level: High

Technical Analysis

The built-in service endpoint uses plaintext HTTP:

js
// Server certificate is not ready, so HTTP remains the default.
const DEFAULT_BASE_URL = 'http://st.aidata366.com';

Authenticated API requests attach the account bearer token to requests sent to that endpoint:

js
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,
});

Export downloads also attach the token directly:

js
const res = await fetch(url,
  { headers: { Authorization: `Bearer ${cfg.token}` }, signal: dlCtrl.signal });

The client prints a warning when a token is used over HTTP, but the warning does not interrupt the request:

js
if (!_httpWarned && this.token && this.baseUrl.startsWith('http://')) {
  _httpWarned = true;
  process.stderr.write('[warn] Current service address is plaintext HTTP...\n');
}

Consequently, ordinary authenticated commands using the default configuration expose bearer credentials, request bodies, task results, and exports without transport confidentiality or server authentication.

Attack Path

  1. The user registers or logs in, and the resulting bearer token is saved locally.
  2. The user or agent invokes an authenticated command such as quota, collect, query, export, or logout.
  3. Unless the user has explicitly replaced the default URL, the client connects to http://st.aidata366.com.
  4. The client includes Authorization: Bearer ... in the plaintext request.

...[truncated 891 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace the default endpoint with an HTTPS URL backed by a valid, hostname-matching certificate.
  • Refuse to send bearer tokens over HTTP by default.
  • If plaintext HTTP is required for local development, restrict it to loopback destinations or require an explicit, per-invocation unsafe override.
  • Do not allow a persisted insecure setting to silently authorize future transmission of credentials.
  • Keep TLS certificate verification enabled. Do not use NODE_TLS_REJECT_UNAUTHORIZED=0 as the normal alternative to fixing the certificate.
  • After deploying HTTPS, revoke or rotate tokens that may previously have traversed untrusted networks over HTTP.

T09 · Insecure Skill Coding Practices

Warning
Location
cli.js:218
Finding

Paid collection requests do not enforce the documented user-confirmation requirement

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:36-47, cli.js:218-260
Vulnerability Type: Missing authorization gate for a billable operation
Risk Level: Medium

Technical Analysis

The Skill documentation states that the agent must quote the collection and wait for user confirmation before submission:

markdown
2. **Quote confirmation (required)**: Clearly tell the user:
   - Profile URL and number of pages
   - Estimated points
   - Charging and refund rules
   - Do not execute collect without user confirmation.

The executable entry point does not receive or validate any confirmation state. After calculating the estimate and printing it to stderr, it immediately submits the billable task:

js
const { price } = await fetchPrice(cfg.baseUrl);
const estimatedPoints = pages * price;

const items = [{ id: 1, payload: { profile_url: profileUrl, pages } }];

const idemSource = `${profileUrl}|${pages}` +
  (opts.force ? `|#force:${Date.now()}` : '');
const idempotencyKey = crypto.createHash('sha256')
  .update(idemSource).digest('hex').slice(0, 32);

process.stderr.write(
  `Submit collection task: url="${profileUrl}" pages=${pages}\n` +
  `Billing estimate: ${estimatedPoints} points...\n`);

const client = new ApiClient({
  baseUrl: cfg.baseUrl,
  token: cfg.token
});
const data = await client.submitTask(
  CAPABILITY,
  items,
  idempotencyKey,
  !!opts.force
);

The documentation-only confirmation instruction is therefore not an executable authorization control. Any direct CLI invocation or mistaken agent tool call can submit a task and trigger the documented pre-charge. The --force option generates a time-dependent idempotency key and instructs the server to bypass deduplication, increasing the consequences of repeated invocations.

Attack Path

  1. A valid account token is present in the configuration.
  2. An agent, automation layer, or direct cal ...[truncated 1234 chars]
Remediation
View remediation

Remediation Suggestions

  • Split collection into a quote phase and a submission phase.
  • Have the server issue a short-lived, single-use confirmation token bound to the account, profile URL, page count, quoted unit price, maximum charge, and expiration time.
  • Require that confirmation token before submitTask can create a billable task.
  • For interactive use, display the final charge and require an explicit confirmation before submission.
  • For non-interactive agent use, require an explicit option such as --confirm-charge together with a server-issued quote identifier; a boolean flag alone should not authorize a stale or changed quote.
  • Require separate explicit approval for --force, and preserve server-side idempotency and spending limits.
  • Enforce maximum per-task and per-period spending limits on the backend so bypassing the local CLI cannot bypass billing controls.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill advertises data collection/export, but also performs local credential storage, token migration, and backend endpoint resolution, including insecure transport options. These hidden operational behaviors materially expand the security boundary because they affect secret handling and network trust, not just scraping.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill advertises data collection/export, but also performs local credential storage, token migration, and backend endpoint resolution, including insecure transport options. These hidden operational behaviors materially expand the security boundary because they affect secret handling and network trust, not just scraping.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill advertises data collection/export, but also performs local credential storage, token migration, and backend endpoint resolution, including insecure transport options. These hidden operational behaviors materially expand the security boundary because they affect secret handling and network trust, not just scraping.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes a skill for collecting a Douyin creator homepage video list and exporting results. This client additionally implements generic comment-session workflows, including non-Douyin '/comments/sessions' endpoints and Douyin comment collection endpoints, which are materially different capabilities from homepage video-list scraping.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The '/comments/sessions' methods are documented as 'xhs_comments v2' and operate on a comments-session workflow, which is unrelated to the stated purpose of gathering Douyin creator homepage video metadata. This introduces a cross-domain scraping capability that the manifest does not justify.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares shell, network, and environment-dependent behavior but does not constrain or disclose tool scope via explicit permissions or allowed-tools metadata. This increases the risk that an agent can invoke broader capabilities than users expect, especially because the skill also handles credentials and remote task submission.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill metadata presents the display name only in Chinese, and the document consistently instructs the agent to use fixed Chinese user-facing scripts. There is no indication that the user may choose another language or locale, which can violate a language/locale choice policy when applied broadly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instructions require the agent to send the registration guidance '原样发给用户', and the provided script is entirely in Chinese. This forces a specific language for a user-facing workflow without offering alternatives or checking user preference.

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, which allows man-in-the-middle interception of supposedly HTTPS API traffic. Because this client sends Bearer tokens and task data to a backend, an attacker on the network could steal credentials or tamper with requests and responses when this mode is enabled.

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/...) */

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Even where the code remains within Douyin, these methods perform stepwise comment-session collection rather than homepage video-list acquisition. Comment scraping is a separate capability from the manifest’s stated collection of video lists, metadata, and CSV export.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This config module manages shared credentials and endpoint selection for multiple skills, which exceeds the narrowly stated purpose of a Douyin profile scraper and increases the blast radius of any compromise or misuse. In particular, the default use of an HTTP service endpoint means tokens and data may be exposed to interception or endpoint tampering if used over an untrusted network.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code automatically reads a legacy configuration file from another skill and imports its token, base URL, and insecure flag into this skill without explicit user consent at migration time. That creates an unauthorized cross-skill credential flow, allowing this skill to access credentials unrelated to its stated functionality and potentially reuse weaker transport settings inherited from the other tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language comments and emitted error/help messages are written exclusively in Chinese, including operational guidance shown to users on authentication, quota, and timeout errors. Under the policy rule, this is a locale/language constraint without any opt-in or documented justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest describes a Douyin profile video collection/export tool, but the skill file also directs the agent to provide a customer-service image URL, phone number, and recharge/purchase escalation path. Those support and sales handoff capabilities are not part of the core collection purpose and are not technically required to scrape/export public profile videos.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The manifest presents the skill as a profile video collection/export tool, but the documented behavior also includes creating platform accounts, logging in, storing tokens in a shared config file, and managing service endpoints. Authentication is an implementation prerequisite, but the registration/account-management workflow is a broader capability than the manifest itself claims.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The package description is written entirely in Chinese, which indicates a fixed language choice in user-facing metadata. There is no accompanying opt-in, alternative locale, or stated region-specific justification, so this is a natural-language locale policy concern under the stated rules.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The header comment says this file is a shared output convention file aligned to another skill ('对齐转链 skill'), implying generic stdout/stderr formatting and exit-code handling. However, the implementation also contains task-polling behavior and error messages about querying task IDs, which are specific operational behaviors beyond a pure output helper and not clearly aligned with that stated intent.

Content

No source excerpt is available for this finding.