Back to skill

Security audit

dependency-security-scan

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Java dependency-audit guide, but it can lead an agent to run Maven or Gradle project code without clear sandboxing or approval safeguards.

Use this skill only when you are comfortable running dependency-audit commands for the target Java project. For untrusted repositories, ask before executing Maven or Gradle, prefer static files and lockfiles first, and run build-tool or scanner commands in a disposable environment without unrelated secrets or broad filesystem access.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
references/03-gradle.md:73
Finding

Execution of Untrusted Project-Controlled Build Logic During Dependency Analysis

Content
View full analysis

Vulnerability Details

File Location: references/03-gradle.md:73-98
Additional Locations: references/05-commands.md:56-83, references/02-maven.md:73-102, references/05-commands.md:9-49
Vulnerability Type: Execution of untrusted Gradle wrapper scripts and build configuration
Risk Level: High

Vulnerable Code

bash
# View the complete dependency tree for all configurations
./gradlew dependencies

# View the dependency tree for a specific module
./gradlew :module:dependencies

# View a specific configuration, such as runtimeClasspath
./gradlew dependencies --configuration runtimeClasspath

# View the dependency tree for a specific configuration
./gradlew dependencies --configuration implementation

# Generate an HTML report
./gradlew htmlDependencyReport

# Locate a specific dependency
./gradlew dependencies --configuration runtimeClasspath | grep commons-lang3

# Check available dependency updates
./gradlew dependencyUpdates

# View the compile classpath
./gradlew dependencies --configuration compileClasspath

The Maven guidance similarly recommends executing project-context commands such as:

bash
mvn dependency:tree
mvn dependency:analyze
mvn versions:display-dependency-updates
mvn org.owasp:dependency-check-maven:check

Technical Analysis

The Skill recommends executing the target repository's Gradle wrapper and Maven build operations without first requiring a trust review, isolation, or explicit authorization.

./gradlew is a repository-controlled executable script. Gradle also evaluates project-controlled settings files, initialization logic, build scripts, plugins, and configuration code before or while running dependency-reporting tasks. Consequently, a nominally read-only command such as ./gradlew dependencies can execute arbitrary code supplied by the audited repository.

Maven commands can likewise process project-controlled extension ...[truncated 1812 chars]

Remediation
View remediation

Remediation Suggestions

  1. Prefer static analysis of pom.xml, lockfiles, version catalogs, and dependency metadata before executing any project-controlled build operation.
  2. Clearly warn that Gradle and Maven commands may execute arbitrary project code, even when the selected task appears read-only.
  3. Require explicit user approval before executing build commands in an untrusted repository.
  4. Inspect Gradle wrapper scripts, gradle-wrapper.properties, wrapper JAR integrity, settings files, initialization logic, build scripts, and declared plugins before execution.
  5. Inspect .mvn/extensions.xml, .mvn/maven.config, parent POMs, plugin declarations, settings, mirrors, profiles, and repository configuration before running Maven.
  6. Execute unavoidable build commands in a disposable sandbox or container with:
    • No mounted SSH keys, cloud credentials, package-manager tokens, or unrelated user files.
    • A read-only source mount where practical.
    • A dedicated temporary home directory and isolated build cache.
    • Restricted outbound networking.
    • No privileged container mode or host socket access.
    • CPU, memory, process, and execution-time limits.
  7. Verify Gradle wrapper distributions and wrapper JARs against trusted checksums.
  8. Treat output generated by the project build as untrusted data and prevent it from altering audit instructions or trusted reports.

T08 · Insecure Dependencies

Warning
Location
references/02-maven.md:93
Finding

Execution of Unversioned Third-Party Maven Plugins

Content
View full analysis

Vulnerability Details

File Location: references/02-maven.md:93-99
Additional Locations: references/04-tools.md:81-92, references/05-commands.md:38-49
Vulnerability Type: Unpinned build-plugin resolution and execution
Risk Level: Medium

Vulnerable Code

bash
# Check dependencies that can be upgraded
mvn versions:display-dependency-updates

# Check available plugin updates
mvn versions:display-plugin-updates

# Scan known vulnerabilities
mvn org.owasp:dependency-check-maven:check

Technical Analysis

The Skill recommends invoking third-party Maven plugins without pinning their versions. Maven may therefore select plugin versions through plugin metadata, configured plugin management, project POM content, local caches, mirrors, and repositories available in the execution environment.

