The Solana Foundation has revealed a previously undisclosed vulnerability in its token system, which emphasizes privacy, that could have potentially allowed attackers to create counterfeit zero-knowledge proofs. This, in turn, could have enabled the unauthorized creation or withdrawal of tokens. The vulnerability was initially reported on April 16 through a GitHub security advisory issued by Anza, accompanied by a functional proof-of-concept.
Immediately, engineers from Solana's development teams, including Anza, Firedancer, and Jito, verified the bug and started working on a solution, as outlined in a post-mortem report published on Saturday. The issue originated from the ZK ElGamal Proof program, which is responsible for verifying zero-knowledge proofs used in Solana's Token-22 confidential transfers. These extension tokens facilitate private balances and transfers by encrypting the amounts and utilizing cryptographic proofs for validation. Zero-knowledge proofs are a cryptographic technique that allows someone to prove they have knowledge of or access to something, such as a password or age, without actually revealing the information itself.
In cryptocurrency applications, zero-knowledge proofs can be used to validate the legitimacy of a transaction without disclosing specific amounts or addresses, which can otherwise be exploited by malicious actors. The bug occurred due to the absence of certain algebraic components in the hashing process during the Fiat-Shamir transformation, a standard method for making zero-knowledge proofs non-interactive.
A sophisticated attacker could have created invalid proofs that the on-chain verification system would have accepted, potentially allowing unauthorized actions such as creating an unlimited number of tokens or withdrawing tokens from other users' accounts. However, the vulnerability did not affect the standard SPL tokens or the main logic of the Token-2022 program.
Patches were privately distributed to validator operators starting April 17, and a second patch was released later that evening to address a related issue in the codebase. Both patches were reviewed by third-party security firms, including Asymmetric Research, Neodyme, and OtterSec. By April 18, a majority of validators had adopted the fix.
According to the post-mortem report, there is no indication that the bug was exploited, and all funds remain secure.