feat(ja4): add stable JA4 fingerprint variant#42
Open
zeroaddresss wants to merge 1 commit into
Open
Conversation
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.
Summary
This PR adds an opt-in stable JA4 variant alongside the existing raw JA4 implementation.
The stable variant keeps the normal JA4 structure, but excludes TLS extensions that can appear or disappear depending on connection state:
padding(0x0015)session_ticket(0x0023)pre_shared_key(0x0029)These extensions are removed from both the JA4 extension count and the extension hash input.
Why
Raw JA4 can change between fresh and resumed TLS handshakes for the same client. In practice, this can happen when connection-state-dependent extensions such as
pre_shared_key,session_ticket, orpaddingare present in one handshake and absent in another.That makes raw JA4 useful as a wire-level fingerprint, but less stable as a continuity signal.
This stable variant is meant for consumers that need a canonical JA4 value across expected fresh/resumed handshake differences, while preserving the existing raw JA4 behavior unchanged.
The motivation follows the stability concerns discussed by ntop here:
https://www.ntop.org/is-ja4-now-obsolete/
What changed
ja4.StableJA4Fingerprint.fingerprint.JA4StableFingerprint.ja4.JA4Fingerprintbehavior unchanged.Tests
Added coverage for:
padding,session_ticket, andpre_shared_key.fingerprint.JA4StableFingerprintmatching theja4package output.Validation run locally: