If you work in threat hunting, bot detection, WAF, or traffic analysis, you have probably seen this confusing signal:
One single JA4 fingerprint. Thousands of requests. Dozens, sometimes hundreds, of different User-Agent strings.
It looks wrong until you see what JA4 measures and what it ignores. Below is the mechanics, then a real BetterReads incident from mid-November 2026 where that mismatch showed up as a 13k/day bucket and I had to decide whether to Deny the JA4 itself.
Related field notes from the earlier farm wave: Fighting Scraping Farms on a Reading Site.
What JA4 actually is
JA4 is a TLS ClientHello fingerprint, a successor to JA3. JA3 broke easily because modern browsers randomize the order of TLS extensions. JA4 fixes that by sorting key fields before hashing, so fingerprints stay stable against extension reordering.
A JA4 has three parts joined by _:
JA4_a _ JA4_b _ JA4_c
Example from production traffic:
t13d1515h1_8daaf6152771_de4a06bb82e3
JA4_a: plaintext metadata prefix
High-level handshake properties:
- Transport:
t= TCP/TLS,q= QUIC - Advertised TLS version (
13= TLS 1.3,12= TLS 1.2) - SNI flag:
d= SNI present,i= absent - Count of cipher suites the client offered
- Count of TLS extensions in the ClientHello
- First ALPN preference (
h2,h1,h3, or00if ALPN is missing)
Important limits:
- The SNI flag is presence only. JA4 does not hash the hostname inside SNI.
- ALPN uses only the first protocol the client prefers, not the full list, and not what the server eventually picks.
JA4_b: hash of sorted cipher suites
The client lists cipher suites it supports. JA4 sorts those numeric IDs, joins them, then takes a truncated SHA-256. JA3 used the original order; JA4’s sort means random ordering no longer changes the fingerprint.
JA4_c: extension types + signature algorithms
This is where most analysts trip up.
JA4 works with TLS extension type IDs, not the payload inside each extension.
Processing for JA4_c:
- Take all extension type IDs from the ClientHello
- Remove SNI (
0x0000) and ALPN (0x0010); already represented in JA4_a - Strip GREASE reserved values
- Sort the remaining extension type IDs
- Append the signature-algorithms list (not sorted)
- Hash and truncate
Example: supported_groups (0x000a) tells the server which curves the client likes. JA4 only cares that extension 0x000a exists. Two clients can advertise different curves inside that extension and still share the same JA4.
Compute JA4 in Python
The FoxIO JA4 spec is short enough to implement from already-parsed ClientHello fields. User-Agent is not an input. That is the whole point of the “same JA4, many UAs” case.
import hashlib
# GREASE values look like 0x?a?a (e.g. 0x0a0a, 0x1a1a, ...).
def is_grease(value: int) -> bool:
return (value & 0x0F0F) == 0x0A0A
def truncated_sha256(payload: str) -> str:
if not payload:
return "000000000000"
return hashlib.sha256(payload.encode("ascii")).hexdigest()[:12]
def alpn_chars(first_alpn: str | None) -> str:
if not first_alpn:
return "00"
if len(first_alpn) == 1:
return first_alpn[0] + first_alpn[0]
return first_alpn[0] + first_alpn[-1]
def ja4(
*,
transport: str = "t", # "t" TCP/TLS, "q" QUIC
tls_version: str = "13", # from supported_versions, else legacy
sni_present: bool,
cipher_suites: list[int],
extension_types: list[int],
signature_algorithms: list[int],
first_alpn: str | None,
) -> str:
ciphers = [c for c in cipher_suites if not is_grease(c)]
extensions = [e for e in extension_types if not is_grease(e)]
ja4_a = (
f"{transport}{tls_version}"
f"{'d' if sni_present else 'i'}"
f"{min(len(ciphers), 99):02d}"
f"{min(len(extensions), 99):02d}"
f"{alpn_chars(first_alpn)}"
)
cipher_list = ",".join(f"{c:04x}" for c in sorted(ciphers))
ja4_b = truncated_sha256(cipher_list)
# SNI (0000) and ALPN (0010) are already in JA4_a; drop them from JA4_c.
ext_for_hash = sorted(e for e in extensions if e not in (0x0000, 0x0010))
ext_list = ",".join(f"{e:04x}" for e in ext_for_hash)
sig_list = ",".join(f"{s:04x}" for s in signature_algorithms)
ja4_c_payload = ext_list + (f"_{sig_list}" if sig_list else "")
ja4_c = truncated_sha256(ja4_c_payload)
return f"{ja4_a}_{ja4_b}_{ja4_c}"
# Cipher list from the FoxIO example. Sorted hex string hashes to 8daaf6152771,
# which is JA4_b in the BetterReads digest below.
EXAMPLE_CIPHERS = [
0x1301, 0x1302, 0x1303, 0xC02B, 0xC02F, 0xC02C, 0xC030,
0xCCA9, 0xCCA8, 0xC013, 0xC014, 0x009C, 0x009D, 0x002F, 0x0035,
]
assert truncated_sha256(
",".join(f"{c:04x}" for c in sorted(EXAMPLE_CIPHERS))
) == "8daaf6152771"
# Same TLS fields, two different HTTP User-Agents: same JA4.
digest = ja4(
sni_present=True,
cipher_suites=EXAMPLE_CIPHERS,
extension_types=[
0x001B, 0x0000, 0x0033, 0x0010, 0x0017, 0x002D, 0x000D,
0x0005, 0x0023, 0x0012, 0x002B, 0xFF01, 0x000B, 0x000A, 0x0015,
],
signature_algorithms=[
0x0403, 0x0804, 0x0401, 0x0503, 0x0805, 0x0501, 0x0806, 0x0601,
],
first_alpn="http/1.1",
)
print(digest)
# -> t13d1515h1_8daaf6152771_de4a06bb82e3
# Same digest as the BetterReads top JA4 below. User-Agent is not an input.
GREASE filtering, QUIC vs TCP, and the exact extension set of a given browser build still matter at the edge. The sample is enough to see why rotating the HTTP header cannot split the TLS bucket.
What JA4 completely ignores
This list is the key to “same JA4, many UAs”:
| Item | Layer | In JA4? | Notes |
|---|---|---|---|
| SNI | TLS extension | Yes | Presence flag only, not hostname |
| ALPN | TLS extension | Yes | First preference only |
| Cipher suites | TLS | Yes | Sorted before hashing |
| Extension type IDs | TLS | Yes | Sorted; SNI/ALPN excluded from JA4_c |
| Extension payloads | TLS | No | Ignored entirely |
| Signature algorithms | TLS | Yes | Not sorted |
| User-Agent | HTTP header | No | Separate fingerprint family (JA4H) |
| Other HTTP headers | HTTP | No | JA4H territory |
| IP / path / cookies | n/a | No | Orthogonal signals |
JA4 lives entirely at the TLS layer. User-Agent is an HTTP header sent after the handshake. They are decoupled by design.
Why one JA4 maps to many User-Agents
A JA4 is a TLS stack configuration profile, not a device, browser, or person.
Common reasons the bucket splits at HTTP:
- Same TLS library, custom UA. Go
crypto/tls, OpenSSL, BoringSSL, OkHttp, Cronet: overrideUser-Agent, leave ClientHello alone. - Headless automation. Playwright / Puppeteer / Selenium spoof arbitrary UAs; Chromium’s TLS stack stays put, so JA4 stays stable.
- Shared mobile SDKs. Many apps, one networking stack, app-specific UAs.
- Proxies. Forward the original ClientHello, rewrite HTTP headers after encryption is up.
Operational takeaway: do not treat JA4 as a unique client ID. Treat it as “what ClientHello is talking to me.” One bucket can hold legitimate browsers, SDKs, scrapers, and malware that happen to share a TLS stack.
BetterReads, Nov 2026: 32k logged bots, top JA4 ~13k
BetterReads sits behind Vercel Firewall. I keep Bot Protection on Log (not Challenge). Challenge Mode has bitten good crawlers with 429 Security Checkpoint pages before. Logging still surfaces the noisy digests; it does not stop Fluid/SSR. Mitigated traffic (x-vercel-mitigated: deny) is what actually saves compute.
In one 24h window I saw roughly:
- ~32k Bot Protection Logged requests (Denied: 0)
- Top JA4 alone:
t13d1515h1_8daaf6152771_de4a06bb82e3≈ 11-13k - Top User-Agents under Bot Protection: fragmented at ~1-2k each
If you only look at “Top UA,” you see seven mediocre offenders. If you look at JA4, you see one TLS stack driving most of them.
Inspect without Observability Plus
Custom Query in the dashboard is read-only without Observability Plus. The last 24h of Firewall Traffic is still available via CLI:
vercel firewall traffic inspect ja4 t13d1515h1_8daaf6152771_de4a06bb82e3 \
--group-by user-agent --top 20 --json
vercel firewall traffic inspect ja4 t13d1515h1_8daaf6152771_de4a06bb82e3 \
--group-by path --top 20
vercel firewall traffic inspect ja4 t13d1515h1_8daaf6152771_de4a06bb82e3 \
--group-by asn --top 20
vercel firewall traffic inspect ja4 t13d1515h1_8daaf6152771_de4a06bb82e3 \
--group-by ip --top 20
One --group-by at a time. Multiple flags collapsed to a single breakdown in my CLI version.
What that digest actually was
| Dimension | Finding |
|---|---|
| Volume | 13.3k requests (≈2.2k Allow + ≈11.1k Log) |
| User-Agents | Seven Windows Chrome strings, ~1.9k each. Not one UA |
| Paths | Almost entirely deep /discover/<book>/…/chapters/… (and characters). Unique URLs, so top path only shows 5-7 hits each, but the pattern is a chapter walk |
| ASNs | Comcast, VNPT, Claro, Charter, Telefónica, Verizon, Maroc Telecom, Starlink…: residential / ISP, not a single OVH rack |
| IPs | Max ~5 hits per address. Classic rotating egress |
Full UA set under that JA4 (equals-match candidates):
Mozilla/5.0 (Windows NT 10.0; Win64; x64) … Chrome/107.0.0.0 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) … Chrome/101.0.4951.67 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) … Chrome/110.0.0.0 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) … Chrome/100.0.4896.75 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) … Chrome/99.0.4844.51 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) … Chrome/104.0.0.0 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) … Chrome/116.0.0.0 Safari/537.36
Ancient majors, several pure .0.0.0 builds, rotating under one Chromium-like ClientHello. Exactly the “same JA4, many UAs” case, except the HTTP identity is a farm label, not seven different products.
Same week I also saw a separate fixed-UA chapter walker at much higher volume (X11 Linux Chrome/157.0.0.0 on the order of ~161k/day in an earlier window). That one is a different playbook: exact UA Deny. The JA4 bucket above is the opposite problem: UA Deny alone only buys ~2k per string.
How I chose the Firewall rules
Decision order I actually used:
1. Do not bare-Deny the JA4
The digest is a common Chrome TLS ClientHello. Residential ASNs mean real readers can share JA4_a/b/c with the farm. Denying the digest alone is a blunt instrument with collateral risk.
2. Do Deny JA4 and path
The path breakdown was decisive. Almost every top URL was a deep Discover chapter/character page: the SEO surface farms love, and the surface that burns SSR.
Rule A, primary cut (~13k of this traffic):
- If: JA4 Digest equals
t13d1515h1_8daaf6152771_de4a06bb82e3
AND Request Path starts with/discover - Then: Deny
Natural-language form that works in the Vercel UI:
Deny requests when JA4 Digest equals t13d1515h1_8daaf6152771_de4a06bb82e3 AND Request Path starts with /discover
3. Exact-UA mop-up for leftovers
JA4+/discover misses the same stack on /, /blog, /reader, APIs, etc. The seven strings are stable enough to Deny by equals (not contains. Never contains Chrome/110 in late 2026).
Rule B, mop-up:
- If: User-Agent equals any of the seven strings above
- Then: Deny
4. Keep Bot Protection on Log
Flipping the managed rule to Challenge was tempting (32k “bots” in purple). I didn’t. Logged ≠ free; Challenged ≠ free of false positives on crawlers I want. Custom Deny with a probe (403 + x-vercel-mitigated: deny) is the cost lever.
5. Don’t confuse search indexers with farms
Same week, YouBot and ShapBot showed up in UA lists. Those are You.com / Parallel search-index crawlers. Allow HTML, block EPUB/expensive APIs in app policy. FW Deny would save compute and delete discoverability. Different bucket from Chrome/107 labels.
6. Fixed high-volume UAs still get their own rules
When volume concentrates on one impossible string (Chrome/157.0.0.0 on X11 Linux, twin Mac Chrome/133.0.0.0), exact UA Deny is correct and simpler than JA4. Use JA4 when the farm rotates UAs under one handshake.
Clustering better than JA4 alone
When a high-volume JA4 fans out across many UAs, break the bucket:
| Signal | Role |
|---|---|
| Path | Often the cheapest truth (deep catalog walks vs homepage) |
| User-Agent | Secondary label. Great for equals Deny once the set is known |
| ASN / IP | Hosting vs residential; never AS-ban Comcast because a farm rented it |
| JA4H | HTTP header name/order/casing. Splits spoofed UA families when you have it |
| App policy | Defense in depth after the edge (trafficPolicy on BetterReads); middleware 403 still bills Fluid |
JA4 says “same ClientHello.” Path + UA + ASN say “same abuse campaign.”
Cheat sheet
| Instinct | Better move |
|---|---|
| “Top JA4 = ban it” | Inspect UA / path / ASN first |
| “Top UA = ban only that” | Check whether one JA4 owns many UAs |
| “Bot Protection Logged = safe” | Still pays SSR until custom Deny |
| “Challenge everything” | Easy to break good crawlers |
| “AS Deny the ISPs in the chart” | Hits real readers; prefer JA4+path or exact UA |
Numbers from Vercel Firewall Traffic inspect on BetterReads production, ~15-16 Nov 2026 UTC. Rule text may evolve as farms rotate digests and UAs.