Because Maven plugins execute Java code inside the build process, resolving an unintended or compromised plugin artifact creates a code-execution supply-chain risk. The documentation does not require trusted repository allowlisting, artifact checksum enforcement, signature validation, or isolation before invoking these plugins.

This finding does not establish that the named OWASP or Versions plugins are malicious. The risk arises from mutable, unpinned resolution and from allowing the target project or environment to influence where executable plugin artifacts are obtained.

Attack Path

  1. An attacker controls or influences the audited project's POM, parent POM, plugin management, plugin repositories, Maven settings, or repository mirror configuration.
  2. The Agent follows the Skill and invokes an unversioned third-party plugin.
  3. Maven resolves the plugin or associated dependencies using attacker-influenced or compromised resolution sources.
  4. The selected plugin artifact is downloaded or loaded from a poisoned local cache.
  5. Maven executes the artifact with the audit process's permission ...[truncated 858 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every executable Maven plugin to a reviewed version, preferably in a trusted audit-specific POM or invocation profile.
  2. Avoid inheriting plugin versions and repositories from the untrusted target project when running security scanners.
  3. Restrict plugin and dependency resolution to an explicit allowlist of trusted HTTPS repositories or an internally controlled artifact proxy.
  4. Enforce artifact checksums or signatures and reject checksum mismatches.
  5. Use a clean, isolated local Maven repository for each audit to prevent cache poisoning and cross-project contamination.
  6. Review Maven settings, mirrors, active profiles, parent POMs, plugin repositories, and .mvn/extensions.xml before plugin execution.
  7. Run dependency scanners outside the target project's build lifecycle where supported.
  8. Execute plugins in a disposable sandbox without unrelated credentials and with restricted outbound network access.
  9. Record the exact plugin version, repository origin, and artifact digest in the resulting audit report for reproducibility.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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 (11)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description is written entirely in Chinese and provides no indication that users may choose another language or locale. This can violate language/locale policy when a skill implicitly constrains interaction to a specific language without documenting user choice or a justified regional scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire skill guidance is written in Chinese and does not offer any language choice or indicate that Chinese is optional. Under the stated policy, forcing a specific language without user opt-in is a natural-language locale violation unless the regional constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The entire skill file is written in Chinese and does not indicate that the language is optional or that users may choose another locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/04-tools.md (reported line 40)May include surrounding context.

osv-scanner -r . --exclude /path/to/vendor

直接调用 API 查询单个包

curl -X POST https://api.osv.dev/v1/query -d
'{"package":{"name":"org.apache.commons:commons-lang3","version":"3.12.0"}}'

text

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/04-tools.md (reported line 40)May include surrounding context.

osv-scanner -r . --exclude /path/to/vendor

直接调用 API 查询单个包

curl -X POST https://api.osv.dev/v1/query -d
'{"package":{"name":"org.apache.commons:commons-lang3","version":"3.12.0"}}'

text

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file is entirely framed as a Chinese-language output template and states a default output behavior unless the user explicitly requests another format. This creates a locale/language constraint without offering a language choice or documenting a justified region-specific limitation, which matches the language policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

该 README 全文使用中文描述技能用途、流程和说明,但没有说明这是面向特定中文用户群体,或提供可选语言/locale。根据规则,未获用户选择或缺少合理说明的固定语言要求属于自然语言层面的语言/locale 政策风险。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

该 markdown 文件的标题、说明和操作指引全部以中文呈现,且未说明这是面向特定中文用户群体的区域化技能,也未给出可选语言。按照语言/locale 政策,若技能强制单一语言而没有用户选择或明确正当化,属于自然语言层面的政策问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

该文件的标题和全部说明内容均仅以中文呈现,没有说明这是面向特定中文环境的区域性技能,也没有提供语言/locale 选择。按规则,强制单一语言且无用户选择可能构成语言/locale 政策问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

该文档从标题到全部说明均使用中文,未见提供用户语言选择、双语说明或明确的区域性适用声明。根据规则,若技能在自然语言层面强制特定语言且无用户选择或合理说明,可构成语言/locale 策略违规。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file is entirely Chinese-language instructional content, which can constitute a language/locale policy issue when no user opt-in or justification is provided. The file does not indicate that the skill is region-specific or that users may choose another language.

Content

No source excerpt is available for this finding.