Skip to content

Hosted and vendored Maven cannot serve a patched classifier jar: the grant covers only the main jar #2200

Open

Description

Summary

A classifier variant of a patched Maven artifact cannot be delivered patched in hosted or vendored mode:

  • hosted refuses with redirect_maven_classifier_unsupported (crates/socket-patch-core/src/patch/redirect/mod.rs:9695): "the Socket patch covers only the main jar";
  • vendored copies the upstream classifier jar and degrades with classifier_unpatched_copy (crates/socket-patch-core/src/vendor/jvm/gradle.rs:502).

Agent mode does handle classifier jars (it swaps each jar leaf it finds).

Why this matters

Classifier jars are how Maven ships platform-specific and alternate builds of the same code (native bundles such as linux-x86_64, jdk8 vs jdk11 builds, shaded). When the fix is in code that the classifier jar also carries, the build keeps the vulnerable copy on its class path, which the tool correctly reports but cannot fix.

Suggested direction

Let the patch service's grant serve a patched jar per classifier (keyed by the classifier and ext qualifiers the manifest already uses for variants), and have hosted/vendored wire each classifier the build declares. Keep today's refusal when the service has no patched jar for a declared classifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions