ZK/SEC Research notes from zkSecurity
All posts
zkbugs · Part 1 of 2

Reproducing and Exploiting ZK Circuit Vulnerabilities

zkbugs

Last February, we published a paper on systemizing vulnerabilities in Zero-Knowledge Proof (ZKP) implementations with collaborators from TUM, Imperial College London, Scroll, EF, and MatterLabs. Building on the dataset we released alongside the paper, we have been working to create a comprehensive GitHub repository where we reproduce known ZK circuit vulnerabilities.

Reproducing these vulnerabilities serves several important purposes:

  • Understanding Attack Vectors: Replicating vulnerabilities allows researchers and developers to gain deep insights into how specific attacks are executed. This understanding is crucial for identifying potential weaknesses in new systems and improving overall security measures.
  • Testing and Validating Fixes: By having a controlled environment to reproduce vulnerabilities, it becomes possible to test the efficacy of proposed fixes. This helps ensure that vulnerabilities are thoroughly patched and that no residual issues remain.
  • Educational and Research Value: Reproductions act as powerful educational tools, enabling the community to learn from existing vulnerabilities. This knowledge can be instrumental in identifying and mitigating similar issues in their own implementations.

The zkbugs Repository

We are excited to announce the launch of our GitHub repository dedicated to reproducing ZK circuit vulnerabilities. Currently, the repository contains 11 vulnerabilities, all of which are within the Circom DSL. However, we are actively working to expand this to include more DSLs and a broader range of vulnerabilities. You can find the repo here.

Each vulnerability within the repository is documented with a complete, end-to-end reproducible scripts that demonstrate how the exploit works. These scripts are designed to be as transparent and accessible as possible, providing users with a clear and detailed understanding of the vulnerability's root cause and its exploitation.

Steps for Reproducing a Vulnerability

Reproducing a ZK circuit vulnerability typically involves several key steps, which we’ve carefully structured in our repository:

  1. Identifying the Vulnerability: The first step is to select a vulnerability that has been documented and has sufficient information available, including a description, source code, and ideally, a Proof of Concept (PoC). Note that most of the times PoC are not provided in the audit reports.

  2. Setting Up the Environment: Before diving into the reproduction, it's essential to set up the environment. This includes installing all relevant dependencies for the DSL in which the vulnerable code is written. We provide helper scripts in the repository to streamline this process.

  3. Understanding the Exploit: Once the environment is ready, the next step is to analyze the vulnerable code to understand how the exploit can be executed. This often involves identifying specific points in the code where the logic fails, leading to an exploitable state. Typically, this information can be extracted by the bug report.

  4. Crafting the Exploit: After understanding the vulnerability, the next task is to craft the exploit. This typically involves manipulating input values or other parameters to trigger the vulnerability. In ZK circuits, this often means finding a witness that satisfies the constraints incorrectly, allowing the generation of a valid proof for an invalid statement. In many cases, this step is not trivial and we have been using Sage to help us come up with a malicious witness that surpass the constraints.

  5. Executing the Exploit: With the exploit crafted, it can then be executed using the scripts provided. This step involves running the code, generating the proof, and demonstrating that the verifier accepts the manipulated proof, thereby confirming the vulnerability.

Next Steps and Contributions

Moving forward, we are committed to expanding the repository with more vulnerabilities, covering additional DSLs, and improving our repo. Our goal is to create a robust resource that can be used by anyone interested in the security of ZK circuits.

We have already opened several issues in the repository, which anyone in the community is welcome to work on. Contributions are highly encouraged, whether by reproducing existing vulnerabilities, or improving the documentation and scripts. If you’re interested in contributing, please check out the open issues, and feel free to propose new ones.

In a following blog post, we will explain how we can create a PoC for a Circom vulnerability.

Keep reading
Recommended

The First ZK Exploits Happened, and They Weren't What We Expected

The first two known exploits against live ZK circuits happened in the past week. Both stem from the same root cause. They were not subtle underconstrained bugs, but rather Groth16 verifiers (generated by snarkjs) with an incorrect setup (just missing the last step). One was exploited by white-hat hackers for ~$1.5M, the other was drained for 5 ETH.

Stefanos Chaliasos, Hao Pham · February 27, 2026

zkSecurity took part in judging the latest zkHack Montreal

We recently had the thrill of judging the latest zkHack competition in Montreal, where developers, researchers, and enthusiasts dove into the world of zero-knowledge proofs and privacy tech. The projects were incredibly innovative, featuring creative applications like ZK breathalyzers and ZK & GPS solutions. Check out the exciting results and insights from this year's event. You won't want to miss what these brilliant minds are bringing to the table!

ZK/SEC · September 02, 2024

Public report of Sui's zkLogin audit

We just finished an audit of the Sui Foundation's zkLogin application and we're sharing what we found: the code is well-documented, tested, and specified. The zkLogin is set to make user authentication on the blockchain secure but simple, replacing cryptographic keys with familiar SSO methods like Google or Facebook while preserving user privacy. We also dive into the technical details behind JWT verification, non-native arithmetic for RSA, and vector programming. Plus, learn about the trusted setup process for zkLogin, ensuring maximum security through a decentralized multi-party ceremony. If you're curious about the intricate mechanics behind zkLogin, this is a must-read.

ZK/SEC · November 07, 2023
More to explore

Archetype x zkSecurity - Proof is in the Pudding: Privacy in Payment Networks

In Session 08 of "Proof is in the Pudding," we explore how different networks have approached privacy over the years. From E-Cash and Monero to MobileCoin and Zether, we break down blind signatures, Pedersen commitments, stealth addresses, ring signatures, and more. This session provides a comprehensive tour of the techniques used to break linkability, hide addresses, and obscure transaction data in the name of privacy and safety.

ZK/SEC · January 16, 2026

Auditing Self: Collaborating with Celo on Privacy and Identity Infrastructure

We recently teamed up with Celo for an in-depth security audit of the Self project, exploring its innovative approach to on-chain identity using biometric passports and zero-knowledge proofs. During our three-week dive, we examined everything from cryptographic primitives to smart contract architecture and a unique proof delegation system using AWS Nitro Enclaves. The Celo team impressed us with their commitment and responsiveness, and we collaborated on refining the system with strategic improvements. Curious about the nitty-gritty details and our insights? Check out the full report!

ZK/SEC · March 24, 2025

Sigma dance: commit, challenge, respond

Learn the fundamentals of Σ-protocols through the classic Schnorr protocol, exploring the three-step dance of commit, challenge, and respond. This post walks through knowledge soundness and witness extraction, then shows how to compose Sigma proofs with AND/OR logic and Pedersen commitments. See working SageMath implementations, discover how Fiat-Shamir transforms interactive proofs into non-interactive signatures, and understand the deeper mathematical structure as proofs of knowledge of homomorphism pre-images.

teddav · November 18, 2025