You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] CodeQL: incomplete-url-substring-sanitization in test_image.py nix.conf assertions #784
area:ciCI/CD, GitHub Actions, workflowsarea:testingTest infrastructure, BATS, pytestbugSomething isn't workingeffort:smallLess than 1 hourpriority:highShould be done in the current milestone
Source: CodeQL (PR #670 merge ref) flagged two high-severity py/incomplete-url-substring-sanitization alerts at tests/test_image.py:1118 and :1121, introduced by the #773 nix.conf assertions.
Problem
test_nix_conf_bakes_explicit_substituters asserts "https://cache.nixos.org" in sub_line (substring-in-string). CodeQL heuristically treats a URL checked as a substring of another string as bypassable host validation → high-severity alert. Harmless in a test assertion, but a real new alert on the PR.
Fix
Split the substituters (and, for consistency, trusted-public-keys) line into whitespace tokens and assert exact membership in the token list instead of substring-in-line. Clears the CodeQL alert and is a stricter assertion (the URL/key must be a whole token, not an accidental substring).
area:ciCI/CD, GitHub Actions, workflowsarea:testingTest infrastructure, BATS, pytestbugSomething isn't workingeffort:smallLess than 1 hourpriority:highShould be done in the current milestone
Activity
c-vigo commentedon Jun 30, 2026
Landed on the migration branch via #785.
test(image): assert nix.conf tokens by exact membership (clear CodeQL…