Back to skill

Security audit

Java手册

Security checks for vulnerabilities and agentic risk

Overview

This Java manual skill appears to be documentation-oriented, but it requests command execution and file-write authority without clear limits or user controls.

Review this skill before installing. It may be useful as a Java standards reference, but grant only the minimum permissions needed. Avoid enabling command execution or broad file writes for routine code review, and do not run it with administrator privileges unless a specific, user-approved task clearly requires it.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:21
Finding

Overprivileged Command Execution and File-Write Capabilities

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 21-24
Vulnerability Type: Excessive tool permissions and violation of least privilege
Risk Level: Medium

Vulnerable Code Snippet

yaml
tools:
- read
- exec
- write

The skill also describes system-command execution at SKILL.md:243 and recommends running with administrator privileges as a response to permission errors at SKILL.md:278.

Technical Analysis

The skill is presented as a Java development standards and code-review reference, for which read-only access is sufficient in its documented primary workflow. Nevertheless, it requests both arbitrary command execution and file-write capabilities.

Granting exec permits commands to run with the privileges of the hosting agent process. Granting write permits modification of files accessible to that process. These permissions substantially exceed those required to read development guidelines and evaluate submitted Java code.

The risk is amplified by the troubleshooting guidance that recommends administrator execution when permissions are insufficient. The skill does not identify a narrowly scoped operation that requires elevation, define an allowlist of commands or writable paths, or require explicit user confirmation before privileged actions.

No concrete malicious command, automatic privilege-escalation mechanism, or embedded executable payload was found. Exploitation therefore depends on the agent acting on malicious or untrusted task content while the excessive permissions are enabled.

Attack Path

  1. A user or agent loads the skill and grants its declared read, exec, and write capabilities.
  2. Untrusted Java source, review instructions, or other task content introduces instructions that induce the agent to execute a command or alter a file.
  3. Because the skill has declared command-execution and write access, the agent may perform the induced action instead of remai ...[truncated 919 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove exec and write from the declared tools and retain only read-only access for documentation lookup and code review.
  2. If file output is genuinely required, request write access only when the user explicitly asks to save a report, and restrict writes to a user-approved output path.
  3. If command execution is required for an optional validation workflow, expose it as a separate opt-in capability with:
    • An explicit command allowlist.
    • Fixed executable paths.
    • Structured arguments rather than shell command strings.
    • Shell metacharacter rejection.
    • Timeouts and resource limits.
    • A restricted working directory.
    • Explicit user confirmation before execution.
  4. Remove the generic recommendation to run as administrator. Document the minimum specific permission needed for each operation and require explicit informed approval for any elevation.
  5. Run the skill in a sandbox with no access to sensitive environment variables, credentials, system directories, or unrelated repositories.
  6. Add a clear trust-boundary rule stating that reviewed source code and user-supplied content are data and must never be interpreted as operational instructions.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Command execution is not justified by the apparent function of providing Java development guidance. Unnecessary exec capability materially increases attack surface because any prompt injection, misuse, or future workflow integration could turn a passive reference skill into a vehicle for arbitrary command execution.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is presented as a Java manual/reference resource, but the documentation later expands its scope to file handling, API integration, and command execution. That mismatch creates a deceptive trust boundary: users may invoke what appears to be a passive reference skill while unknowingly granting it active system-impacting capabilities.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The top-level description frames the skill as a handbook/rules reference, which implies read-only, advisory behavior. Contradictory claims elsewhere about active execution increase the risk of user deception and unsafe invocation because operators may not expect side effects from a documentation-oriented skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation guidance is extremely broad, covering common coding, debugging, testing, and deployment activities. Overbroad triggers increase the likelihood that the skill is invoked in contexts far beyond its stated purpose, which amplifies the risk posed by its write and exec capabilities.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill advertises file writing, external service interaction, and command execution without prominent warnings or consent expectations. Users may not realize the skill can modify files, contact external systems, or run commands, creating a meaningful risk of unintended changes, data exposure, or execution of harmful actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Telling users to run with administrator privileges, without a safety warning or justification, normalizes privilege escalation. If the skill or a related workflow is ever misused, elevated execution would magnify the blast radius to system-wide file changes, persistence, or broader compromise.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The display name, summaries, and primary usage description are written in Chinese, and the document does not indicate that users may choose another language or locale. This can amount to a language policy issue if the skill forces one language experience without opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.