Back to skill

Security audit

Java Performance Analyzer

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real Java diagnostics tool, but it uses unsafe high-impact defaults for SSH credentials, remote installation, live JVM control, and an exposed management API.

Install only if you fully trust the publisher and target environment. Prefer SSH keys or a secret manager instead of passwords, do not store SSH passwords in agent memory, bind Arthas to localhost behind an SSH tunnel, remove or restrict arbitrary Arthas commands, verify downloaded binaries, and stop/clean up Arthas after each session.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/install-arthas.sh:25
Finding

Remote Shell Command Injection Through Unvalidated Installation Parameters

Content
View full analysis
/dev/null || echo NOT_FOUND") if [[ "$CHECK_RESULT" != *"NOT_FOUND"* ]]; then echo "Arthas is installed: $ARTHAS_DIR/arthas-boot.jar" else sshpass -p "$SSH_PASS" ssh "$SSH_USER@$SSH_HOST" "mkdir -p $ARTHAS_DIR && cd $ARTHAS_DIR && curl -O https://arthas.aliyun.com/arthas-boot.jar" fi JAVA_PID=$(sshpass -p "$SSH_PASS" ssh "$SSH_USER@$SSH_HOST" "ps -ef | grep java | grep $PROCESS_NAME | grep -v grep | awk '{print \$2}' | head -1") ATTACHED=$(sshpass -p "$SSH_PASS" ssh "$SSH_USER@$SSH_HOST" "ps -ef | grep arthas | grep $JAVA_PID | grep -v grep || echo NOT_ATTACHED") sshpass -p "$SSH_PASS" ssh "$SSH_USER@$SSH_HOST" "cd $ARTHAS_DIR && nohup java -jar arthas-boot.jar $JAVA_PID --target-ip 0.0.0.0 --http-port 8563 > arthas.log 2>&1 &" ``` ### Technical Analysis The script places `ARTHAS_DIR` and `PROCESS_NAME`, which are supplied as positional command-line arguments, directly inside double-quoted command strings sent to a remote shell over SSH. Local assignment quoting does not make these values safe after interpolation into the remote command. Shell metacharacters such as semicolons, command substitutions, pipes, redirections, and logical operators can alter the command interpreted by the remote shell. The vulnerable variables are used in several command contexts: - `ARTHAS_DIR` is inserted into `ls`, `mkdir`, `cd`, `java`, and log-file paths. - `PROCESS_NAME` is inserted into a shell pipeline containing `grep`. - Values derived through these commands are later reused in additional remote commands. No allowlist validation or shell-safe remote ...[truncated 1088 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/install-arthas.sh:35
Finding

SSH Password Exposure Through Process Arguments and Persistent Memory Guidance

Content
View full analysis
/dev/null || echo NOT_FOUND") sshpass -p "$SSH_PASS" ssh "$SSH_USER@$SSH_HOST" "mkdir -p $ARTHAS_DIR && cd $ARTHAS_DIR && curl -O https://arthas.aliyun.com/arthas-boot.jar" JAVA_PID=$(sshpass -p "$SSH_PASS" ssh "$SSH_USER@$SSH_HOST" "ps -ef | grep java | grep $PROCESS_NAME | grep -v grep | awk '{print \$2}' | head -1") ATTACHED=$(sshpass -p "$SSH_PASS" ssh "$SSH_USER@$SSH_HOST" "ps -ef | grep arthas | grep $JAVA_PID | grep -v grep || echo NOT_ATTACHED") HTTP_CHECK=$(sshpass -p "$SSH_PASS" ssh "$SSH_USER@$SSH_HOST" "curl -s -o /dev/null -w '%{http_code}' http://localhost:8563/api || echo FAILED") sshpass -p "$SSH_PASS" ssh "$SSH_USER@$SSH_HOST" "tail -20 $ARTHAS_DIR/arthas.log" ``` The skill instructions also direct the agent to inspect persistent memory for credentials: ```markdown Before analysis, check whether `MEMORY.md` already contains: - SSH address, username, password - Java process name - Arthas/MCP configuration status ``` The documented installation interface requires the password as a positional argument: ```bash scripts/install-arthas.sh ``` ### Technical Analysis The installer receives the SSH password as a command-line argument and repeatedly supplies it to `sshpass` through the `-p` option. Command-line secrets can become visible through process inspection, debugging output, command histories, audit systems, monitoring agents, CI logs, or wrapper-process telemetry. The skill documentation additionally treats the SSH password as information that may be retained in `MEMORY.md`. N ...[truncated 1468 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/install-arthas.sh:69
Finding

