Repository navigation
feat: TLS fingerprint on sessions, hashed; change audited (1.3.0) - #8
Merged
Merged
Conversation
login and refresh take tlsFingerprint (JA4/JA3 from the server's trusted TLS proxy). Only its SHA-256 is stored (Session.tlsFingerprintHash). A change on refresh is audited as auth.tls_fingerprint_changed and never blocks; auth.device_mismatch records whether the TLS fingerprint matched. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VT1kmGY9yJ2fLxetUn2D5c
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.
Requested by Himanshu · project thread
Before: sessions were bound to the client's device signals only.
After:
loginandrefreshalso taketlsFingerprint(JA4/JA3, supplied by the server from security-kit'sreadTlsFingerprint, never by the client). Only its SHA-256 is stored, asSession.tlsFingerprintHash. On refresh, a different fingerprint is audited asauth.tls_fingerprint_changed(both hashes) and the latest is kept;auth.device_mismatchnow recordstls: "same" | "changed" | null.It never blocks a refresh: browser updates and TLS-inspecting networks change the fingerprint, the same reasoning as the client fingerprint. A refresh without one keeps the stored hash; a session without one is bound by the first refresh that has one.
How:
hashTlsFingerprint(validated, SHA-256 base64url) insrc/auth.ts, a new optionalSessionfield, 8 new checks run on memory and Redis stores (126 total); the Redis "no raw token" check also covers the fingerprint. No error codes changed. Version 1.3.0.🤖 Generated with Claude Code
https://claude.ai/code/session_01VT1kmGY9yJ2fLxetUn2D5c
Generated by Claude Code