Back to skill

Security audit

java-optimization

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent Java performance guidance, but it tells users to download and run a remote Java tool without version pinning or checksum verification.

Install only if you want Chinese-language Java/JVM performance guidance. Before following the Arthas command, use an official pinned release and verify its checksum or signature, avoid running it from an admin shell, and be careful with heap dumps or profiling output from systems that may contain secrets.

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:409
Finding
Unpinned Remote JAR Download and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 409-410 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High **Vulnerable Code**: ```bash curl -O https://arthas.aliyun.com/arthas-boot.jar java -jar arthas-boot.jar ``` ### Technical Analysis The Skill instructs users to download a remotely hosted Java archive and execute it immediately. The URL does not identify an immutable, reviewed release, and the instructions do not verify a cryptographic checksum or digital signature before execution. Although HTTPS provides transport encryption and server authentication, it does not guarantee that the artifact itself remains unchanged or trustworthy. If the hosting infrastructure, DNS resolution, certificate chain, release process, or upstream artifact is compromised, the downloaded JAR can be replaced after the Skill has been reviewed. Running `java -jar arthas-boot.jar` then executes the changed payload as native JVM bytecode under the invoking user's account. ### Attack Path 1. An attacker compromises the remote distribution endpoint, its release pipeline, DNS resolution, or another component capable of changing the artifact returned by the URL. 2. The attacker replaces `arthas-boot.jar` with a malicious JAR or modifies the legitimate artifact. 3. A user follows the Skill's documented profiling procedure and downloads the artifact with `curl`. 4. No checksum or signature validation detects that the downloaded file has changed. 5. The user runs `java -jar arthas-boot.jar`. 6. The malicious bytecode executes with the user's operating-system permissions and can access resources available to that account. ### Impact Assessment Successful exploitation provides arbitrary Java code execution with the privileges of the user who follows the instructions. The payload could read or modify files accessible to that user, access environment variables and application credentials, communicate ...[truncated 407 chars]
Remediation
## Remediation Suggestions 1. Pin the download to a specific, reviewed Arthas release rather than using a mutable generic filename. 2. Use an immutable official release URL and document the expected release version. 3. Publish the expected SHA-256 digest in the Skill and verify it before execution. Abort if validation fails. 4. Prefer verification using an official digital signature when the publisher provides signed artifacts. 5. Download the file first, validate it as a separate mandatory step, and only then execute it. 6. Run the tool using a dedicated, least-privileged account and never recommend execution through `sudo` or an administrative shell. 7. Periodically review and update the pinned version and digest through a controlled change-review process. A hardened workflow should follow this pattern: ```bash curl --fail --proto '=https' --tlsv1.2 \ -o arthas-boot.jar \ 'https://<official-release-host>/<pinned-version>/arthas-boot.jar' echo '<reviewed-sha256> arthas-boot.jar' | sha256sum --check - java -jar arthas-boot.jar ``` Replace the placeholders only with an official immutable release URL and a checksum obtained through a trusted publisher channel.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Vague Triggers

Medium
Confidence
92% confidence
Finding
The manifest description says 'Invoke when user needs to optimize Java code performance,' which is operationally broad and lacks boundaries on adjacent areas like database tuning, infrastructure tuning, or non-Java optimization requests. In skill-routing environments, ambiguous invocation criteria can cause misfires and overreach, especially when paired with generic optimization content.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrase list is broad enough to match generic requests such as improving response speed, database optimization, or high CPU/memory usage, which may cause the skill to activate outside a clearly bounded Java performance context. In an agent system, over-broad activation can route unrelated tasks into a specialized skill, leading to inappropriate guidance, reduced reliability, or unsafe assumptions about the target stack.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file sets "language": "zh-CN", which indicates a fixed language/locale preference, but the manifest does not provide opt-in behavior or explain why responses must be limited to that locale. Per policy, forcing a specific language without user choice can be a natural-language policy violation.

Vague Triggers

Medium
Confidence
92% confidence
Finding
Several keywords such as '提高响应速度', '数据库优化', '性能分析', and '接口响应慢' are common technical phrases that are not uniquely tied to Java optimization. In an agent-routing system, such generic activators can over-match ordinary requests and route them into this skill unexpectedly, which is a genuine prompt/skill quality security issue because it expands skill authority beyond intended scope.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger regexes and contexts are broad enough to match generic performance or troubleshooting requests that may not specifically require this Java optimization skill. That can cause unintended invocation, pulling the agent into an overly specialized workflow, increasing the chance of irrelevant guidance, context leakage into the skill, or unsafe automated recommendations in unrelated scenarios.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
Nearly all instructional content is written in Chinese, with no statement that the user may choose another language. For organizations requiring language neutrality or user locale choice, this can be a natural-language policy issue because the skill implicitly defaults to Chinese output.

Static analysis

No suspicious patterns detected.