Back to skill

Security audit

java-coding-quality

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Java quality-gate helper that runs disclosed local static-analysis tools and uses user confirmation for higher-impact persistent changes.

Before installing, expect the skill to run local Java build and static-analysis commands, create a .qualitygate directory, append that path to .gitignore, and possibly download Maven/Gradle analysis plugins. Only approve the optional pom/build.gradle persistence step if you want the quality gate committed into the project or CI workflow.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (18)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 50)May include surrounding context.

md
目须先 `mvn compile`);把 `.qualitygate/` 追加进 `.gitignore`。**项目自身 pom 全程零改动**。完整模板见 `references/01-setup.md`。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 76)May include surrounding context.

md
目须先 `mvn compile`);把 `.qualitygate/` 追加进 `.gitignore`。**项目自身 pom 全程零改动**。完整模板见 `references/01-setup.md`。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 84)May include surrounding context.

md
目须先 `mvn compile`);把 `.qualitygate/` 追加进 `.gitignore`。**项目自身 pom 全程零改动**。完整模板见 `references/01-setup.md`。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 78)May include surrounding context.

md
ttern→修复、FindSecBugs 安全规则重点(SQL 注入/弱加密/路径穿越/XXE/SSRF/硬编码密钥/反序列化/XSS/CRLF)→修复 | `references/03-spotbugs-security.md` | NP_/EI_/DM_ 系列 + 安全类,已内联修复 |

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/pmd7-ruleset.xml (reported line 14)May include surrounding context.

text
priority 语义:1=Blocker(bug/事故) 2=Critical(高风险) 3=Major(规范) 4/5=Minor(风格)。
    </description>

    <!-- ============ 一、异常处理 ============ -->

    <!-- 空 catch 吞异常 -->
    <rule ref="category/java/errorprone.xml/EmptyCatchBlock">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/pmd7-ruleset.xml (reported line 108)May include surrounding context.

text
<rule ref="category/java/bestpractices.xml/MethodReturnsInternalArray">
        <priority>3</priority>
    </rule>
    <!-- 构造/方法直接存储传入数组引用 -->
    <rule ref="category/java/bestpractices.xml/ArrayIsStoredDirectly">
        <priority>3</priority>
    </rule>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/pmd7-ruleset.xml (reported line 108)May include surrounding context.

text
<rule ref="category/java/bestpractices.xml/MethodReturnsInternalArray">
        <priority>3</priority>
    </rule>
    <!-- 构造/方法直接存储传入数组引用 -->
    <rule ref="category/java/bestpractices.xml/ArrayIsStoredDirectly">
        <priority>3</priority>
    </rule>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/pmd7-ruleset.xml (reported line 187)May include surrounding context.

text
<rule ref="category/java/bestpractices.xml/SystemPrintln">
        <priority>3</priority>
    </rule>
    <!-- e.printStackTrace() 应替换为日志框架记录 -->
    <rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace">
        <priority>3</priority>
    </rule>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/pmd7-ruleset.xml (reported line 187)May include surrounding context.

text
<rule ref="category/java/bestpractices.xml/SystemPrintln">
        <priority>3</priority>
    </rule>
    <!-- e.printStackTrace() 应替换为日志框架记录 -->
    <rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace">
        <priority>3</priority>
    </rule>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/01-setup.md (reported line 50)May include surrounding context.

md
<packaging>jar</packaging>

    <properties>
        <!-- 与被检项目一致,探测得到的 targetJdk 填这里 -->
        <maven.compiler.release>17</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/01-setup.md (reported line 50)May include surrounding context.

md
<packaging>jar</packaging>

    <properties>
        <!-- 与被检项目一致,探测得到的 targetJdk 填这里 -->
        <maven.compiler.release>17</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/01-setup.md (reported line 56)May include surrounding context.

md
</properties>

    <build>
        <!-- 包装 pom 在 .qualitygate/ 内,上跳一级指向被检项目源码 -->
        <sourceDirectory>${project.basedir}/../src/main/java</sourceDirectory>
        <plugins>
            <plugin>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/01-setup.md (reported line 56)May include surrounding context.

md
</properties>

    <build>
        <!-- 包装 pom 在 .qualitygate/ 内,上跳一级指向被检项目源码 -->
        <sourceDirectory>${project.basedir}/../src/main/java</sourceDirectory>
        <plugins>
            <plugin>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/01-setup.md (reported line 113)May include surrounding context.

md
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <!-- Agent 操作:从被检项目 pom.xml 复制 <dependencies>(compile + provided 作用域)至此。
         使 SpotBugs 能解析第三方类型,减少 missingClasses 误报。
         项目无第三方依赖时可省略此段。 -->
    <dependencies>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/01-setup.md (reported line 113)May include surrounding context.

md
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <!-- Agent 操作:从被检项目 pom.xml 复制 <dependencies>(compile + provided 作用域)至此。
         使 SpotBugs 能解析第三方类型,减少 missingClasses 误报。
         项目无第三方依赖时可省略此段。 -->
    <dependencies>

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest display name is written in Chinese and the entire skill description and instructions are presented only in Chinese, indicating a language-specific constraint. The file does not offer any user opt-in, alternative locale, or justification that this is a region-specific skill, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese, and there is no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Per the policy, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This XML file contains natural-language documentation that appears to require Chinese comprehension, but it does not provide an English alternative, user opt-in, or any stated justification for a Chinese-only locale. Under the policy, forcing a specific language without user choice can be a natural-language policy violation.

Content

No source excerpt is available for this finding.