Back to skill

Security audit

Xiaohongshu (RedNote) User Profile API

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a focused JustOneAPI profile lookup wrapper, but it can expose the API token through command-line arguments and URL query strings.

Review this before installing if your JustOneAPI token has meaningful quota, billing, or data access. Use a narrowly scoped token if available, avoid running it on shared or heavily logged systems, and rotate the token if it may have appeared in command history, process monitoring, proxy logs, or API logs.

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

Warning
Location
bin/run.mjs:167
Finding

API Token Exposed Through Command-Line Arguments

Content
View full analysis
"}' ``` ```javascript function parseArgs(argv) { const parsed = { operation: null, paramsJson: "{}", token: null }; for (let index = 0; index < argv.length; index += 1) { const flag = argv[index]; const value = argv[index + 1]; if (flag === "--operation") { parsed.operation = value; index += 1; continue; } if (flag === "--params-json") { parsed.paramsJson = value; index += 1; continue; } if (flag === "--token") { parsed.token = value; index += 1; continue; } fail(`Unknown argument "${flag}".`); } return parsed; } ``` ### Technical Analysis The documented invocation expands `JUST_ONE_API_TOKEN` into the process command line, and the executable explicitly accepts the credential through `--token`. Command-line arguments can be captured by process inspection facilities, shell debugging, command telemetry, audit systems, and process-monitoring software. Although operating-system restrictions differ, exposing a secret as an argument creates an avoidable disclosure channel. The Skill already declares `JUST_ONE_API_TOKEN` as its required environment variable, so passing the same credential through the command line exceeds the minimum exposure necessary for the declared API-wrapper functionality. The token is not hardcoded, and the code does not deliberately print it. Nevertheless, placing it in `process.argv` can expose it outside the process before the request is made. ### Attack Path 1. A user launches the Skill using the documented `--token "$JUST_ONE_API_TOKEN"` command. 2. The shell expands the environment variable into the Node.js pro ...[truncated 779 chars]
Remediation
View remediation
"}' ``` 4. Ensure error messages, debug output, and telemetry never include the token. 5. Rotate any token believed to have been captured in process, shell, or execution logs. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
bin/run.mjs:258
Finding

API Token Transmitted in the Request URL Query String

Content
View full analysis
parameter.name === "token"); if (!tokenParam || params.token !== undefined) { return; } if (!cliToken) { fail("--token is required for this operation.", { operationId: operation.operationId, }); } params.token = cliToken; } ``` All query parameters, including `token`, are then appended to the URL: ```javascript function applyQueryParams(operation, params, url) { for (const parameter of operation.parameters.filter((item) => item.location === "query")) { const value = params[parameter.name]; if (value === undefined) { continue; } appendValue(url.searchParams, parameter.name, value); } } function appendValue(searchParams, name, value) { if (Array.isArray(value)) { for (const item of value) { appendValue(searchParams, name, item); } return; } if (value && typeof value === "object") { searchParams.append(name, JSON.stringify(value)); return; } searchParams.append(name, String(value)); } ``` The completed URL is sent to the fixed external service: ```javascript const url = new URL(operation.path, ensureBaseUrl(baseUrl)); applyPathParams(operation, params, url); applyQueryParams(operation, params, url); const requestInit = { headers: { "accept ...[truncated 2542 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (11)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bin/run.mjs (reported line 20)May include surrounding context.

js
"parameters": [
        {
          "defaultValue": null,
          "description": "Access token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bin/run.mjs (reported line 57)May include surrounding context.

js
"parameters": [
        {
          "defaultValue": null,
          "description": "Access token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

This finding reflects credential handling in the API definition: the skill asks for an access token and places it in a query parameter. That creates a real credential-exposure risk because secrets embedded in URLs can be captured in logs, monitoring tools, referrer data, or debugging output.

Content

Scanner excerpt · generated/operations.json (reported line 15)May include surrounding context.

json
"parameters": [
        {
          "defaultValue": null,
          "description": "Access token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

The second operation repeats the same insecure credential pattern by requiring an access token in the query string. Repetition across multiple endpoints increases the chance of accidental leakage and broadens the exposure surface if logs or traces are compromised.

Content

Scanner excerpt · generated/operations.json (reported line 52)May include surrounding context.

json
"parameters": [
        {
          "defaultValue": null,
          "description": "Access token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

The skill requests an access token as a query parameter, which exposes credential material to an external service and may also increase accidental leakage through logs, browser history, analytics, proxies, and URL capture. Because this is a profile lookup endpoint, the token handling is more dangerous than necessary if safer authentication mechanisms are available.

Content

Scanner excerpt · generated/operations.md (reported line 19)May include surrounding context.

md
| Name | In | Required | Type | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `token` | `query` | yes | `string` | n/a | Access token for this API service. |
| `userId` | `query` | yes | `string` | n/a | Unique user identifier on Xiaohongshu. |

### Request body

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

This second endpoint repeats the same pattern of accepting an access token in the query string, creating the same credential exposure risks across another API version. Replicating the design across versions broadens the attack surface and increases the chance of token leakage in routine request handling.

Content

Scanner excerpt · generated/operations.md (reported line 42)May include surrounding context.

md
| Name | In | Required | Type | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `token` | `query` | yes | `string` | n/a | Access token for this API service. |
| `userId` | `query` | yes | `string` | n/a | Unique user identifier on Xiaohongshu. |

### Request body

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill invokes a network-capable helper (node ... run.mjs) and transmits data to an external API, but it does not declare an explicit tool scope such as permissions or allowed-tools. This weakens policy enforcement and transparency, increasing the chance that an agent can use network access without clear user or platform-level gating.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill sends a user identifier (userId) to a third-party service for profile lookup but does not clearly warn the user that their supplied identifier and lookup target will be transmitted off-platform. This can create privacy and consent issues, especially because the endpoint is intended for account analysis and competitor monitoring of external profiles.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code appends all query parameters, including the required API token, into the request URL. Tokens in URLs are commonly exposed via logs, browser/history tooling, proxy logs, monitoring systems, and error messages, which increases the chance of credential leakage even when HTTPS is used. In this skill context, the risk is real because the API explicitly requires a token and the implementation provides no warning or safer transport mechanism.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill requires an access token to be sent as a URL query parameter, which is commonly logged by clients, proxies, API gateways, browser history, and server access logs. Even if HTTPS is used, query-string credentials are more likely to be exposed through operational logging and telemetry than Authorization headers.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The operation requires sending both a platform-specific user identifier and an access token to an external API service, but the documentation provides no warning that these values leave the local environment and are disclosed to a third party. This can mislead users into sharing credentials and identifiers without informed consent, increasing privacy, account-security, and compliance risk.

Content

No source excerpt is available for this finding.