Skip to content

No integrity verification of downloaded ZK bytecode or trusted setup #11

Description

@rachyandco

Location: src/RnNoirModule.ts:54-82 (trusted setup), src/RnNoirModule.ts:113-147 (bytecode)

Issue: Circuit bytecode and the UltraPlonk trusted setup are downloaded from Google Cloud Storage with no checksum or hash check:

  // Trusted setup — no hash check
  const url =
  'https://storage.googleapis.com/rarimo-store/trusted-setups/ultraPlonkTrustedSetup.dat';
  await downloadResumable.downloadAsync();

  // Bytecode — same pattern, no hash check
  await downloadResumable.downloadAsync();

Impact: A compromised GCS bucket, CDN cache poisoning, or future supply-chain compromise could silently serve malicious bytecode that generates proofs with manipulated public inputs (e.g., wrong nullifiers, wrong citizenship claims). The user's device would compute and submit a proof they believe is correct but isn't.

Fix: Embed a hardcoded SHA-256 or BLAKE3 hash for each known-good file version. After download, compute the hash and reject mismatches before calling prove.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions