Repository navigation
ci: scan with a vulnix that reads patches from structured attrs - #165
Merged
Merged
Conversation
viberaven
reviewed
Oct 29, 2026
viberaven
left a comment
Contributor
There was a problem hiding this comment.
No actionable findings at dda6f7a.
Reviewed the scanner override, structured-attribute patch detection, scan invocation, and CI changes. The scanner derivation evaluates, its source fetch passes the pinned hash check, all 26 CVE-tool tests pass with jq available, and cve-scan.sh passes bash syntax checking.
I did not build the complete scanner or rerun the full node/NVD scan locally.
Review performed with Codex (GPT-6 Astra).
vulnix 1.12.4 from nixpkgs reads `patches` only from the plain derivation environment. Packages built with __structuredAttrs keep it in __json, so the first scan reported all ten libssh2 CVEs although nixpkgs carries a CVE-named patch for each one, and the same will happen to every package nixpkgs moves to structured attrs. Upstream fixed this in nix-community/vulnix@3596c69, which is in no release yet. test/ci/vulnix.nix takes the nixpkgs package and swaps in the upstream source at a pinned commit, and cve-scan.sh runs that. The check_flake job evaluates it next to the scan target.
The pinned vulnix retries each feed download up to five times with a 60 s read timeout before it gives up. The two comments still described the 10 s single attempt of vulnix 1.12.4.
seberm
force-pushed
the
cve-scan-vulnix-pin
branch
from
October 29, 2026 13:31
dda6f7a to
be9ab46
Compare
sebsgent
reviewed
Oct 29, 2026
sebsgent
left a comment
Contributor
There was a problem hiding this comment.
Tested at be9ab46, looks good to merge.
- Reproduced the bug: two of the four libssh2 derivations in the scan closure use
__structuredAttrs. Loaded through vulnix'sderivation.load, 1.12.4 finds 0 of their 10 CVE patches and the pinned build finds 10/10. The two plain derivations are 10/10 with both versions. nix build --impure -f test/ci/vulnix.nixbuilds, the hash matches, and upstream's 119 tests pass.525eb2cis upstream master HEAD and includes 3596c69.cve-tests.py(29 tests) and shellcheck pass. CI is green, andcheck_flakeruns the new eval step.- The retry comments match upstream's code: 5 attempts, a (10, 60) s timeout and doubling backoff.
- I didn't run a full NVD scan; for the end-to-end result I relied on the fork run.
Review performed with Claude Code (Opus 5.5).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the first scan in #157. Ten of the 62 reported pairs were the libssh2 CVEs, and nixpkgs carries a CVE-named patch for each of them at our pin. vulnix 1.12.4 didn't see them: it reads
patchesonly from the plain derivation environment, and libssh2 is built with__structuredAttrs, which keepspatchesin the__jsonvariable. Every package nixpkgs moves to structured attrs gets the same false positives.Upstream fixed it in nix-community/vulnix@3596c69 on 2026-10-19. The last release, 1.12.5, is from 2026-07-31, so no release has it.
What changed:
test/ci/vulnix.nix: the nixpkgs vulnix package withoverrideAttrsswapping the source for upstream commit 525eb2c (2026-10-26, includes the fix and an NVD download retry). Same build recipe and tests as nixpkgs, pinned by hash. The comment says when to drop the file.test/ci/cve-scan.shrunsnix shell --impure -f test/ci/vulnix.nixinstead ofnixpkgs#vulnix. The second commit updates the two comments about NVD timeouts to what the pinned vulnix does: five attempts per feed with a 60 s read timeout, and the outer loop covers a feed that fails all of them.check_flakejob evaluatesvulnix.nixnext to the scan target, so a broken pin fails CI before the Monday run.Tested
cve-scan.ymlworkflow on the first commit in my fork: https://github.com/ostermayer/bitcoinix/actions/runs/40563471734. vulnix built, the scan completed, and libssh2 is gone from the report. 21 store paths and 58 set lines instead of 22 and 68, nothing else changed.nix derivation showon those derivations lists all ten CVE-named patches. That's the bug reproduced and the fix confirmed.python3 test/ci/cve-tests.py test/ci: 26 stub tests pass.bash -nand YAML parse pass.Codex (GPT-6 Astra, xhigh) reviewed the first commit and found the two stale timeout comments, fixed in the second, and nothing else. The Nix modules aren't touched, so the GLM 5.3 (max) audit of the tree at bacf78d is for completeness: four findings in modules/, none in the files this PR touches. Astra confirmed three (#87, #133, and electrs enabling bitcoind REST, which the configuration tests already pin down as intended) and marked the backup one a false positive. DeepSeek V4.1 Flash 1017 wasn't run on this CI-only change.