Unauthenticated Arthas Management API Exposed on All Network Interfaces

Content
View full analysis
arthas.log 2>&1 &" ``` The MCP wrapper exposes a tool for arbitrary Arthas commands: ```javascript { name: 'arthas_command', description: 'Execute any Arthas command', inputSchema: { type: 'object', properties: { command: { type: 'string', description: 'Complete Arthas command' } }, required: ['command'] } } ``` ```javascript case 'arthas_command': command = args.command; break; ``` The command is sent over plaintext HTTP without authentication: ```javascript const options = { hostname: ARTHAS_HOST, port: ARTHAS_PORT, path: '/api', method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(postData) }, timeout: 30000 }; ``` ### Technical Analysis Binding Arthas with `--target-ip 0.0.0.0` makes its HTTP management endpoint listen on every available interface rather than only the loopback interface. This conflicts with the documented design in which the service should be reached through an SSH tunnel. No API authentication, authorization token, TLS configuration, or source-address restriction is configured by the project. The MCP wrapper also includes an unrestricted `arthas_command` capability instead of limiting operations to a narrow diagnostic allowlist. Arthas is attached directly to a live JVM and supports highly privileged diagnostic and state-changing operations. The project reference lists commands such as: ...[truncated 1999 chars]
Remediation
View remediation

T03 · Remote Payload Retrieval and Execution

Warning
Location
scripts/install-arthas.sh:39
Finding

Unpinned and Unverified Remote JAR Download Is Executed on the Target Server

Content
View full analysis
arthas.log 2>&1 &" ``` ### Technical Analysis The installer downloads an executable JAR from an unversioned URL and executes it without checking a cryptographic digest or trusted signature. The URL can return different content at different times, meaning the effective code executed by the skill can change after the skill itself has been reviewed. HTTPS protects transport under normal conditions but does not provide artifact immutability. It does not mitigate every relevant threat, including: - Compromise of the download server or release infrastructure - Unauthorized upstream artifact replacement - DNS or certificate-authority compromise - Misconfiguration of an intermediary - A mutable URL being updated to a different release - A corrupted or incomplete response being retained The `curl` invocation also omits explicit failure handling such as `--fail`, and the script does not pin an expected release version. ### Attack Path 1. An attacker compromises or influences the server, DNS resolution, TLS trust path, or release process associated with the download URL. 2. The unversioned URL returns a modified `arthas-boot.jar`. 3. The installer saves the file without verifying its expec ...[truncated 755 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared purpose suggests a performance-analysis assistant, but the actual behavior includes remote host login, password-based automated authentication, downloading software onto the target, attaching to a live JVM, and exposing a service port. That mismatch is dangerous because users may consent to diagnostics without understanding that the skill performs privileged remote actions that can alter production systems and expand attack surface.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly requests SSH host, username, password, and process details, then uses those secrets for automated remote access, but it provides no credential-safety guidance, minimization policy, masking, storage limits, or warning about production sensitivity. This is dangerous because it normalizes plaintext secret collection and increases the risk of credential leakage, misuse, replay, or accidental retention in logs or memory.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill exposes a generic arthas_command tool that forwards arbitrary user-supplied Arthas commands directly to the remote Arthas API with no allowlist, validation, or safety gating. In the context of a remote JVM diagnostics wrapper, this breaks the intended narrow diagnostic scope and enables potentially destructive, privacy-invasive, or destabilizing operations beyond the predefined performance-analysis tools.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Arbitrary Arthas command execution is accepted from input and sent verbatim to the remote API without any user-facing warning or safety review. Since Arthas supports commands that can inspect sensitive runtime state, decompile code, dump data, or alter JVM behavior, this creates a powerful unsafeguarded remote diagnostic channel whose danger is amplified by the skill's remote-analysis purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script starts a persistent remote Java background process with nohup and enables an HTTP management interface, but gives no explicit warning that it is opening a long-lived administrative surface on the target host. In the context of a JVM diagnostic tool, this increases the chance an operator unintentionally leaves a sensitive management endpoint running and reachable.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill instructs the agent to use shell/environment capabilities for SSH, process inspection, SCP, and remote diagnostics, but it does not declare any explicit tool scope or allowed-tools boundary. This increases the risk of overbroad execution and makes it harder to constrain what commands the agent may run when handling sensitive production systems and credentials.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger conditions include broad phrases like '帮我排查 xxx 问题' and '分析下 xxx 性能', which can match ordinary troubleshooting requests and invoke a skill capable of remote shell access and production JVM manipulation. Because this skill can handle credentials and perform invasive diagnostics, accidental activation materially raises the chance of unauthorized or surprising actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

