Fix #258: state the real Maven Trusted Checksums floor - #322
Mikola Lysenko (mikolalysenko) wants to merge 6 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
Hosted Maven writes a Trusted Checksums pin under .mvn/, but Maven 3.9.0-3.9.3 and every older line never enforce it. A re-signed jar with a matching .sha1 then installs without error. When .mvn/wrapper/maven-wrapper.properties pins such a release, scan now warns redirect_maven_trusted_checksums_unenforced. It still writes the pin, and the version suffix still fails closed. Refs #258. Assisted-by: Claude Code:claude-opus-5-5
The real-Maven hosted capstone treated every 3.9 release as enforcing the .mvn/checksums pin, but enforcement starts at 3.9.4. Fix the gate, pin the Maven under test through the wrapper so the capstone also checks the new warning, and add CI legs on 3.9.3 and 3.9.4. Refs #258. Assisted-by: Claude Code:claude-opus-5-5
The docs and 4.0.0 notes said Maven 3.9+ enforces the hosted pin. State the 3.9.4 floor, why 3.9.0-3.9.3 ignore it, and the new redirect_maven_trusted_checksums_unenforced warning. Refs #258. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
|
[agent] CI note. Generated by Claude Code |
The unenforced-pin warning fired only on the run that wrote the .mvn/checksums pin. Re-scanning a project that was already pinned stayed silent, even though the wrapper's Maven still ignores the pin. Now the warning depends on whether the Socket pin is in place after the run, not on whether this run wrote it. Refs #258. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
|
[agent] CI note for c6b068d. Generated by Claude Code |
main now builds the hosted read list from the format registry, so the Maven wrapper file moves there as a read-only maven row. The pinned candidate-list test lists it too. The CHANGELOG entry is rewritten in v5's short style. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 18ff786. Configure here.
|
On merge commit 18ff786, As far as I can tell this failure isn't caused by this PR:
I don't know of an existing fix. I've re-run the failed job once. If it fails again, I'll treat it as real and investigate. Generated by Claude Code |
|
On 18ff786, I don't think this PR caused it. The test writes an I tried to re-run the failed job, but GitHub refused while other jobs in that run were still going. I'll re-run it once when the run finishes. If it fails again, I'll push the retry below, since it only changes the test. No fix exists yet. The repo already handles this race in let out = {
let deadline = std::time::Instant::now() + std::time::Duration::from_secs(10);
loop {
match Command::new(&npx)
.args(["-y", "@socketsecurity/socket-patch", "apply", "--silent", "--ecosystems", "npm"])
.output()
{
Ok(out) => break out,
Err(e) if e.raw_os_error() == Some(26) && std::time::Instant::now() < deadline => {
std::thread::sleep(std::time::Duration::from_millis(20));
}
Err(e) => panic!("spawn the npx shim: {e:?}"),
}
}
};Generated by Claude Code |
|
[burn-down agent] Ready for review on Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Fixes #258
Summary
Hosted Maven mode writes a Trusted Checksums pin (
.mvn/maven.configand.mvn/checksums/checksums.sha256). Maven 3.9.0 to 3.9.3 never enforce it. The docs, the 4.0.0 notes and the e2e test gate all said every 3.9 release does. On those releases, a Socket-served jar re-signed with a matching.sha1installs without error..mvn/wrapper/maven-wrapper.propertiespins a Maven older than 3.9.4 and the Socket pin is in place,scan --mode hostedwarnsredirect_maven_trusted_checksums_unenforced, with an upgrade hint. That covers both a run that writes the pin and a re-scan of a project that was already pinned. The CLI still writes the pin: a wrapper upgrade makes it effective, and the version suffix still fails closed. The wrapper file is only read, never edited: it is aHOSTED | PRESENCE_ONLYmaven row in the v5 format registry (crates/socket-patch-core/src/formats/registry.rs). Without a wrapper there's no reliable way to know the project's Maven, so the CLI stays silent and the docs state the floor.Mvn::enforces_trusted_checksumsnow starts at 3.9.4.e2e_redirect_maven_buildlegs on 3.9.3 (last release that ignores the pin) and 3.9.4 (first that enforces it).docs/ecosystems.md, the CLI_CONTRACT and a CHANGELOGFixedentry now state the real floor and the reason for each version range.Root cause
The resolver features the config relies on arrived in stages:
${session.rootDirectory}inmaven.configis not interpolated, so the summary file is never found.checksumAlgorithms=SHA-256is ignored and only SHA-1 is checked.The gate and docs assumed all of 3.9 enforced, and CI only ran 3.9.16.
Out of scope: writing a
checksums.sha1summary, the issue's optional item 4. Hosted mode has no SHA-1 for the patched jar or pom, since the serve route supplies only sha256. Even with one, 3.9.0/3.9.1 would still fail on${session.rootDirectory}.Merge with v5 (#277)
maingained the v5 workflow after this PR was green. 18ff786 merges it in as a merge commit; nothing was rebased or force-pushed. Two conflicts:scan/hosted.rs: v5 builds the hosted read list from the format registry, so the wrapper file moved there. The by-value pin testredirect_candidates_are_pinned_by_valuenow lists it.CHANGELOG.md: the entry is rewritten in v5's short style.Test evidence
cargo test -p socket-patch-core --all-features --lib -- maven_pom_trusted_checksums maven_wrapper_versiongave 3 passed and 1 failed.maven_pom_trusted_checksums_warns_when_the_wrapper_maven_ignores_themfailed with3.9.0: [].maven_pom_trusted_checksums_unenforced_warning_survives_a_rescanfails on aedb117 (warnings[]) and passes on c6b068d.maven_pom*/maven_wrapper*/formats::registrycore tests pass.hosted_memory_engine,hosted_memory_parity,in_process_get_hosted_ecosystemsande2e_mavenpass.e2e_redirect_maven_buildpasses on 3.9.3 (warning present; re-signed jar accepted) and on 3.9.4 (no warning; trusted-checksums rejection).nobody.>= 3.9) fails the same e2e.space-unicode agent.test-release, an ETXTBSY race in the vlt harness testvlt_e2e_harness_npx_shim_forwards_the_args_after_the_package. A retry for it is proposed in the PR comments.🤖 Generated with Claude Code
https://claude.ai/code/session_01SKHTWrnMW6VVJm1gnMnYdz
Generated by Claude Code