Back to skill

Security audit

Xiaohongshu Collector

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Xiaohongshu collection helper that discloses its use of a saved cookie, with no hidden code or exfiltration found.

Install only if you are comfortable with the agent using a saved Xiaohongshu session cookie for local collection tasks. Keep that cookie file private, rotate or remove it when no longer needed, and prefer explicit confirmation before running collection or refresh operations that use authenticated access.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Note
Location
SKILL.md:28
Finding

Agent Access to a Persistently Stored Authentication Cookie

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:28-29; duplicated in references/collector-workflow.md:29-30
Vulnerability Type: Authentication credential access without an explicit approval boundary
Risk Level: Low

Vulnerable Code Snippets

SKILL.md:28-29:

markdown
2. Load the saved cookie from `data/xiaohongshu-cookie.txt` unless a newer cookie is provided.
3. Run or update `scripts/collect_xiaohongshu.py` with the requested URL(s), `--db`, `--refresh-url`, and `--comment-limit 0` when full comments are needed.

references/collector-workflow.md:29-30:

markdown
2. Read the saved cookie from `data/xiaohongshu-cookie.txt` unless the user provides a newer cookie.
3. Run or update `scripts/collect_xiaohongshu.py` with:

The Skill can also be invoked implicitly, as configured in agents/openai.yaml:5-6:

yaml
policy:
  allow_implicit_invocation: true

Technical Analysis

The Skill instructs the Agent to read a persistently stored browser authentication cookie. This credential access supports the declared collection workflow, so the audit found no evidence that the Skill intentionally steals or exfiltrates the cookie. The documentation also explicitly says not to reproduce the cookie in final output.

Nevertheless, reading a reusable session credential is a sensitive operation. The instructions do not establish an explicit user-consent boundary before access, limit how the credential may be exposed to model context, or enforce destination restrictions for its use. Implicit invocation increases the possibility that credential access could occur without a distinct, informed approval step.

The artifact contains documentation and configuration only. The referenced collector, backend, and browser-extension implementations are absent, so the audit could not verify whether runtime controls prevent logging, disclosure, transmission to unintended hosts, or broader reuse of the ...[truncated 1250 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require explicit user approval immediately before reading the cookie, even when the Skill itself was invoked implicitly.
  2. Avoid placing the raw cookie in model-visible context. Pass it directly from a restricted secret store to the collector process or browser integration.
  3. Restrict file permissions on data/xiaohongshu-cookie.txt to the minimum required user and process.
  4. Constrain cookie use to approved Xiaohongshu domains and reject redirects or requests to untrusted destinations.
  5. Prevent the cookie from appearing in command-line arguments, exception messages, telemetry, debug output, generated artifacts, or logs.
  6. Prefer short-lived or narrowly scoped credentials where the platform supports them, and provide a clear revocation procedure.
  7. Add runtime tests verifying that cookie values are redacted and cannot be included in CSV, JSON, API responses, or final Agent output.
  8. Consider disabling implicit invocation for workflows that access authentication credentials, or require a separate privileged confirmation step.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep