️ Signed, Sealed, Exploited: How a JWT Forgery in GraphQL Got M
A GraphQL endpoint exposed an internal schema and a JWT signing secret was hardcoded in a JavaScript bundle. An attacker could forge admin tokens, retrieve all user tokens, and access sensitive personal and payment data.
Free Link🎈
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the JWT signing secret was hardcoded in client-side JavaScript, and the GraphQL endpoint exposed sensitive queries without proper authorization checks.
Impact
The attacker could impersonate any user, extract sensitive PII, and access internal APIs.
What the attacker needed
Access to the public GraphQL endpoint; access to the public JavaScript bundle
How it was found
- Find the GraphQL endpoint at /graphql/internal.
- Run an introspection query to list schema types and fields.
- Fetch the JavaScript bundle and search for the JWT secret.
- Forge an admin JWT using the extracted secret.
- Send the forged token in the Authorization header to the adminGetAllTokens query.
- Use the returned tokens or query getUserById to access PII and payment data.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A JSON Web Token (JWT) is like a signed ID card that a website gives you after login. If the secret used to sign it is exposed, anyone can create a fake token claiming to be an admin. Here, the secret was left in a public JavaScript file, so the attacker could make an admin token and read other users' data.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.