Analysis and Vulnerabilities in zkLogin
Sofia Celi (Brave & University of Bristol), Kyle Den Hartog (Brave), Hamed Haddadi (Imperial College London & Brave Software)
Accepted paper presented at ZKProof 8 in Rome, May 9–10, 2026.
Speaker

Sofia Celi
Brave & University Of Bristol
About this talk
Read the summary
This summary was generated with AI from the talk recording and edited by the ZKProof team. It was not written or reviewed by the speaker or the paper's authors, and may contain errors. For the authoritative account of this work, please refer to the paper.
At ZKProof 8 in Rome, Sofía Celi presented a security analysis of zkLogin, a zero-knowledge system deployed in production that lets users authorize blockchain transactions with their existing web logins. The vulnerabilities her team found are not cryptographic: they come from parsing, trust assumptions and deployment choices around the proofs.
Zero-knowledge attestation systems
zkLogin belongs to a family Celi calls zero-knowledge attestation systems: protocols that prove, in zero knowledge, a statement about an externally produced document, and use that proof to authorize later actions. Examples include proving something about a document to show a user isn't a bot, as well as proposals like zkTLS. They are usable, since the user doesn't have to present the document each time, and private, since the document stays hidden.
The team analyzed zkLogin from its paper, its code, and by reverse engineering parts that weren't public. Celi stressed that this is not a criticism of the cryptography, which she called really cool, but a lesson in how such systems can fail in deployment. A key argument: it isn't enough to prove that a statement appears in a document. The proof must also show that the document conforms to its format's grammar, here the rules for JSON and JSON Web Tokens (JWTs).
How zkLogin works
zkLogin builds on OpenID Connect, where a website (the relying party) lets users log in through a provider such as Google, which returns a signed JWT. A JWT has three parts:
- a header, including the signing algorithm and the ID of the provider's signing key;
- a payload of claims, notably the issuer, the subject (the user's identity in the issuer's namespace, such as a Gmail address), the audience (the application the token is for), and a short expiration;
- a signature.
zkLogin adds an external proving service, a salt service and an on-chain verifier:
- The application generates an ephemeral key pair and an expiration, and computes a nonce by hashing the public key, the expiration and a random value. zkLogin uses this nonce for unlinkability, whereas OpenID Connect intends nonces for replay protection, and it outlives the JWT's own expiration, which is itself a weakness.
- The user logs in with the provider and receives a signed JWT containing that nonce.
- A salt service provides a salt, and the user's zkLogin address is a hash of the subject, audience, issuer and salt, again for unlinkability.
- The proving service receives the JWT, nonce, key and salt. It extracts claims with an ad hoc selective parsing procedure, and proves in zero knowledge that this parsing was done, that the nonce and address were computed correctly, and that the JWT was signed by an issuer with published keys.
Questionable assumptions
zkLogin assumes that the backend services are untrusted, that the OpenID provider is trusted, and that the front end is trusted because it is open to public scrutiny. Celi argued the front end assumption is unrealistic, since being publicly inspectable makes it easier to attack, not harder. Trusting issuers by default is also risky in a federated system, as even well-known issuers have historically produced malformed JWTs.
Vulnerabilities
- Malformed JWTs pass the parser. The selective parsing only checks a few patterns, such as quoted strings separated by colons and ending in a comma or brace. It accepts duplicate claims, which the JSON specification leaves ambiguous, so one part of the system can read the first value and another the second. It also accepts stray whitespace in claim names and even injected JavaScript inside values. This allows claims to be shadowed or injected.
- Anyone can be an issuer. The code accepts issuers such as AWS Cognito tenants, which anyone can set up, so an attacker can mint and sign their own malicious JWTs.
- Cross-audience and cross-subject impersonation. Nothing checks that the subject belongs to the issuer's namespace. A malicious issuer can produce JWTs for, say, a Gmail address, for users who never authenticated with that provider and don't belong to it.
- Secrets in browser storage. zkLogin's documentation recommends storing secrets, including secret keys, salts and nonces, in the browser's local storage, where any injected script or anyone opening developer tools can extract them.
Combined, these allow an end-to-end attack: set up an arbitrary AWS Cognito tenant, extract secrets from local storage, craft a malicious JWT with chosen audience and subject, and sign it with the tenant's keys. The result passes all validation and can be linked to another application and issuer. The team reported the findings in November 2025. The initial response argued that the issuers are fully trusted, but after pushback the zkLogin team said it would implement proper parsing; discussions were ongoing at the time of the talk.
Recommendations
- Establish a root of trust for issuers, as the web does for TLS certificate authorities, rather than accepting arbitrary ones.
- Keep secrets out of the browser, using backend services or session-bound cookies instead.
- Reject malformed JWTs, and parse them properly in zero knowledge.
- Check that the subject belongs to the issuer's namespace, and that the audience is the one the issuer actually assigned to the application.
From the Q&A
- Is proving parsing against a regular expression enough? No. Constraints such as unique claims aren't well captured by regular expressions, and checks like "this subject belongs to this issuer" are context-dependent. Celi pointed to works on proving regular expressions (Reef) and context-free grammars (Coral) in zero knowledge as starting points, but full JWT validation needs context-dependent grammars.
- Can this work with OpenID Connect without modifying it? Celi recommended not relying on JWTs at all: they are frequently stolen, and their expiration should be short, whereas zkLogin extends their lifetime. A more promising route is to prove statements about a TLS-authenticated response, as in zkTLS, or to use one-time tokens such as Privacy Pass, which are being discussed at the IETF.
- Are range checks needed on payload values? Not here, since all values are strings. For something like age verification, the proof would need to show that a value is a well-formed integer and then use a range proof.
- Are these JWTs meant for anything beyond read-only use? In the web, they are typically short-lived tokens for read-only use.
Go further
More ZKProof 8 talks on this topic
Applications of zero-knowledge proofs
Using existing credentials and MPC-in-the-Head for browser-based private authentication to blockchain
Andres Ojamaa (Cybernetica AS), Martin Pettai (Cybernetica AS), Martin Suomalainen (Cybernetica AS), Peeter Laud (Cybernetica AS)
- Video
TruthTable: A Verifiable Query Engine
Ryan Marcus (University of Pennsylvania), Pratyush Mishra (University of Pennsylvania), Bharath Namboothiry (University of Pennsylvania), Alireza Shirzad (University of Pennsylvania), Spencer Solit (Seismic Systems)
- Video
- Paper
Laminate: Succinct SIMD-Friendly Verifiable FHE
Ben Fisch (Yale University), Zeyu Liu (Yale University), Kabir Peshawaria (Boston University), Eran Tromer (Boston University)
- Video
- Paper
Batch, Pack, and Prove: More Efficient Verifiable Computation for CKKS
Ignacio Cascudo (IMDEA Software), Anamaria Costache (École Polytechnique), Daniele Cozzo (IMDEA Software Institute), Dario Fiore (IMDEA Software Institute), Antonio Guimarães (IMDEA Software Institute), Eduardo Soria Vazquez (Technology Innovation Institute)
- Video
- Paper
