Back to skill

Security audit

mingquan

Security checks for vulnerabilities and agentic risk

Overview

This Rain Classroom skill is mostly purpose-aligned, but it needs review because its installer handles an account secret unsafely, changes MCP configuration, and sends silent authenticated install telemetry.

Install only if you trust the publisher and Rain Classroom endpoint, and prefer manual MCP configuration or a fixed installer that avoids shell-string execution with your secret. Treat YUKETANG_SECRET like an account credential, review the course-reservation capability before enabling it, and be aware that the Unix setup script silently sends an authenticated install-duration report.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
setup.js:30
Finding

Shell Command Injection Through YUKETANG_SECRET

Content
View full analysis

Vulnerability Details

File Location: setup.js, lines 30-39
Vulnerability Type: OS command injection through unsafe shell-string construction
Risk Level: High

Vulnerable Code

javascript
const authorization = `Bearer ${secret}`;
let registered = false;

try {
  execSync(
    `npx mcporter@0.8.1 config add yuketang-mcp --url "${MCP_URL}" --header "Authorization=${authorization}" --scope project`,
    { stdio: "inherit" }
  );

Technical Analysis

The script reads YUKETANG_SECRET from the environment and directly interpolates it into a command string passed to child_process.execSync. Unlike argument-based process APIs, execSync executes the supplied string through a shell.

The double quotes surrounding the header do not make this safe. A crafted environment variable can contain quote characters, command substitutions, or other shell syntax that terminates or alters the intended argument. The shell can consequently interpret attacker-controlled content as commands.

This vulnerability is reachable whenever a user runs node setup.js with an untrusted or attacker-supplied Secret value.

Attack Path

  1. An attacker supplies or recommends a specially crafted value as the user's Rain Classroom Secret.
  2. The user assigns that value to YUKETANG_SECRET.
  3. The user executes node setup.js as instructed by the Skill documentation.
  4. setup.js embeds the value into the command string passed to execSync.
  5. The operating-system shell evaluates the injected shell syntax.
  6. Attacker-selected commands execute with the privileges of the user running the installer.

Impact Assessment

Successful exploitation provides arbitrary command execution under the current user's account. The attacker could read or alter files available to that user, steal environment variables and credentials, modify project configuration, install persistence within user-writable locations, or invok ...[truncated 129 chars]

Remediation
View remediation

Remediation Suggestions

Replace shell-string execution with an argument-based API such as execFileSync or spawnSync, explicitly disabling shell processing:

javascript
const { execFileSync } = require("child_process");

execFileSync(
  "npx",
  [
    "mcporter@0.8.1",
    "config",
    "add",
    "yuketang-mcp",
    "--url",
    MCP_URL,
    "--header",
    `Authorization=Bearer ${secret}`,
    "--scope",
    "project",
  ],
  {
    stdio: "inherit",
    shell: false,
  }
);

Additionally:

  • Validate the Secret against its documented character set and expected length before use.
  • Reject control characters, newlines, and unexpected whitespace.
  • Do not attempt to secure this operation solely through manual quote escaping.
  • Add automated tests using values containing quotes, command substitutions, semicolons, and newline characters.
  • Avoid printing the Secret or the complete authorization header in errors or logs.

T08 · Insecure Dependencies

Warning
Location
setup.js:34
Finding

Execution of an On-Demand npm Dependency Without Integrity Verification

Content
View full analysis

Vulnerability Details

File Location: setup.js, lines 34-37
Additional Locations: setup.js:70, setup.sh:45-49, setup.sh:87, setup.sh:97, setup.sh:103, and SKILL.md:319-322
Vulnerability Type: Third-party supply-chain exposure through repeated npx execution
Risk Level: Medium

Vulnerable Code

javascript
try {
  execSync(
    `npx mcporter@0.8.1 config add yuketang-mcp --url "${MCP_URL}" --header "Authorization=${authorization}" --scope project`,
    { stdio: "inherit" }
  );

Related shell-script execution:

bash
register_with_mcporter() {
  npx mcporter@0.8.1 config add yuketang-mcp \
    --url "https://open-envning.rainclassroom.com/openapi/v1/mcp-server/sse" \
    --header "Authorization=$AUTHORIZATION" \
    --scope project
}

The package is also invoked for configuration listing and authenticated MCP calls:

bash
npx mcporter@0.8.1 list
bash
npx mcporter@0.8.1 call yuketang-mcp claw_report \
  --args "{\"payload\":{\"durationMs\":${DURATION}},\"action\":\"install\"}" \
  >/dev/null 2>&1 || true

Technical Analysis

The installation and operational paths execute mcporter@0.8.1 directly through npx. Specifying an exact version limits accidental version drift, but the project does not include a lockfile or integrity hash that independently authenticates the package contents.

When the dependency is not already available locally, npx may retrieve it from the configured npm registry and execute package code. The dependency runs while the user's bearer token is available and, for configuration calls, receives that token as an argument. Therefore, compromise of the package release, publisher account, registry configuration, or package-delivery path could expose credentials or run arbitrary code.

The audit found no evidence that mcporter@0.8.1 is currently malicious. This finding concerns the unsafe trust and executio ...[truncated 1124 chars]

Remediation
View remediation

Remediation Suggestions

  • Add the reviewed dependency to a conventional project manifest and commit a lockfile containing registry-resolved integrity hashes.
  • Use a controlled installation process rather than repeatedly downloading and executing the package through npx.
  • Audit the exact dependency version and its transitive dependency tree before distribution.
  • Use a trusted registry and enforce registry configuration in controlled deployment environments.
  • Disable dependency lifecycle scripts where compatible with the required package behavior.
  • Prefer a vendored or internally mirrored, integrity-verified artifact for security-sensitive installation workflows.
  • Minimize the dependency's access to credentials. Where possible, pass authorization data through a protected channel instead of a visible command-line argument.
  • Establish a process for dependency provenance verification and security updates.

other

Note
Location
setup.sh:99
Finding

Silent Authenticated Installation Telemetry Without User Disclosure

Content
View full analysis

Vulnerability Details

File Location: setup.sh, lines 99-105
Vulnerability Type: Undisclosed telemetry and authenticated outbound reporting
Risk Level: Low

Vulnerable Code

bash
# ── 4. 上报(静默) ──
END=$(now_ms)
DURATION=$((END - START))
if command -v npx >/dev/null 2>&1; then
  npx mcporter@0.8.1 call yuketang-mcp claw_report \
    --args "{\"payload\":{\"durationMs\":${DURATION}},\"action\":\"install\"}" \
    >/dev/null 2>&1 || true
fi

Technical Analysis

After installation, the Unix setup script invokes the remote claw_report MCP tool using the authenticated yuketang-mcp configuration. The payload contains the installation action and measured duration. Both standard output and standard error are redirected to /dev/null, and failures are suppressed with || true.

The Skill documentation does not disclose this telemetry or offer an opt-in or opt-out control. The behavior is also inconsistent across platforms because setup.js does not perform the same report.

The observed payload is limited to durationMs and the string install; the reviewed code does not show transmission of files or arbitrary user content. Nevertheless, the request is authenticated, so the service may associate the event with the configured account.

Attack Path

  1. The user exports YUKETANG_SECRET and runs bash setup.sh.
  2. The script configures the authenticated Rain Classroom MCP endpoint.
  3. At the end of setup, it calculates the installation duration.
  4. It invokes claw_report with the install action and duration payload.
  5. The request is sent without an explicit notice or consent prompt.
  6. Output and errors are suppressed, preventing the user from observing whether reporting occurred.

Impact Assessment

The remote service receives authenticated installation metadata that can potentially be associated with the user's account. The direct data exposure visible in the review ...[truncated 231 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove installation telemetry unless it is necessary for the core function of the Skill.
  • If telemetry is retained, disclose the destination, exact payload, purpose, retention policy, and account-association behavior before transmission.
  • Make reporting explicitly opt-in, for example through a documented YUKETANG_TELEMETRY=1 setting.
  • Provide a persistent and documented opt-out mechanism.
  • Do not describe or implement reporting as silent behavior.
  • Avoid suppressing all reporting output; provide a concise status message without exposing credentials.
  • Keep telemetry behavior consistent across setup.sh and setup.js.
  • Ensure telemetry failure never affects core installation, while still allowing users to inspect diagnostic information when requested.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The second mismatch is also valid: the skill goes beyond simple queries by reading/using YUKETANG_SECRET, configuring a remote MCP connection, and potentially reporting installation-related telemetry. Hidden credential use and remote registration materially increase risk because they expand trust boundaries without being prominent in the skill's declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The second mismatch is also valid: the skill goes beyond simple queries by reading/using YUKETANG_SECRET, configuring a remote MCP connection, and potentially reporting installation-related telemetry. Hidden credential use and remote registration materially increase risk because they expand trust boundaries without being prominent in the skill's declared purpose.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill handles a sensitive credential via the YUKETANG_SECRET environment variable and gives installation/configuration instructions, but it does not declare any explicit tool scope such as allowed-tools or permissions. That creates an authorization-boundary problem: a user or platform cannot easily tell that the skill needs environment access and local configuration side effects before using it.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The instruction that the agent should directly update the user's environment variable with a personal Secret is risky because it normalizes direct credential handling by the agent without warning, scoping, or confirmation. If followed, it could lead to accidental secret exposure, persistence in insecure shells/config files, or modification of the wrong environment context.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire reference is written as mandatory Chinese-language instructions and example user utterances, with no indication that users may choose another language or that the skill is explicitly limited to a Chinese-only locale. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The reference file documents and encourages use of a course-reservation tool (cube_lesson_reservation) even though the skill metadata describes the skill as query-focused. This capability expansion can cause an agent or reviewer to underestimate that the skill can perform state-changing actions, increasing the risk of unauthorized class creation or scheduling if the tool is exposed without explicit disclosure and consent boundaries.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file’s comments and user-facing console messages indicate the skill is intended to operate in Chinese only, and the final usage example also instructs the user to speak Chinese. This creates a language/locale policy issue because the skill does not offer any language choice or document a justified region-specific restriction.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a Rain Classroom account/class query service, but this file invokes npx mcporter via child_process.execSync to add and list MCP server configuration. Spawning external processes is a capability distinct from providing account/class queries and is not justified by the stated functional purpose of the skill itself.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The setup script performs an additional remote action after installation by calling claw_report and transmitting installation timing data. This behavior is unrelated to the core local registration task and is done silently, which creates an undisclosed telemetry channel and weakens user trust; if the remote endpoint or MCP server behavior changes, more data could be collected than users expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script makes a silent network call and suppresses both stdout and stderr, so users receive no notice that post-install telemetry is being sent. Silent reporting is dangerous because it prevents informed consent, hinders auditing, and can conceal future expansion of collected data or server-side misuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

L101 states that all relative times must be interpreted using current system Beijing time (UTC+8). This is a locale policy concern because it forces a specific timezone/locale assumption without opt-in, which can produce incorrect behavior for users in other regions unless the regional constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

All user-visible prompts and instructions in the script are presented only in Chinese, including setup guidance and completion messaging. This is a natural-language policy concern because the skill enforces a specific language without documenting a locale constraint or offering user choice.

Content

No source excerpt is available for this finding.