Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct JA4 alpn parsing #4721

Merged
merged 3 commits into from
Aug 22, 2024
Merged

fix: correct JA4 alpn parsing #4721

merged 3 commits into from
Aug 22, 2024

Conversation

lrstewart
Copy link
Contributor

Description of changes:

I made a VERY silly mistake in the JA4 code: I parsed the alpn extension using the sni extension definition (a two byte length + one byte type instead of just a one byte length). 🤦 I really don't know how that made it past testing and reviews. I caught it when I was adding more pcaps to the pcap tests. All the current test pcaps don't include an alpn, but some of the new pcaps did, and they were all showing up as "00".

Testing:

I added a new known-value unit test. I'll also have a follow-up PR with all the new test pcaps for the pcap tests, which is how I originally found the error.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Aug 21, 2024
@lrstewart lrstewart marked this pull request as ready for review August 21, 2024 21:08
0x00, TLS_EXTENSION_ALPN, 0x00, 20,
0x00, 18,
0, 0x00, 8, 'h', 't', 't', 'p', '/', '1', '.', '1',
0, 0x00, 4, 'q', 'u', 'i', 'c');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not worth doing now, and it might be too complex or not be possible for some tests, but I wonder if this could have been caught if these tests modified an s2n_connection and then called s2n_client_hello_send rather than manually constructing the client hello? Then any assumptions about the structure of the client hello wouldn't be in the tests themselves.

@lrstewart lrstewart enabled auto-merge (squash) August 22, 2024 17:46
@lrstewart lrstewart merged commit f2c9f93 into aws:main Aug 22, 2024
36 checks passed
@lrstewart lrstewart deleted the ja4_fix branch August 22, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants