security(windows): make the native-git TLS pins hold — and prove them — on Windows (#934) #939
No reviewers
Labels
No labels
accepted
bug
declined
docs
duplicate
enhancement
good first issue
in-progress
needs-info
privacy
security
triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
LibreKAT/Ocideck!939
Loading…
Reference in a new issue
No description provided.
Delete branch "security/934-native-git-windows-tls-pin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #934 (split off from #926).
The question
Does native git honour the NetGuard pins on Windows —
http.sslCAInfo(cert pin) andhttp.curloptResolve(host pin)? On macOS/Linux both are proven against a real HTTPS test server; on Windows the tests were skipped because git "could not connect" on the windows-2022 runner, so it stayed an open security question.Findings
/dev/null,PATHonly). On Windows, withoutSystemRootthe socket DLLs never load, so every connection failed regardless of the pin. The app's own_hardenedEnvalready carries the Windows essentials (_carriedWindows), so the app was never affected — only the tests were.http.sslCAInfogenuinely is a paper measure on default Windows git. Git for Windows defaults to the schannel TLS backend, which ignoreshttp.sslCAInfooutright (the installer even unsets it, to keep the Windows certificate store authoritative). Our self-signed cert pin would be silently dropped — git would validate against the system store instead of our anchor.http.curloptResolveandhttp.followRedirectsare backend-independent (libcurl / git-level), so they hold on Windows unchanged.Fix
http.sslBackend=opensslon Windows (pinnedCertBackendConfig), so git validates against exactly the CA file we supply — the behaviour already proven on macOS/Linux. Scoped to the pin: a public-CA server sets nosslCAInfo, keeps schannel and the Windows store (including any corporate root).hermeticGitEnv(mirrors_hardenedEnv's per-platform allowlist) and drive both real-server tests through it; un-skip them on Windows. The windows-2022 CI leg now verifies both pins empirically instead of assuming them.pinnedCertBackendConfig(both branches) so the Windows decision holds on any dev machine.Verification
make checkgreen — behaviour off-Windows is unchanged (the openssl override is Windows-gated; both real-server tests still pass through the new hermetic env).curloptResolvetest needs only git (preinstalled); the cert-pin test needsopenssland skips gracefully if it is absent, so no false red.Docs: SECURITY_DESIGN §10 gains the Windows/schannel note; VERIFICATION §2 records the sub-question now under CI (the broader OQ-10 token byte-scan on Windows stays open).
De wijzigingen staan al op main (
cc359f2a,4d649110) — de tak is volledig in main opgenomen, dus hier valt niets meer te mergen (vandaar het "try again later" op de merge-knop). Windows-CI groen: https://github.com/brennodewinter/Ocideck/actions/runs/30317415087. Sluiten; #934 is hiermee afgehandeld.Pull request closed