CVE-2023-33252

7.5 HIGH

📋 TL;DR

CVE-2023-33252 is a cryptographic vulnerability in iden3 snarkjs that allows double spending in zero-knowledge proof systems due to insufficient validation of public signals length. This affects any application using snarkjs for zk-SNARK verification, particularly blockchain and cryptocurrency implementations. Attackers can create invalid proofs that pass verification, enabling fraudulent transactions.

💻 Affected Systems

Products:
  • iden3 snarkjs
Versions: All versions through 0.6.11
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems using groth16 verification from snarkjs library.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of financial systems using snarkjs for transaction verification, allowing unlimited double spending and financial loss.

🟠

Likely Case

Targeted attacks against specific blockchain applications to create fraudulent transactions or manipulate smart contracts.

🟢

If Mitigated

Limited impact with proper monitoring and transaction validation layers in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires understanding of zk-SNARKs and ability to craft malicious proofs.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.6.12 and later

Vendor Advisory: https://github.com/iden3/snarkjs/security/advisories

Restart Required: No

Instructions:

1. Update snarkjs to version 0.6.12 or later using npm: npm update snarkjs
2. Verify the update with: npm list snarkjs
3. Rebuild and redeploy any applications using snarkjs.

🔧 Temporary Workarounds

Input validation wrapper

all

Add custom validation to check publicSignals length before calling groth16.verify

// Add validation in your code:
if (publicSignals.length >= fieldModulus) {
  throw new Error('Invalid public signals length');
}

🧯 If You Can't Patch

  • Implement additional transaction validation layers outside snarkjs
  • Monitor for unusual transaction patterns and implement rate limiting

🔍 How to Verify

Check if Vulnerable:

Check package.json or run: npm list snarkjs | grep snarkjs

Check Version:

npm list snarkjs | grep snarkjs

Verify Fix Applied:

Verify version is 0.6.12 or higher: npm list snarkjs

📡 Detection & Monitoring

Log Indicators:

  • Failed proof verifications with unusual public signals length
  • Multiple successful verifications with identical inputs

Network Indicators:

  • Unusual transaction patterns in blockchain applications
  • Rapid sequence of similar transactions

SIEM Query:

source="application" AND ("proof verification" OR "snarkjs") AND ("error" OR "invalid")

🔗 References

📤 Share & Export