Skip to content

ci(depcheck): narrow scan to runtime closure#13

Merged
jcputney merged 3 commits into
mainfrom
ci/depcheck-narrow-scope
May 20, 2026
Merged

ci(depcheck): narrow scan to runtime closure#13
jcputney merged 3 commits into
mainfrom
ci/depcheck-narrow-scope

Conversation

@jcputney
Copy link
Copy Markdown
Owner

Summary

The Dependency-Check_Action wrapper with `path: '.'` over-scans the workspace post-`mvn install`. `target/local-repo` (populated by maven-invoker-plugin for IT tests) contains build-time Maven plugin transitives — `plexus-utils 4.0.2` (CVSS 8.8) and `aircompressor 0.27` (CVSS 6.3) — that never ship to consumers but trip the `failOnCVSS=7` gate.

Empirical confirmation that this is a scope problem, not a version problem:

Plugin Latest Still pulls vulnerable transitive?
license-maven-plugin 5.0.0 latest yes — plexus-utils 4.0.2
flatten-maven-plugin 1.7.0 latest yes — plexus-utils 4.0.2
plexus-archiver 4.10.x latest yes — aircompressor 0.27

No plugin bump fixes these.

Approach

Use `mvn dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=target/depcheck-deps` per module. This materializes only the runtime closure (jackson, slf4j, onnxruntime, tika-core, commons-io, magika-java itself) into a dedicated dir. Then `--scan` exactly those two directories. The library JAR is reached transitively via magika-java-tika's depcheck-deps, so no version-pinned paths are needed.

Test plan

  • Manual `workflow_dispatch` on this branch — verify scan completes green
  • Confirm no plexus-utils / aircompressor in scan output
  • Confirm jackson/slf4j/onnxruntime/tika-core/commons-io ARE in scan output (we still catch real consumer-facing CVEs)
  • Verify all 8 required PR checks pass

…noise

The Dependency-Check_Action wrapper with `path: '.'` was scanning the
whole workspace post-`mvn install`, which includes target/local-repo
materialized by maven-invoker-plugin for integration tests. That tree
contains build-time Maven plugin transitives (plexus-utils 4.0.2,
aircompressor 0.27) that never ship to consumers but trip the
failOnCVSS=7 gate.

Empirical check: every relevant plugin's latest version still pins the
same vulnerable transitives, so upgrading plugins doesn't resolve the
finding — it's a scope problem, not a version problem.

Switch to `dependency:copy-dependencies -DincludeScope=runtime` per
module to materialize only the runtime closure into target/depcheck-deps,
then `--scan` exactly those two directories. The magika-java library JAR
itself is reached transitively via magika-java-tika's depcheck-deps, so
no version-pinned paths are needed.
@jcputney jcputney enabled auto-merge (squash) May 20, 2026 16:30
@jcputney jcputney merged commit 80ff6bf into main May 20, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant