Back to skill

Security audit

xiaohongshu-note-research

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed note-research workflow, but it also installs and manages a broad shared Beatra authorization, silent self-updates, upload capability, telemetry, and credential lifecycle controls that go well beyond note research.

Install only if you are comfortable granting this package a broad shared Beatra device authorization rather than a narrow note-only permission. Before use, review the Beatra account, billing, and trust assumptions, consider running `python3 scripts/mcp_client.py update --auto off`, and confirm every paid Xiaohongshu lookup before it runs. Avoid installing in environments where silent code updates, shared bearer credentials, local skill inventory, upload capability, or wallet/media/task scopes are not acceptable.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (20)

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill declares itself as a note-research workflow but includes capabilities for environment access, file read/write, network access, and shell execution without any explicit permission declaration or strong scoping. That mismatch increases the attack surface and makes it easier for users or hosting systems to trust a package that can perform materially broader actions than its stated purpose requires.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The documented purpose is content research, but the skill also describes credential creation and storage, remote session initialization, arbitrary tool invocation, artifact upload, telemetry/registration, uninstall state deletion, and package self-update. This is dangerous because users may invoke a seemingly simple research skill without understanding that it can authenticate, persist secrets, transmit local data, alter the local installation, and execute broader remote operations.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
A silent automatic update mechanism that downloads and replaces package files is a supply-chain and integrity risk, especially when unrelated to the core note-research function. Even with stated verification controls, auto-replacement changes executable behavior without per-update consent and can expand the blast radius of any compromised update channel, signing process, or publisher account.

Intent-Code Divergence

High
Confidence
98% confidence
Finding
This file is materially unrelated to the declared Xiaohongshu note-research skill and instead documents installation, authentication, and MCP usage for a separate Beatra service with broad media/task capabilities. That mismatch is dangerous because it can induce an agent or operator to authorize and connect an unrelated external system, expanding privileges and data flows far beyond the skill’s stated purpose.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
The authorization flow requests a very broad OAuth scope set, including wallet spending, image/video/music/speech generation, artifact access, and task control, which is far beyond what a Xiaohongshu note research skill appears to need. If the issued token is compromised or the skill later invokes these capabilities, the user grants excessive authority that expands blast radius well beyond note analysis.

Context-Inappropriate Capability

Medium
Confidence
85% confidence
Finding
The script persists host platform, device name, and an inventory of installed skill paths in local state, which exceeds what is strictly necessary to obtain an authorization token for note research. While this is local-only and not directly exfiltrated here, it creates additional sensitive metadata that could be exposed by local compromise, future code changes, or debugging/log collection.

Description-Behavior Mismatch

High
Confidence
96% confidence
Finding
The client contains extensive self-update logic that downloads manifests and archives from remote infrastructure and replaces local package files, which is materially broader than a Xiaohongshu note-research skill requires. Even with checksum and path validation, this creates a remote code modification channel inside the skill, expanding trust and attack surface far beyond the declared purpose.

Description-Behavior Mismatch

Medium
Confidence
88% confidence
Finding
The upload path can transmit any readable local regular file up to 100 MB to a remote Beatra asset service, rather than being constrained to narrowly scoped Xiaohongshu-research inputs. In a skill context, arbitrary local file upload meaningfully increases the risk of unintended data exfiltration if invoked by a user or another component without clear boundaries.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
The skill fingerprints the host environment using agent-specific environment variables and persists platform/install metadata locally, which is unrelated to note research. This unnecessary collection can aid tracking, profiling, or policy evasion and broadens the skill's behavioral scope without user benefit.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The code performs installation telemetry registration to a remote service and records local skill inventory independent of the research task. In this context, that is overbroad data collection and creates an unnecessary outbound metadata flow that users would not reasonably expect from a note-analysis tool.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The uninstall script is designed to revoke a shared Beatra device credential and remove global ~/.beatra state, which affects all skills on the device rather than only this Xiaohongshu research skill. Even though the code includes safeguards to avoid revoking while other skills appear installed, it still grants this package authority over shared authentication material unrelated to its stated note-research purpose, creating unnecessary security and availability risk if invoked unexpectedly or if state detection is wrong.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
This code reads the device access token from ~/.beatra/credentials.json and uses it to call the Beatra revocation endpoint, which is account/device authorization management capability not justified by a note-research skill. Embedding such privileged auth handling inside skill code expands the attack surface: compromise, repurposing, or misuse of the skill could disrupt other installed skills by revoking shared access.

Natural-Language Policy Violations

Medium
Confidence
72% confidence
Finding
Forcing a specific locale without user opt-in can affect which update channel or content variant is retrieved and may bypass user expectations around regional behavior. In this context it is less severe than credential or update issues, but it still reduces transparency and user control over remotely fetched package behavior.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The document states that the client silently checks for updates and installs newer releases automatically without separate confirmation. Even with integrity checks and fixed update endpoints, automatic file replacement by default reduces user control and can introduce unexpected code changes into the local environment, increasing supply-chain and change-management risk if the update channel is ever compromised or if updates cause operational issues.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The documentation states that the client automatically performs an installation registration call and transmits package slug, version, platform, and a stable external installation reference on first use, but it does not present this as an explicit user-facing notice or consent step. Even if the data is described as non-secret and non-billable, it is still installation metadata that can support tracking, inventorying, or correlation across environments, so undisclosed transmission is a legitimate privacy and transparency issue.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
Automatic silent self-update changes installed package files opportunistically during normal command execution without a contemporaneous user-facing warning. In a skill environment, silently modifying executable code is dangerous because it undermines user trust boundaries and enables remote behavioral changes after initial installation.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill performs telemetry registration and inventory recording as best-effort background behavior without clear user-facing disclosure at the time of use. Hidden metadata collection is risky in an agent skill because users expect the tool to focus on its declared research task, not track installation state remotely.

Credential Access

High
Category
Privilege Escalation
Content
#: these and then removes the directory only if it is empty — the script
#: never recursively deletes a directory it does not fully understand.
_STATE_FILES = (
    "credentials.json",
    "installation.json",
    "host.json",
    "skills.json",
Confidence
84% confidence
Finding
The script explicitly targets credentials.json as part of removable shared state, indicating access to credential-bearing files outside the skill's own functional domain. Access paths to shared credential stores are sensitive because they normalize handling of authentication artifacts in package code and can enable credential theft, destruction, or unauthorized token lifecycle operations if the code is modified or abused.

Credential Access

High
Category
Privilege Escalation
Content
def _device_token(state_dir: Path) -> str | None:
    path = state_dir / "credentials.json"
    try:
        value = json.loads(path.read_text(encoding="utf-8"))
    except (OSError, ValueError):
Confidence
93% confidence
Finding
The _device_token function reads an access token from ~/.beatra/credentials.json and later uses it in an Authorization header to revoke the device. Reading bearer tokens directly from disk in a skill package is dangerous because any code with this capability can potentially exfiltrate, misuse, or invalidate credentials, and in this case the token is shared across skills, increasing blast radius.

Self-Modification

High
Category
Rogue Agent
Content
)
    update = subparsers.add_parser(
        "update",
        help="Check, install, or configure Beatra package self-updates",
    )
    update.add_argument(
        "--check",
Confidence
97% confidence
Finding
The exposed self-update command explicitly supports replacing the package's own installed files, which is a self-modification capability unrelated to Xiaohongshu note research. In the skill context this is especially concerning because it allows the package's executable behavior to change post-install, increasing the impact of any upstream compromise or policy bypass.

Static analysis

No suspicious patterns detected.