Back to skill

Security audit

Java Code Format Review

Security checks for vulnerabilities and agentic risk

Overview

The skill is a Java formatting review guide, but it tells agents to run repository build tools and optional auto-fix commands without enough scoping or safety controls.

Install only if you want a Java-focused review skill and are comfortable with it recommending broad code-quality checks. Before letting an agent follow its automated steps, treat target repositories as untrusted: avoid running ./gradlew or Maven plugin goals unless you have reviewed the project or are using an isolated environment, and require a separate confirmation before applying auto-fixes.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Error
Location
SKILL.md:863
Finding

Unsafe Execution of Repository-Controlled Build Tools and Third-Party Plugins

Content
View full analysis
&1 | head -30 which mvn && mvn spotless:check 2>&1 | head -30 which mvn && mvn pmd:check -q 2>&1 | head -30 which mvn && mvn spotbugs:check -q 2>&1 | head -30 # === Gradle projects === ./gradlew spotlessCheck 2>&1 | head -30 ./gradlew pmdMain 2>&1 | head -30 ./gradlew spotbugsMain 2>&1 | head -30 # === Standalone tools === which google-java-format && find . -name "*.java" \ -not -path "*/target/*" -not -path "*/build/*" | \ xargs google-java-format --set-exit-if-changed -n 2>&1 | head -30 # === Alibaba P3C rule scan (if integrated) === which mvn && mvn p3c:p3c-check -q 2>&1 | head -30 ``` The optional automatic remediation section also instructs the agent to execute build tools and modify source files: ```bash # Maven: Spotless auto-format (google-java-format) mvn spotless:apply # Gradle: Spotless auto-format ./gradlew spotlessApply # Standalone: google-java-format direct fix find . -name "*.java" -not -path "*/target/*" -not -path "*/build/*" | \ xargs google-java-format --replace ``` ### Technical Analysis The review workflow executes build commands within the repository being reviewed without first establishing that the repository and its build configuration are trusted. In particular, `./gradlew` is a repository-provided executable. A malicious project can replace this wrapper with an arbitrary script, causing direct command execution when any Gradle check is invoked. Gradle build files and initialization logic may also execute code during configuration, before the requested formatting task runs. Maven goals present a related supply-chain risk. Maven can resolve and execute plugins declared by the project or requested on the comma ...[truncated 2360 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are broad enough to overlap with generic review requests like 'review code format' and adjacent code-review tasks, increasing the chance that this skill is auto-selected in situations where a narrower or different skill should handle the request. In an agentic system, overbroad activation can lead to unintended execution of this skill's broader workflow and recommendations, including out-of-scope analysis steps.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly states it is for formatting-only review, but its workflow directs the agent to run PMD, SpotBugs, and similar analyzers that assess bugs, reliability, and security concerns beyond formatting. This scope expansion can cause the skill to overreach, produce off-mission judgments, and interfere with other review workflows or specialized skills the user expected to invoke separately.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manual checklist includes many non-format criteria such as swallowed exceptions, resource handling, money precision, thread safety, and null-safety, which are functional, reliability, or security review topics rather than formatting. Because the skill is advertised as a formatting-consistency reviewer, this mismatch can mislead an orchestrator or user into granting it authority to make broader code-quality decisions than intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
73% confidence
Finding

The description says the skill is 'Optimized for Java' and 'Java-centric' and specifically enforces conventions from the Alibaba Java Development Manual. This is a natural-language constraint on style/organizational policy that is not presented as a user choice or clearly bounded to an explicitly opt-in Java-only context.

Content

No source excerpt is available for this finding.