Back to skill

Security audit

人群宇宙投放追踪周报

Security checks for vulnerabilities and agentic risk

Overview

This internal reporting skill has a legitimate purpose, but it directly handles reusable SSO cookies and exposes sensitive reports in ways that need human review before installation.

Install only in a trusted internal environment after adding explicit confirmation before SSO use, validating all download and image URLs, avoiding raw reusable cookies, locking or vendoring the publishing CLI, and serving previews through authenticated HTTPS or loopback-only access.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/fetch_data.sh:17
Finding

Unvalidated Download URL Receives the SSO Session Cookie

Content
View full analysis
/dev/null) if [ -n "$URL" ]; then NAME="data_${AID}.csv" curl -s "$URL" -H "Cookie: $COOKIE" -o "$OUTPUT_DIR/$NAME" ``` ### Technical Analysis The script obtains `fileUrl` from the RedBI API response and supplies it directly to `curl`. It does not parse or validate the URL's scheme, hostname, or port before attaching the reusable SSO cookie. Although the expected download host is documented as `datatools.xhscdn.com`, the script does not enforce that restriction. If the task API, a task record, or an upstream component is compromised, an attacker could return an HTTPS URL under an attacker-controlled domain. Because the `Cookie` header is added manually, normal browser cookie-domain restrictions do not protect it. The same unsafe pattern is documented in `SKILL.md:74-80`. ### Attack Path 1. An attacker compromises or manipulates a RedBI download-task record or its API response. 2. The attacker sets the completed task's `fileUrl` to an attacker-controlled endpoint. 3. The script selects that URL based only on `resourceId` and `FINISHED` status. 4. `curl` requests the attacker-controlled URL and explicitly sends `Cookie: $COOKIE`. 5. The attacker records the SSO cookie and attempts to replay it against services available to that identity. ### I ...[truncated 548 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:69
Finding

Workflow Directly Extracts and Handles a Reusable SSO Credential

Content
View full analysis
/dev/null) ``` ### Technical Analysis The declared task requires access to particular RedBI exports, but the workflow reads or retrieves a raw, reusable SSO cookie. This gives the Skill direct possession of a credential representing the user's broader internal session rather than a narrowly scoped capability for the required dashboard and files. The cookie is placed in a shell variable and supplied to multiple `curl` processes. This increases exposure to subprocess inspection, shell debugging, diagnostic output, accidental logging, or future command changes. It also enables the credential-forwarding issue described separately in this report. This design exceeds least privilege when a task-specific API token, delegated service, or pre-authorized export capability could provide access only to the required datasets. ### Attack Path 1. The Skill is invoked in an environment where the user has an active internal SSO session. 2. The workflow reads `/home/node/.token/sso_token.json` or executes the SSO helper. 3. The reusable cookie is returned to the shell and stored in `COOKIE`. 4. A compromised local process, modified helper, shell tracing configuration, or vulnerable downstream URL-handling path captures the credential. ...[truncated 638 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:211
Finding

Runtime Execution of a Package Without Integrity Verification

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:183
Finding

Sensitive Advertising Reports Are Mandated to Be Published Over Plain HTTP

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented behavior materially misrepresents what the skill actually does: it claims broad reporting automation while embedding operational steps that access SSO cookies, query internal APIs, fetch remote content, publish documents, and expose a local web preview. This mismatch is dangerous because users may invoke the skill without realizing it will use credentials and transmit internal data to multiple endpoints.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
96% confidence
Finding

This duplicate finding reflects the same unsafe dynamic fetch flow: the skill parses remote HTML, extracts a URL, and retrieves it without robust validation. In the context of a reporting skill that already uses internal authentication and processes internal data, that broadens the attack surface beyond simple report generation into potentially attacker-influenced network access.

Content

Scanner excerpt · SKILL.md (reported line 198)May include surrounding context.

-H "Cookie: ${SSO_COOKIE}"
"https://www.xiaohongshu.com/explore/${nid}") img_url=$(echo "$PAGE" | grep -o 'og:image" content="[^"]*"' | head -1 | sed 's/og:image" content="//;s/"//') curl -s --max-time 15 -H "Referer: https://www.xiaohongshu.com/" "$img_url" -o /tmp/covers/$nid.jpg

text
- 文件 > 50KB 才算成功(小于说明是占位图)
- base64 内嵌:`data:image/jpeg;base64,xxx`,禁止外链

External Script Fetching

High
Category
Supply Chain
Confidence
96% confidence
Finding

This duplicate finding reflects the same unsafe dynamic fetch flow: the skill parses remote HTML, extracts a URL, and retrieves it without robust validation. In the context of a reporting skill that already uses internal authentication and processes internal data, that broadens the attack surface beyond simple report generation into potentially attacker-influenced network access.

Content

Scanner excerpt · SKILL.md (reported line 198)May include surrounding context.

-H "Cookie: ${SSO_COOKIE}"
"https://www.xiaohongshu.com/explore/${nid}") img_url=$(echo "$PAGE" | grep -o 'og:image" content="[^"]*"' | head -1 | sed 's/og:image" content="//;s/"//') curl -s --max-time 15 -H "Referer: https://www.xiaohongshu.com/" "$img_url" -o /tmp/covers/$nid.jpg

