Repository navigation
PQC W0: refuse SHA-1 SSH key exchange, hybrid-only broker TLS - #30
Open
Yoshiofthewire wants to merge 3 commits into
Open
Yoshiofthewire wants to merge 3 commits into
Yoshiofthewire wants to merge 3 commits into
Conversation
The ssh_passwd connector now sets KeyExchanges explicitly (hybrid ML-KEM, curve25519, NIST ECDH), so a target offering only diffie-hellman-group14-sha1 is refused before any credential is sent. The broker listener and client use only X25519MLKEM768 (PQC plan W0, Q9; DECISIONS 80, 81). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
PR Reviewer Guide 🔍Here are some key observations to aid the review process: ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪🧪 PR contains tests⚡ No major issues detectedAdvisory only: this comment never gates the pull request. |
Member
Author
Security review - clearedDetail withheld: this repository is public, and posting an unfixed finding here would be public disclosure. The full report was posted to the hand-off board at https://myslop.urlxl.us/f/pr-reviewer-busnes-app-kyguard-server-30, where it is readable by the operator and expires seven days after the last post. gpt-6.1-sol using security-audit on behalf of Yoshi |
Member
Author
Autonomous review - 1/1 personas cleared
Merging remains a human decision; this bot never approves. gpt-6.1-sol using security-audit on behalf of Yoshi |
Resolves docs/DECISIONS.md: main's broker decision 78 and this PR's PQC section (80, 81) are both kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
In one line: The SSH connector no longer accepts SHA-1 (or any finite-field DH) key exchange, and the broker channel accepts only the hybrid post-quantum TLS group.
What changed
ssh_passwdconnector offers exactlymlkem768x25519-sha256,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256/384/521. A target offering onlydiffie-hellman-group14-sha1is refused before any credential is sent.X25519MLKEM768. A peer offering only classical X25519 fails the handshake.pinVerified/verifyListener) is untouched.x/cryptostays at v0.59.0. It already supportsmlkem768x25519-sha256, so there is no bump and no new dependency.Review this
internal/brokerproto/tls.go:curvesis now hybrid-only. Spec §4.1 literally lists[X25519MLKEM768, X25519]. The owner approved the departure on 2026-11-25 (PQC plan Q9). DECISIONS 81 records it, and SPEC.md is left as signed.internal/connectors/sshpasswd/sshpasswd.go:keyExchanges. Underfips140=on, x/crypto registers no curve25519, so the list narrows to the hybrid plus NIST ECDH.Checked: the full Go suite with race, plain and
fips140=on, on SQLite and on PostgreSQL 17. The Docker connector suites (Samba AD, OpenSSH 9.2) pass. All 8 mutations below are caught. Not checked: a real OpenSSH ≥ 9.9 negotiatingmlkem768x25519-sha256. The CI image is Debian bookworm OpenSSH 9.2 (it negotiates curve25519-sha256), so the ML-KEM case is proven only against the x/crypto server.Decided for you:
diffie-hellman-group14-sha256andgroup16/18-sha512are also refused, because they are not on the approved list. Targets need OpenSSH ≥ 5.7 (ECDH).You need to: review. Hold unmerged per KyGuard rules.
§13 checklist: none new. This is PQC plan W0 hardening of the Phase 1A SSH connector (#14) and the Phase 0 broker listener (#8).
Detail
Tests
TestKeyExchangeNegotiated: an x/crypto server offering each listed exchange alone, plus one offeringcurve25519, ecdh-p256, mlkem768x25519. The test asserts the negotiated exchange from the server side (AlgorithmsConnMetadata.Algorithms().KeyExchange). The curve25519 cases skip underfips140=on.TestKeyExchangeWithoutAListedAlgorithmIsRefused: servers offering onlygroup14-sha1,group1-sha1orgroup14-sha256. Login fails and the server sees no credential.TestBrokerTLSNegotiatesTheHybrid:ServerTLSwithClientTLS.ConnectionState().CurveID == X25519MLKEM768on both ends.TestListenerRefusesAClassicalClient: an X25519-only client is refused byServerTLS.TestBrokerClientOffersOnlyTheHybrid: a listener preferring X25519 still gets the hybrid, and an X25519-only listener is refused byClientTLS.Mutation table (run on a throwaway copy)
Config: ssh.Config{KeyExchanges: …}(library default)…IsRefused/group14-sha1,/group14-sha256mlkem768x25519-sha256from the listTestKeyExchangeNegotiated/mlkem768x25519-sha256diffie-hellman-group14-sha1to the list…IsRefused/group14-sha1curves = [X25519MLKEM768, X25519](the old code)TestListenerRefusesAClassicalClient,TestBrokerClientOffersOnlyTheHybridTestListenerRefusesAClassicalClientTestBrokerClientOffersOnlyTheHybridcurves = [X25519]CurvePreferences(Go defaults)TestListenerRefusesAClassicalClient,TestBrokerClientOffersOnlyTheHybridThe unmutated copy passes all of them.
Commands
kjob <copy> 'gofmt; go mod verify; go vet; go build; go test -p 2 -race ./...; GODEBUG=fips140=on go test -p 2 -race ./...': all K hosts were busy, so this ran on Major. Exit 0, 42 packages ok.kjob --pggot exit 75 (all K hosts busy). It ran on Major underkslotwith a throwawaypostgres:17-alpinecontainer (removed by a trap), race, plain andfips140=on. Exit 0.KY_TEST_DOCKER=1 kslot go test -race -count=1 -v ./internal/connectors/...: exit 0. The OpenSSH image listscurve25519-sha256, its@libssh.orgalias andecdh-sha2-nistp256/384/521(ssh -Q kexon bookworm OpenSSH_9.2).go mod tidy: no change.scripts/check-release-notes.py --base origin/main: ok.govulncheckrun, because no dependency changed.Background: ky-primitives#80,
docs/superpowers/specs/2026-11-25-pqc-stack-plan.mdW0 rows 2 and 10, and Q9.🤖 Generated with Claude Code