Fix the vulnerable dependencies that block the release - #191
Conversation
Rewrite relative replace paths with go mod edit instead of running the gomod-absolutizer, remove its submodule, and upgrade jackson to 2.21.7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID:
Comment |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Releases moved to the ecosystem-workflows GitHub Action (XRAY-137561). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GoDriver runs commands through /bin/sh -c or cmd /c, so replace paths with spaces or shell characters broke the edit or ran as commands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GoDriver runs commands through /bin/sh -c or cmd /c. Values from the scanned go.mod are now referenced from the command instead of quoted into it, so no shell interprets them. On Windows, a replace directive with a double quote is skipped, since cmd cannot escape it inside quotes. The WSL conversion uses WslUtils, and absolute replace paths go through the same resolution as relative ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
go reads and writes a temp copy of go.mod (and go.sum) via GOFLAGS -modfile while running in the project directory, so relative replace paths resolve as they are and nothing from the go.mod reaches a shell. This removes GoScanWorkspaceCreator and its replace rewrite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Set GOWORK=off, since workspace mode rejects -modfile, and start from go env GOFLAGS so values saved with go env -w are kept. The go version check runs without the scan flags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
attiasas
left a comment
There was a problem hiding this comment.
The -modfile scan matches the goal: go runs in the project directory, relative replace paths still resolve from the module root, and writes go to a temp go.mod / go.sum that is deleted afterward. go version and go env GOFLAGS run before the scan flags, and GOWORK=off is set only on the scan driver. The gomod-absolutizer submodule and the old Pipelines release files are fully removed. Jackson 2.21.7 is the right pin.
All 18 unit-test jobs passed (Ubuntu, macOS, and Windows; Java 18/20/22; Go 1.23 and 1.24). Frogbot (scan-pull-request) was still pending.
Not blocking. Three small follow-ups inline.
| DepTree dt = treeBuilder.buildTree(); | ||
| validateDependencyTreeResults(expected, dt); | ||
| assertEquals(Files.readString(projectDir.resolve("go.mod")), goMod); | ||
| assertFalse(Files.exists(projectDir.resolve("go.sum"))); |
There was a problem hiding this comment.
This locks the no-go.sum case, which is enough to show -modfile is in effect: a tidy against the real module would have created go.sum.
testCreateDependencyTree2 is the checksum-mismatch fixture and still does not compare go.mod or go.sum before and after. modTidy passes ignoreErrors=true whenever Go is at least 1.16, so go mod tidy -e can succeed even when sums are wrong. A byte comparison on project2 would cover the case the absolutizer existed for.
| return flag; | ||
| } | ||
| return goModAbsDir; | ||
| String quote = flag.contains("'") ? "\"" : "'"; |
There was a problem hiding this comment.
Go 1.21 and later keep a quoted GOFLAGS path intact. Go 1.16 through 1.20 split GOFLAGS on whitespace and reject this form, so a temp directory under a path with a space (C:\Users\First Last\...) fails the scan. The failure happens before any write, so the project files stay intact.
CI only runs Go 1.23 and 1.24, and the GitHub Windows temp path has no space, so this branch never runs. A path that contains both ' and " is wrapped in one of those quotes and will not parse, with the same fail-closed behavior.
A unit test that builds GOFLAGS for a path containing a space, plus one scan whose temp directory contains a space, would cover it.
| if (runGoThroughWsl) { | ||
| // Windows environment variables reach go inside WSL only when WSLENV lists them. | ||
| String wslEnv = scanEnv.getOrDefault("WSLENV", System.getenv("WSLENV")); | ||
| scanEnv.put("WSLENV", StringUtils.isBlank(wslEnv) ? "GOFLAGS:GOWORK" : wslEnv + ":GOFLAGS:GOWORK"); |
There was a problem hiding this comment.
This appends :GOFLAGS:GOWORK even when those names are already listed. A prior GOFLAGS/p then sits next to a second GOFLAGS. The value is already a Linux path (/mnt/c/...), so path translation should not rewrite it. Skipping names that are already present would make the intent obvious.
This path is not in CI. The workflow runs native Windows, not WSL.
…pe WSLENV Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Xray published XRAY-1097605 for commons-io 1.4, so the maven-example fixture now has four vulnerabilities and the exact count of three fails on every branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Background
The release workflow's audit gate blocks the next release on jackson 2.18.6, and on
golang.org/x/modv0.18.0 plus the runner's Go stdlib, both found through thegomod-absolutizersubmodule.Description
The Go scan runs
goin the project directory withGOFLAGS=-modfile=<temp>/go.mod, so go reads and writes a temp copy ofgo.modandgo.sumwhile relativereplacepaths resolve as written. That replaces copying the project and rewriting its paths with the absolutizer, so the submodule (and the dead JFrog Pipelines release files) are removed. jackson goes to 2.21.7, the lowest version without known CVEs.Tests
GoTreeBuilderTestpasses on macOS, Windows and WSL, and now checks that the scanned project'sgo.modandgo.sumare left untouched.jf auditwith the gate's exclusions reports 0 vulnerabilities.🤖 Generated with Claude Code