Back to skill

Security audit

socialdatax-xhs-creator-notes

Security checks for vulnerabilities and agentic risk

Overview

The skill is read-only and purpose-aligned, but it tells agents to run an unpinned npm package at runtime while exposing the SocialDataX API key to that code.

Review this before installing. It appears intended for read-only SocialDataX/Xiaohongshu data retrieval, but you should prefer a pinned, reviewed version of `socialdatax-skills` and keep `SOCIALDATAX_API_KEY` scoped and rotatable because the documented `npx @latest` command can execute whatever package version is current at invocation time.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:28
Finding
Unpinned Remote npm Package Download and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 28–36 **Vulnerability Type**: Unpinned remote dependency retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash npx -y socialdatax-skills@latest xhs user-posts \ --user-id "<user_id>" --pretty --source-client socialdatax-skills \ --source-platform clawhub --source-skill socialdatax-xhs-creator-notes npx -y socialdatax-skills@latest xhs user-posts \ --profile-url "<profile_url_or_share_text>" --pretty \ --source-client socialdatax-skills --source-platform clawhub \ --source-skill socialdatax-xhs-creator-notes ``` The package is also declared without an exact version in the metadata at line 5: ```yaml metadata: {"openclaw":{"requires":{"env":["SOCIALDATAX_API_KEY"],"bins":["node","npm"]},"primaryEnv":"SOCIALDATAX_API_KEY","install":[{"kind":"node","package":"socialdatax-skills","bins":[]}],"emoji":"🗂️","homepage":"https://socialdatax.com/ai?from=clawhub"}} ``` ### Technical Analysis The Skill instructs the Agent to execute `npx -y socialdatax-skills@latest`. The `@latest` selector resolves at invocation time to a mutable npm release rather than to the version reviewed during this audit. The `-y` option suppresses the interactive installation confirmation, allowing the resolved package and its lifecycle behavior to run automatically. Consequently, the effective executable payload can change after the Skill has been reviewed. A compromised package maintainer account, malicious future release, registry compromise, or upstream dependency compromise could introduce arbitrary code. Because the Skill requires `SOCIALDATAX_API_KEY` in its runtime environment, downloaded code may be able to read that credential. Depending on the host sandbox, it may also inherit access to local files, process execution, and unrestricted network connections. The remote API call itself is consistent with the declared creator-note lookup functionality. However, dynamically downloadi ...[truncated 1817 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace `socialdatax-skills@latest` with an exact, reviewed version, such as `socialdatax-skills@X.Y.Z`. Do not use version ranges or mutable distribution tags. 2. Record the dependency in a committed lockfile and enforce npm integrity hashes during installation. 3. Install dependencies in a controlled build or provisioning phase rather than downloading executable code on each Skill invocation. 4. Remove `-y` from ad hoc installation workflows where practical so unexpected installation is not silently approved. 5. Audit the pinned package, its lifecycle scripts, and its complete transitive dependency tree before deployment. 6. Disable npm lifecycle scripts during installation when they are not required, for example through an appropriately tested `--ignore-scripts` installation policy. 7. Run the CLI in a restricted process or container with: - Read-only or narrowly scoped filesystem access. - Only the required API credential. - No access to unrelated environment variables. - Outbound network access limited to documented SocialDataX API endpoints and the minimum required package infrastructure during provisioning. 8. Keep the API key scoped, rate-limited, rotatable, and separate from unrelated credentials. Rotate it immediately if package compromise is suspected. 9. Pin the metadata installation declaration to the same audited exact version so the documented CLI and platform-managed installation cannot resolve different releases. 10. Establish an update process that reviews and tests each new package version before changing the pin. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding
The skill instructs agents to execute `npx -y socialdatax-skills@latest`, which pulls and runs the newest package version at execution time rather than a reviewed, immutable version. If the npm package is compromised, a malicious release is published, or a dependency is hijacked, the agent could execute arbitrary code in the user's environment with access to environment variables such as `SOCIALDATAX_API_KEY`.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding
This second example repeats the same unsafe pattern: `npx -y socialdatax-skills@latest` causes runtime installation and execution of unpinned code from npm. In an agent context, this is especially risky because the executed package can access local files, network, and sensitive environment variables, so a compromised release could lead to code execution or credential exfiltration.

Static analysis

No suspicious patterns detected.