文件整体说明、触发短语和交互模板均固定为中文,没有说明可根据用户语言偏好切换。这会造成语言/locale 策略风险,特别是在多语言环境下,技能表现为默认强制中文而非用户选择。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The reference advertises sensitive-inspection features such as sysenv, decompilation (jad elsewhere in the document), and an unrestricted arthas_command passthrough without clear warnings or guardrails. In a remote troubleshooting skill, this increases the chance of exposing secrets, proprietary code, credentials, or other sensitive runtime data during routine analysis.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The cheat sheet includes mc and retransform, which enable compiling and hot-swapping code in a live JVM. In a skill framed as performance diagnosis, exposing mutation capabilities materially expands the agent from observation into runtime modification, creating risk of unauthorized code changes, persistence, service instability, or abuse if the agent can invoke these commands remotely.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

vmoption --set and logger --level allow live JVM/runtime mutation rather than passive inspection. In the context of a remote analysis skill, these commands can alter application behavior, weaken operational safeguards, increase log exposure, or destabilize production systems without being necessary for routine diagnostics.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The heapdump tool writes a heap dump to an arbitrary path supplied by the caller, and heap dumps can contain credentials, tokens, PII, and application secrets resident in memory. Because the tool provides no warning, confirmation, path restriction, or retention controls, it can create sensitive forensic artifacts on disk that increase exposure risk and may consume significant storage on production systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script takes the SSH password as a positional argument and passes it to sshpass, which commonly exposes credentials through shell history, process listings, audit logs, and CI/job telemetry. This creates a significant risk of credential disclosure even if the remote connection itself succeeds securely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script downloads a JAR from the network onto a remote host and executes multiple remote shell commands over SSH. While some progress output is printed, there is no explicit warning that the script will modify the remote system by creating directories and fetching software, which is a safety-relevant operation affecting system integrity.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
93% confidence
Finding

Using nohup starts Arthas as a detached, persistent process on the remote host, allowing the management service to outlive the initiating session. In combination with the exposed HTTP API, this creates a lasting administrative foothold that may remain active beyond the intended troubleshooting window.

Content

Scanner excerpt · scripts/install-arthas.sh (reported line 71)May include surrounding context.

sh
echo ""
    echo "=== 启动 Arthas ==="
    # 启动 Arthas 并附着,启用 HTTP API
    sshpass -p "$SSH_PASS" ssh "$SSH_USER@$SSH_HOST" "cd $ARTHAS_DIR && nohup java -jar arthas-boot.jar $JAVA_PID --target-ip 0.0.0.0 --http-port 8563 > arthas.log 2>&1 &"
    
    # 等待启动
    echo "等待 Arthas 启动..."

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script launches Arthas with --target-ip 0.0.0.0, exposing its HTTP management API on all network interfaces rather than limiting it to localhost. Because Arthas provides deep JVM inspection and control capabilities, broad exposure can let unintended remote parties access sensitive diagnostics or issue management actions if network controls are weak or absent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

A language-specific document can violate organizational language/locale policy when it forces a single language without user opt-in or justification. This file contains only Chinese content and does not indicate that it is a region-specific resource or provide alternatives.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

All comments and user-visible output in the script are written in Chinese, which imposes a specific language on users without any opt-in or alternative. This can violate language or locale policy when a skill is expected to be usable across a broader audience.

Content

No source excerpt is available for this finding.