text
- 文件 > 50KB 才算成功(小于说明是占位图)
- base64 内嵌:`data:image/jpeg;base64,xxx`,禁止外链

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · references/dashboard.md (reported line 30)May include surrounding context.

bash
# 查询最新下载任务
COOKIE=$(bash /app/skills/data-fe-common-sso/script/run-sso.sh "$WORKSPACE")
curl -s -X POST "https://redbi.devops.xiaohongshu.com/api/download/task/list" \
  -H "Cookie: $COOKIE" \
  -H "Content-Type: application/json" \
  -d '{"pageNo":1,"pageSize":10}' | python3 -c "

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/fetch_data.sh (reported line 17)May include surrounding context.

sh
fi

echo "=== 查询最新下载任务 ==="
TASKS=$(curl -s -X POST "https://redbi.devops.xiaohongshu.com/api/download/task/list" \
  -H "Cookie: $COOKIE" \
  -H "Content-Type: application/json" \
  -d '{"pageNo":1,"pageSize":20}')

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill instructs the agent to read local token files, invoke shell commands, download data, write reports, and start a local HTTP server, but it declares no explicit tool scope or permissions. That makes its effective capabilities opaque to users and reviewers, increasing the chance of unauthorized file, shell, or network actions being performed under a seemingly simple reporting workflow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases include broad terms like '人群宇宙' and '人群分析', which could match ordinary conversation and invoke the skill unexpectedly. In this skill's context, accidental activation is more dangerous because activation can lead to credential use, internal data retrieval, and report publication.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The trigger method says a user can simply ask for a weekly report in natural language, without a clear boundary between casual discussion and intentional execution. Because the downstream workflow includes SSO-backed downloads and publishing, ambiguous invocation scope raises the risk of unintentional sensitive operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill tells users it will automatically complete SSO login and file downloads, but it does not prominently warn that it reads an internal SSO token from the local filesystem and uses it to access RedBI APIs. Hidden credential use reduces informed consent and can lead to unauthorized access under another user's existing session context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill mandates publishing a Redoc document and exposing an HTTP preview link, but this data egress and exposure is not clearly surfaced in the high-level description. Given that the generated reports may contain internal business metrics and customer-level analysis, undisclosed publication significantly increases the risk of accidental internal data leakage.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The skill sends authenticated requests to an internal RedBI API using a cookie extracted from a local token file. While contacting the intended internal service is part of the business workflow, it is still a security-relevant external transmission because authenticated data access occurs automatically and may expose sensitive internal analytics if triggered inappropriately.

Content

Scanner excerpt · SKILL.md (reported line 74)May include surrounding context.

md
COOKIE=$(cat /home/node/.token/sso_token.json | python3 -c "import sys,json; print(json.load(sys.stdin).get('cookie',''))")

# Step 2:查询最新下载任务列表
curl -s -X POST "https://redbi.devops.xiaohongshu.com/api/download/task/list" \
  -H "Cookie: $COOKIE" \
  -H "Content-Type: application/json" \
  -d '{"pageNo":1,"pageSize":30}'

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document instructs users to obtain an SSO cookie and use it directly in authenticated API requests, but provides no guidance on protecting the session token, limiting its exposure, or handling downloaded internal data securely. In a skill context, operational docs are often copied verbatim into automation, so this can lead to credential leakage in shell history, logs, transcripts, or downstream tooling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring is entirely in Chinese, including the usage instructions and dataset descriptions, which imposes a specific language on users. The file does not offer an alternative language, opt-in, or explain that the skill is intentionally limited to a Chinese-only regional workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The printed status messages and usage output are all Chinese string literals, so users receive a fixed locale regardless of their preference. Under the policy, language constraints should either be optional or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/dashboard.md (reported line 30)May include surrounding context.

md
fi

echo "=== 查询最新下载任务 ==="
TASKS=$(curl -s -X POST "https://redbi.devops.xiaohongshu.com/api/download/task/list" \
  -H "Cookie: $COOKIE" \
  -H "Content-Type: application/json" \
  -d '{"pageNo":1,"pageSize":20}')

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/fetch_data.sh (reported line 17)May include surrounding context.

sh
fi

echo "=== 查询最新下载任务 ==="
TASKS=$(curl -s -X POST "https://redbi.devops.xiaohongshu.com/api/download/task/list" \
  -H "Cookie: $COOKIE" \
  -H "Content-Type: application/json" \
  -d '{"pageNo":1,"pageSize":20}')

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The title and core rules are written as mandatory guidance for Chinese HTML generation, including requirements centered on Chinese characters and Chinese fonts. Because the instructions use mandatory language such as '必须遵守' and do not provide any opt-in or alternative locale path, this can be read as forcing a specific language/locale.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code downloads remote data and writes it to "$OUTPUT_DIR/$NAME", which affects user data/storage. Although the filename and output directory are parameterized, the script provides no confirmation prompt or explicit warning that CSV files will be persisted locally beyond the terse usage comment.

Content

No source excerpt is available for this finding.