Repository navigation
test(security): exact SAN-entry match in mitm leaf-cert test (CodeQL #746) - #7824
Conversation
…746) CodeQL js/incomplete-url-substring-sanitization (HIGH) flags cert.subjectAltName.includes(host) in the #6684 leaf-issuance test as a host-substring check. It is the ONLY open CodeQL alert repo-wide, and check:codeql-ratchet counts alerts repo-wide, so it keeps Quality Ratchet red on every open PR — currently blocking ~10 contributor PRs that have no defect of their own. Assert exact SAN-entry membership (split on ',' + Array.includes of the full 'DNS:<host>' entry) instead of a substring. Stronger: a SAN of 'notexample.com' no longer satisfies host 'example.com'. All 5 tests pass.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Verified independently: Ran All 6 red checks on this PR (Docs Gates, Fast Quality Gates, all 4 Unit Tests fast-path shards, dast-smoke) were individually traced and are pre-existing base-red, unrelated to the touched file: Fast Quality Gates fails on the known merge-ready — no mandatory items. |
|
Validated in local merge-train on tomni-proxmox-113 @ 19bcf534352e24cdd2448cdfdfd64d5bd9695c74 (FAST gates green: static + changed tests + vitest) |
…heaper-inference#746) (cheaper-inference#7824) CodeQL js/incomplete-url-substring-sanitization (HIGH) flags cert.subjectAltName.includes(host) in the cheaper-inference#6684 leaf-issuance test as a host-substring check. It is the ONLY open CodeQL alert repo-wide, and check:codeql-ratchet counts alerts repo-wide, so it keeps Quality Ratchet red on every open PR — currently blocking ~10 contributor PRs that have no defect of their own. Assert exact SAN-entry membership (split on ',' + Array.includes of the full 'DNS:<host>' entry) instead of a substring. Stronger: a SAN of 'notexample.com' no longer satisfies host 'example.com'. All 5 tests pass.
…heaper-inference#746) (cheaper-inference#7824) CodeQL js/incomplete-url-substring-sanitization (HIGH) flags cert.subjectAltName.includes(host) in the cheaper-inference#6684 leaf-issuance test as a host-substring check. It is the ONLY open CodeQL alert repo-wide, and check:codeql-ratchet counts alerts repo-wide, so it keeps Quality Ratchet red on every open PR — currently blocking ~10 contributor PRs that have no defect of their own. Assert exact SAN-entry membership (split on ',' + Array.includes of the full 'DNS:<host>' entry) instead of a substring. Stronger: a SAN of 'notexample.com' no longer satisfies host 'example.com'. All 5 tests pass.
Why this matters right now
#746 is the ONLY open CodeQL alert in the repo, and
check:codeql-ratchetcounts alerts repo-wide — so it single-handedly keepsQuality Ratchetred on every open PR. Right now that is blocking ~10 contributor PRs (#7816, #7813, #7810, #7804, #7807, #7358, #7296, #6958, #7027, #7299) whose only failing checks are this base-red — they have no defect of their own.The alert is live on the exact tip (
5e96d5254), has no open PR covering it, and came in with #7731 (already merged). This clears it at the source.Root cause
tests/unit/mitm-root-ca-leaf-issuance-6684.test.ts:37asserted the leaf cert's SAN with a host substring check:CodeQL flags this as
js/incomplete-url-substring-sanitization(HIGH) — and it is genuinely loose: a SAN ofnotexample.comsatisfieshost = "example.com".Fix
Exact SAN-entry membership instead of substring:
Stronger, not weaker — it now verifies the full
DNS:<host>entry rather than any coincidental substring, and it is no longer a substring-of-host sink.allHosts()comes fromMITM_TOOL_HOSTS(DNS names, no IPs), so theDNS:prefix is correct.Validation (Hard Rule #18)
Test-only; no production code touched. File exists only on
release/v3.8.49— nomaincompanion needed (merge-gates §8). Once merged + rescanned, repo CodeQL count hits 0 andQuality Ratchetgoes green across the whole open-PR queue.