You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Other loadable copies of a patched class go undetected: META-INF/versions copies in multi-release jars, nested jars in BOOT-INF/lib and WEB-INF/lib, shaded copies #2199
When a patch replaces a class in a jar, other copies of the same class that the JVM can load are not detected:
META-INF/versions/<n>/ copies in a multi-release jar (a Java 9+ runtime loads the versioned copy, not the base one);
the same classes relocated or copied into another artifact (shaded/uber jars);
nested jars under BOOT-INF/lib/ (Spring Boot) and WEB-INF/lib/ (war).
I found no handling of META-INF/versions, Multi-Release, WEB-INF or shading under crates/ or docs/. BOOT-INF appears only in a reader test (crates/socket-patch-core/src/patch/jar_members.rs:1225), which shows a fat jar can be read, not that nested jars are discovered or patched. Copies in a declared classifier jar ARE detected today (classifier_unpatched_copy, crates/socket-patch-core/src/vendor/jvm/gradle.rs:502), so the mechanism exists for one kind of copy.
Why this matters
A patched base class with an unpatched META-INF/versions/9 copy leaves the vulnerable code running on every modern JVM while the patch reads as applied. Multi-release jars are common in widely used libraries (for example log4j-api and h2).
Suggested direction
Multi-release: when a record lists a/B.class and the installed jar has META-INF/versions/*/a/B.class that the record does not list, treat it like classifier_unpatched_copy: degrade and withhold VEX. (The patch service should list the versioned copies; this is the client-side check that it did.)
Nested jars: discover BOOT-INF/lib/*.jar and WEB-INF/lib/*.jar in build outputs as places a patched artifact can also live, at least to report them.
Shaded copies: out of reach in general; a note in docs/ecosystems.md would set expectations.
[agent] #2411 is merged and covers the multi-release part of this issue. I am releasing the claim; the rest is open for whoever takes it.
Done by #2411: a patch that changes a/B.class in a multi-release jar is checked against the jar's META-INF/versions/<N>/a/B.class copies. A copy the patch does not list and that does not hold the patched bytes is reported: agent apply fails the package, apply --check and vex do not vouch for it, and vendored mode warns.
Still open here:
Nested jars (BOOT-INF/lib/, WEB-INF/lib/) and shaded or relocated copies of a patched class are not detected. The docs and the contract now say so.
Hosted mode does not read the jar at scan time, so scan --mode hosted reports nothing; vex judges a hosted pin's jar only where a local cache holds it.
Whole-jar records list no members, so there is nothing to compare.
One thing for the maintainers from that PR: agent apply exits 1 on every run for an affected patch until a patch that also lists the versioned copy exists. If many published patches are member-keyed patches of multi-release jars, that is worth a count before the next release.
Activity
mikolalysenko commentedon Dec 1, 2026
[agent] Claiming this issue. Branch: fix/maven-multi-release-copies.
Generated by Claude Code
mikolalysenko commentedon Dec 2, 2026
[agent] #2411 is merged and covers the multi-release part of this issue. I am releasing the claim; the rest is open for whoever takes it.
Done by #2411: a patch that changes
a/B.classin a multi-release jar is checked against the jar'sMETA-INF/versions/<N>/a/B.classcopies. A copy the patch does not list and that does not hold the patched bytes is reported: agentapplyfails the package,apply --checkandvexdo not vouch for it, and vendored mode warns.Still open here:
BOOT-INF/lib/,WEB-INF/lib/) and shaded or relocated copies of a patched class are not detected. The docs and the contract now say so.scan --mode hostedreports nothing;vexjudges a hosted pin's jar only where a local cache holds it.One thing for the maintainers from that PR: agent
applyexits 1 on every run for an affected patch until a patch that also lists the versioned copy exists. If many published patches are member-keyed patches of multi-release jars, that is worth a count before the next release.