A security update that is a downgrade
For five nights in a row, my dependency bot proposed the same security update, and five times the build broke on it. Only a closer look showed why: the update would have set a library back to where it stood in January, while the code in use was from September.
TL;DR
TL;DR: A Go pseudo-version names a commit, not a release. If no release tag is an ancestor of that commit, the version starts at v3.0.0 and sorts below every fixed tag, even when the commit has long contained the fix. OSV only compares versions, reports the dependency as vulnerable, and the bot plans an "update" to an older release. Whether the fix is in is answered by the commit graph, not by a version comparison. And a rule with enabled: false deliberately does not stop a security update.
What happened
Grafana Alloy does not pull in github.com/grafana/loki/v3 as a release but as a pseudo-version of a commit on main: v3.0.0-20260915071729-5cf8c23a258d, from September 15, 2026.
Loki has CVE-2026-21726, a path traversal in the Ruler API at /loki/api/v1/rules/{namespace}. It gets around the old fix for CVE-2021-36156, which checked the namespace only after a single URL decode, so double-encoded sequences slipped through. OSV gives the affected range as a semver range: introduced at 0, fixed in 3.6.4. The Go vulnerability database lists the same case as GO-2026-5115 with "before v3.6.4", though marked unreviewed and without any affected packages or symbols.
For a plain version comparison, that settles it. v3.0.0-2026… is below 3.6.4, so the dependency counts as affected, and my bot proposed 3.6.4 as a security fix.
It never built. Loki 3.6.4 imports a Prometheus package that Alloy's Prometheus fork does not have. So from October 29 to November 3 the bot reopened the merge request every night, and every night the pipeline failed at the same spot.
How a pseudo-version gets its number
A pseudo-version has three parts: a base prefix, the commit timestamp in UTC, and the first twelve characters of the commit hash. The prefix is what matters. The Go toolchain derives it from the nearest semver tag that is an ancestor of the commit. If v1.2.3 comes before it, you get v1.2.4-0.20260915071729-abcdefabcdef, and the version sorts neatly between 1.2.3 and 1.2.4.
If the toolchain finds no such tag, the only base left is vX.0.0, which for Loki means v3.0.0. The result is a pre-release of 3.0.0, so it sorts below every 3.x release, no matter how recent the commit is. The Go proxy resolves the Alloy commit exactly that way:
curl -s proxy.golang.org/github.com/grafana/loki/v3/@v/5cf8c23a258d.info
{"Version":"v3.0.0-20260915071729-5cf8c23a258d","Time":"2026-09-15T07:17:29Z", …}
So as far as the toolchain is concerned, no v3 tag is an ancestor of this main commit. That fits with Loki building its releases on separate release branches and bringing fixes there as backports.
That names the real problem. The number tells you when a commit was made, but nothing about which changes it contains. The semver range in the advisory is not wrong, it is simply blind to this kind of version.
The proof is in the commit graph
The fix is loki#20437. It landed on main on January 15, 2026 as 9f5d215. It reached 3.6.4 as a backport through #20463, released on January 21.
So the right question is not which number is bigger, but whether the fix commit is an ancestor of the commit in use. GitHub's compare API answers that without cloning anything:
gh api repos/grafana/loki/compare/9f5d215...5cf8c23 \
--jq '.status, .ahead_by, .behind_by'
ahead
2097
0
ahead with behind_by 0 means the fix commit is fully part of the history of the commit in use. The September code sits 2097 commits after the fix and contains it. The "update" to 3.6.4 would have rolled back eight months of development.
Locally, a lean clone does the same:
git clone --filter=blob:none github.com/grafana/loki.git
cd loki
git merge-base --is-ancestor 9f5d215 5cf8c23 && echo "fix included"
One detail can easily cost you time here. Check against the fix commit on main, not against the release tag. The backport in 3.6.4 is a separate commit with its own hash, and v3.6.4 is not an ancestor of the main commit. Use the tag and you get a no, even though the fix is in.
Finding pseudo-versions in your own module graph
This is not a one-off. Anywhere a project pins a dependency to a commit instead of a release, the same thing can happen. In source code, a look at the module graph finds those spots:
go list -m -json all \
| jq -r 'select(.Version and (.Version | test("[0-9]{14}-[0-9a-f]{12}$")))
| "\(.Path) \(.Version)"'
For a finished binary you don't need the source. Go writes the module versions into the build info, and go version -m reads them back out:
go version -m ./alloy | grep grafana/loki
Every hit with a vX.0.0- prefix is a case where a semver range tells you nothing reliable. Whether an alert is right is then decided by the commit graph alone. If the commit predates the fix, the alert is real, and the release update may even be the right answer.
Alloy itself shows how common this is. The go.mod of Alloy 1.21.2 lists 1083 modules, 134 of them as pseudo-versions. On top of that come 23 replace directives, 16 of which point to a pseudo-version. The Loki line there carries the comment // k324 release. To Alloy it is a release; to semver it is v3.0.0. Only part of these modules ends up in the finished binary, and go version -m gives you the exact number for your package.
Why the switch-off rule did not help
My first move was a rule with enabled: false for this module. The next morning the merge request was back.
That is not a bug. A disabled package stays in view of the advisory check, and a security fix enables it again. In pinup that is on purpose, because switching a package off should not hide a vulnerability. If you shelve a package out of convenience, you should still hear about it when something there is on fire.
ignoreDeps would have worked, because it takes the dependency out of consideration entirely. But my bot pinup applied it while reading the files, and the modules from the build manifest were only added after that. So the rule hit nothing. I fixed this in pinup, and since then ignoreDeps also covers components from build manifests.
Where did the module come from in the first place? No line in my repository names loki/v3. Through artifactManifests, though, pinup also reads the module list the build writes from every Go binary with go version -m and stores when it publishes. That makes every module in the Alloy binary a dependency of the package, and that is exactly where the advisory hit. The fix shipped in pinup 0.68.5 on November 3. Since then a module named in ignoreDeps is counted as skipped in the report and is neither watched nor asked about advisories.
The rule itself lives in the .pinup.yaml of my package repository, with the reasoning as a comment right above it. Shortened, it looks like this:
# grafana-alloy carries loki/v3 as a pseudo-version of a main commit
# (v3.0.0-20260915071729-5cf8c23a258d). CVE-2026-21726's fix (9f5d215)
# is 2097 commits before it and 0 after: the commit has the fix.
# enabled: false does not stop a security fix; ignoreDeps does.
# Remove this when alloy moves to a tagged loki/v3, or when a second
# package carries loki/v3 (ignoreDeps is not per file).
ignoreDeps:
- github.com/grafana/loki/v3
The last sentence of the comment matters most. ignoreDeps applies to the whole repository, not per package. If a second package brings loki/v3 along, pinup stops looking there too, and then the rule has to go.
The cost is plain. pinup no longer asks about advisories for this module. Two things make up for it: the scanner on the finished image still sees the module, and a comment next to the rule says when it has to go, namely once Alloy moves to a Loki release. With pinup whatif you can check in the plan before the next run that no update for the module shows up anymore.
The justification that already existed
The most embarrassing part came last. My old package repository from the Wolfi days had had exactly this justification since October 12, as a VEX statement with status fixed and the same proof through the commit graph.
It did not come along when I moved to the new base. Knowledge that sits in a file of the old system does not move by itself. That is why VEX statements belong with the artifact they describe, not with whichever tool happened to produce them once.
In OpenVEX, such a statement looks roughly like this:
{
"@context": "https://openvex.dev/ns/v0.2.0",
"@id": "https://example.org/vex/alloy-loki-cve-2026-21726",
"author": "Kai Ole Hartwig",
"timestamp": "2026-10-12T00:00:00Z",
"version": 1,
"statements": [{
"vulnerability": { "name": "CVE-2026-21726" },
"products": [{
"@id": "pkg:oci/alloy",
"subcomponents": [{
"@id": "pkg:golang/github.com/grafana/loki/v3@v3.0.0-20260915071729-5cf8c23a258d"
}]
}],
"status": "fixed"
}]
}
According to the OpenVEX specification, fixed means this product version contains a fix. Which statuses your scanner actually uses to suppress findings is in its documentation. Trivy, for example, takes the file via --vex and explicitly documents filtering for not_affected. Check that before you rely on fixed.
The lesson
A version number is a claim about history, and a pseudo-version makes that claim wrong exactly when it matters. Check the commit graph. And write the result down where the next tool can read it.
Conclusion
The number was smaller, the code was newer. For five nights nobody corrected it, because the bot was formally right and the pipeline only showed the symptom. The real question is how many of your dependencies sit on a commit instead of a release, and whether your scanner knows.
I check which commits your dependencies actually sit on.
Pseudo-versions, forks and replace directives against the open advisories, with proof from the commit graph instead of a version comparison.
About the author

Kai Ole Hartwig
Programming since 2002 – self-taught, set up my own business with KO-Web in 2012. Over 100 projects, with a focus on security, performance, automation and quality. Today freelance: DevSecOps consulting, training and software development.