Repository navigation
Description
[agent] Found by the scheduled Maven bug-hunt routine (ledger #318).
Summary
vendor writes the committed maven2 tree .socket/vendor/maven/<uuid>/… with only <file>.sha1 sidecars, and wires it as a file:// <repository> with checksumPolicy=fail. Projects that harden Maven's checksums by setting the resolver's aether.checksums.algorithms to SHA-256 and/or SHA-512 without SHA-1 (via -D… or .mvn/maven.config) get this:
- Maven 3.8.8 / 3.9.11: the vendored repo has no checksum in the configured algorithms, so the
failpolicy rejects it with no warning at all. The resolver moves on to Central, which is under the defaultwarnpolicy, and downloads the pristine jar.BUILD SUCCESS, exit 0, unpatched bytes. - Maven 4.0.0-rc-7: the build fails with
Could not transfer artifact … from/to socket-patch-vendor-<uuid> … Checksum validation failed, no checksums available. That is fail-closed, but vendoring breaks a build that worked before. vex(online or--offline) on the fresh checkout still emitsnot_affected/inline_mitigations_already_exist"(vendored)". It prints a stderr warning that the live tree differs, but still makes the attestation.
Impact
Users who opt into SHA-256/512-only checksums are the most security-conscious ones, and for them the vendored patch is silently skipped while VEX says it's applied. Nothing in socket-patch's or Maven's output flags it.
Repro (Linux, JDK 21, Maven 3.9.11)
- Consumer
pom.xmldepends onorg.apache.commons:commons-text:1.10.0. Warm a fresh-Dmaven.repo.local. - Stage
.socket/manifest.json+ blob: a patch that appends a marker toMETA-INF/NOTICE.txt, with real git-sha256 before/after hashes (the same shape ascrates/socket-patch-cli/tests/e2e_vendor_maven_build.rs::stage_manifest). - Run
socket-patch vendor --json --offline --cwd proj. It reportsapplied: 1and wiresfile://${project.basedir}/.socket/vendor/maven/<uuid>withchecksumPolicy=fail. - Fresh checkout: delete the manifest and blobs, and purge
org/apache/commons/commons-textfrom the local repo. echo '-Daether.checksums.algorithms=SHA-256,SHA-512' > proj/.mvn/maven.configmvn -B -Dmaven.repo.local=$M2 org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy-dependencies, then checktarget/dependency/commons-text-1.10.0.jarfor the marker.
Log (3.9.11): one Downloading from socket-patch-vendor-… line, with no WARN/ERROR for it, followed by
[INFO] Downloading from central: …/commons-text-1.10.0.jar
[WARNING] Checksum validation failed, no checksums available from central for …/commons-text-1.10.0.jar
[INFO] Downloaded from central: …/commons-text-1.10.0.jar (238 kB)
BUILD SUCCESS
The jar is PRISTINE. Adding commons-text-1.10.0.{jar,pom}.sha256 + .sha512 sidecars by hand to the vendored leaf makes the same run resolve PATCHED, which confirms the root cause and the fix direction.
Expected vs actual
- Expected: docs/ecosystems.md (Maven row) and the
maven_repo.rsmodule docs say the committed repo is consumed withchecksumPolicy=fail, so that "a tampered jar → checksum failure", and vendored mode must never fall through to the registry silently. The vendored repo should satisfy whichever checksum algorithms Maven is configured for, e.g. by writing.sha256and.sha512(and optionally.md5) next to.sha1. - Actual: the vendored repo can be validated with SHA-1 only. Under a non-SHA-1 algorithm set it is skipped without a sound, and
vexattests anyway.
Matrix (Linux, JDK 21; resolve with maven-dependency-plugin 3.1.2, fresh local repo)
| Maven | default | SHA-512 |
SHA-256 |
SHA-512,SHA-1 |
|---|---|---|---|---|
| 3.6.3 | PATCHED | PATCHED (property ignored) | PATCHED | PATCHED |
| 3.8.8 | PATCHED | PRISTINE, exit 0 | PRISTINE, exit 0 | PATCHED |
| 3.9.11 | PATCHED | PRISTINE, exit 0 (reproduced 3×, via -D and .mvn/maven.config) |
PRISTINE, exit 0 | PATCHED |
| 4.0.0-rc-7 | PATCHED | build fails on the vendored repo | build fails on the vendored repo | PATCHED |
macOS and Windows are untested. The behaviour is resolver-level, so it's expected to match.
Not bisected: every release that has vendored Maven writes .sha1 only (main f6b7fb9, 4.0.0).
Suspect code
crates/socket-patch-core/src/vendor/maven_repo.rs:1015-1037(write_maven_artifactwrites only.sha1)crates/socket-patch-core/src/vendor/maven_repo.rs:23-30(the design note says sha1 alone is enough)maven_repo.rs:1050-1080: the verify/re-run fast path also checks.sha1only, so new sidecars would need to join it.
Activity
mikolalysenko commentedon Sep 30, 2026
[agent] Triaged as priority:p3 (Maven). No duplicate or fix PR found (#258/#322 are about Trusted Checksums on the hosted side, not the vendored repo's sidecar algorithms).
Generated by Claude Code
mikolalysenko commentedon Oct 1, 2026
[agent] Re-triage on main
2463257(v5): this issue affects the single-POM vendored backend only. The v5 reactor backend isn't affected, even though its tree also ships.sha1sidecars only.With
.mvn/maven.configalready containing-Daether.checksums.algorithms=SHA-256, I ran the repo'se2e_vendor_jvm_build::maven_reactorcapstone. The checks were vendor, a fresh-checkout offline build from the root and fromcd a, and a byte-exact revert. It passes on Linux / JDK 21 with Maven 3.9.11 and 4.0.0-rc-7: every module resolvescommons-text-1.10.0-socket.1d3c1fd2.jarfrom.socket/vendor/maven2with the patched NOTICE. The resolve goes throughmaven.repo.local.tail, where Resolver doesn't apply transport checksum algorithms.The single-POM backend code (
vendor/maven_repo.rs:1425,.sha1sidecars only) hasn't changed since the original report, so the original cells stand.Generated by Claude Code
maven: run 4 ledger (#459, #394 comment)
mikolalysenko commentedon Oct 28, 2026
[agent] Closing as completed: the backend this report covers no longer exists on
main(ecd4924).file://<repository>inpom.xmlserving.socket/vendor/maven/<uuid>/withchecksumPolicy=fail) was affected. The v5 reactor backend resolves throughmaven.repo.local.tail, where Resolver doesn't apply transport checksum algorithms. That re-triage rane2e_vendor_jvm_build::maven_reactorwith-Daether.checksums.algorithms=SHA-256and it passed on Maven 3.9.11 and 4.0.0-rc-7.main, the single-POM backend is retired. The module docs atcrates/socket-patch-core/src/vendor/maven_repo.rs:7-11say only its revert remains. Vendoring a root whose ledger still holds amaven_pom_repositoryrecord is refused withlegacy_maven_root(legacy_root,maven_repo.rs:303). So no new vendoring writes the.sha1-only<repository>tree this issue describes.If an SHA-256/512-only setup still builds pristine bytes through the reactor backend, please reopen with the Maven line and how it was configured.
Generated by Claude Code