TL;DR: Truffle Security found that more than 1.2% of symmetric JWT keys in production were guessable within seconds, and that weak or default secrets can let attackers forge claims and impersonate users or admins. The problem is not JWTs themselves, but the collapse of trust when shared secrets are treated like passwords.
At a glance
What this is: This analysis argues that HS256 and other symmetric JWT deployments often fail because developers choose guessable secrets, making token signing no stronger than password-based authentication.
Why it matters: It matters because identity teams that rely on shared JWT secrets inherit a hidden credential problem: compromise of one key can undermine authentication and authorization across the application.
By the numbers:
- More than 1.2% of symmetric keys in production are guessable within seconds.
- The research made 11 trillion total guesses against JWT secrets.
- The signal to noise ratio for JWTs in source code was about 1 in 20.
👉 Read Truffle Security's analysis of weak symmetric JWT keys and token forgery risk
Context
JWTs are often presented as a stateless alternative to classical API keys, but that promise only holds when the signing model is sound. When symmetric secrets are weak or reused, the token becomes a portable proof of identity that an attacker can mint or replay, which turns token validation into a shared-secret problem rather than a governance problem.
The real issue is not token format, but key quality and lifecycle discipline. In NHI terms, the signing secret is a machine credential, and if that credential is guessable, copied from documentation, or left active without accountability, the entire trust model around authentication and authorisation becomes brittle.
Key questions
Q: What should security teams do when JWT signing secrets are weak or copied from examples?
A: Treat the secret as a compromised credential class, not a harmless configuration value. Replace any weak or documentation-derived secret, invalidate tokens it could sign, and verify that production systems only accept secrets generated with sufficient entropy. If you cannot guarantee that discipline, symmetric JWTs are the wrong default for your environment.
Q: Why do weak JWT validation controls create such a high-risk authentication gap?
A: Weak JWT validation creates risk because an attacker who can influence the token header or signature checks may bypass authentication entirely. If the verifier accepts the wrong algorithm, trusts attacker supplied keys, or mishandles key identifiers, the token can appear valid even when it was forged. That turns signature verification into a false assurance control.
Q: How can teams tell whether a discovered JWT is a live production credential or just a test artefact?
A: Check the token against issuer configuration, deployment environment, and validation behaviour before escalating it. A token found in source code or documentation is often non-production, so discovery alone is not enough. You need state validation to separate live signing material from false positives.
Q: Should organisations use HS256 for general-purpose JWT signing?
A: Only if they can guarantee random secret generation, secure storage, active monitoring, and consistent revocation discipline. In many environments that is hard to sustain, which is why symmetric JWTs become a predictable governance weakness rather than a convenience. Where trust must scale, asymmetric alternatives are easier to operate safely.
Technical breakdown
Why symmetric JWT signing turns a secret into an identity control
With HS256 and similar symmetric algorithms, the same secret signs and verifies the token. That means any holder of the key can mint arbitrary claims, because verification depends on trust in the signer, not on a separable public key. This is efficient, but it collapses issuer and verifier trust into one shared credential. In security terms, the token is only as strong as the entropy, storage, and rotation discipline of the secret behind it. If that secret is guessable, copied, or exposed in code, the token format no longer provides meaningful assurance. See the Token and Session Security Guide.
Practical implication: Treat the signing secret as a high-value machine credential and avoid symmetric JWTs where secret governance cannot be enforced reliably.
Why default examples and copied secrets create predictable compromise
The article shows a familiar failure pattern: developers copy example strings from documentation, then ship them into production because they are easy to test and hard to notice later. That creates a credential class with low entropy and high repetition, which is exactly what offline guessing attacks exploit. A token signed with a default or documented secret may still validate perfectly, so normal application behaviour does not reveal the weakness. The failure is structural, because the system accepts a token that should never have been trusted in the first place. Read the Ultimate Guide to NHIs: What are Non-Human Identities.
Practical implication: Eliminate documentation-derived secrets from build and deployment paths before production tokens are allowed to validate.
Why generic JWT detection is noisy without validation
Detecting JWTs in source code is not enough, because many discovered tokens are test artefacts, examples, or documentation values rather than live credentials. The article’s 1 in 20 ratio shows why raw pattern matching produces poor signal: the scanner can find a token, but not whether it is active, production-bound, or still accepted by a backend. Good detection therefore needs validation against expected issuer state, environment context, and revocation or retirement status. Without that, teams drown in false positives and miss the real risk.
Practical implication: Use validation and environment context to separate dead examples from live signing secrets before escalating findings.
Threat narrative
Attacker objective: The attacker wants to mint trusted tokens that grant unauthorized access and privileged actions inside the application.
- Entry occurs when an attacker discovers a weak symmetric JWT secret in production code, documentation, or a public sample.
- Credential abuse follows when the attacker uses the secret to forge a valid token with chosen claims.
- Impact occurs when forged tokens are accepted as authentic, enabling impersonation of users or administrators and bypassing application trust boundaries.
Breaches seen in the wild
- Microsoft Storm-0558 key breach 2023: China-based Storm-0558 used a stolen, never-retired Microsoft signing key to forge tokens and read email at 22 organisations in 2023.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Symmetric JWTs create identity trust debt: the application inherits the burden of protecting a shared signing secret with the same discipline normally reserved for credentials. When that secret is guessable or copied from documentation, the token becomes an attacker-controlled assertion system rather than a trustworthy identity mechanism. The practitioner conclusion is that token format alone does not solve authentication risk.
Default secrets are an assumption failure, not just a configuration mistake: JWT deployments often assume the signing key will be randomly generated and operationally unique. This article shows that assumption breaks when developers paste example strings into production or reuse the same defaults across libraries. The implication is that governance must address how secrets are chosen, not just how they are stored.
Generic detection is only useful when it can distinguish live credentials from dead artefacts: a scanner that reports every JWT without validation produces too much noise to support response. The article’s 1 in 20 signal to noise ratio is the real lesson here. The practitioner takeaway is that secret discovery must be paired with state validation or it becomes operationally unusable.
HS256 shifts the control boundary from algorithm strength to secret discipline: the cryptography is not the weak point when the secret is random and protected. The problem is that symmetric schemes make operational mistakes instantly security-relevant, because one leaked or guessed secret can sign anything. The field should treat this as a governance constraint, not a tuning problem.
What this signals
Token signing should be governed like credential issuance: once a JWT secret can be guessed or copied, the security model no longer depends on cryptographic design alone. It depends on whether the organisation can control creation, storage, validation, and retirement of that secret with the same rigor used for other machine credentials.
JWT detection needs context-aware validation: scanning for token patterns without knowing whether they are live, test, or documentation artefacts creates noise that teams cannot action. Mature secret governance has to distinguish exposure from usability, otherwise discovery programmes become overwhelmed by false positives.
For practitioners
- Reject documentation-derived secrets Remove example strings and copied defaults from all JWT signing paths, test fixtures, and deployment templates before production cutover.
- Enforce random secret generation Require high-entropy secret creation for any symmetric signing workflow and block release if the key is human-readable or pattern-based.
- Validate token secrets against runtime state Correlate discovered JWTs with issuer configuration, environment metadata, and revocation status before treating them as active credentials.
- Prefer asymmetric designs where trust must scale Use asymmetric signing where multiple services need to verify tokens without sharing the signing secret, reducing the blast radius of one compromised key.
- Separate test tokens from production tokens Label non-production JWTs clearly and isolate them from real authentication flows so scanners and operators can distinguish artefacts from live trust material.
Key takeaways
- Weak symmetric JWT secrets turn token signing into a credential problem, because anyone who learns the secret can mint trusted claims.
- Truffle Security found that more than 1.2% of symmetric keys in production were guessable within seconds, which shows the risk is not theoretical.
- The practical fix is governance, not token hype reduction: use strong secret generation, validate what is live, and avoid shared-secret designs where trust must scale.
Related NHI Mgmt Group resources: Token and Session Security Guide · NHI Lifecycle Management Guide · Ultimate Guide to NHIs: What are Non-Human Identities
Key terms
- Symmetric Key JWT: A symmetric key JWT is a token signed and verified with the same shared secret. It is operationally simple, but the security of every token depends on one secret remaining private and sufficiently random. If that secret is weak or exposed, anyone can forge valid tokens and impersonate legitimate identities.
- Token Forgery: Token forgery is the creation of a valid-looking authentication token without legitimate authorization from the identity provider. It usually depends on exposing signing keys, encryption secrets, or recovery material. In identity programmes, forgery matters because it bypasses login controls and turns stolen secrets into direct impersonation.
- Effective Entropy: Effective entropy is the usable strength of a password after structure or observable patterns are taken into account. It may be lower than the final measured entropy if an attacker learns how the password is assembled. This concept matters because predictable composition can make a secret easier to brute force.
- False Positive Rate: False positive rate is the share of alerts, detections, or test results that incorrectly indicate a problem when none exists. In security and identity operations, it measures how often a control flags benign activity as suspicious, usually expressed as a percentage of all negative cases. Lower rates reduce analyst noise and wasted response effort.
What's in the full report
Truffle Security's full analysis covers the operational detail this post intentionally leaves for the source:
- The exact guessing workflow used to test symmetric JWT secrets at scale
- The full distribution of most common secret values seen in production and on GitHub
- Methodology notes on how Shodan and GitHub samples were collected and filtered
- The detection challenges behind building a generic JWT validator with acceptable false positive rates
Deepen your knowledge
NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
Published by the NHIMG editorial team on October 19, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org