Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
{
"MiMC Hash: Assigned but not Constrained": {
"Id": "iden3/circomlib/Kobi-Gurkan-MiMC-Hash-Assigned-but-not-Constrained",
"Path": "dataset/circom/iden3/circomlib/kobi_gurkan_mimc_hash_assigned_but_not_constrained",
"Project": "https://github.com/iden3/circomlib",
"Commit": "324b8bf8cc4a80357354752deb6c2ae5be22e5f5",
"Fix Commit": "109cdf40567fce284dca1d535819ce28922653e0",
"DSL": "Circom",
"Vulnerability": "Under-Constrained",
"Impact": "Soundness",
"Root Cause": "Assigned but Unconstrained",
"Reproduced": false,
"Codebase": "dataset/codebases/circom/iden3/circomlib/324b8bf8cc4a80357354752deb6c2ae5be22e5f5",
"Direct Entrypoint": "circuit.circom",
"Location": {
"Path": "circuits/mimcsponge.circom",
"Function": "MiMCSponge",
"Line": "26"
},
"Source": {
"Bug Tracker": {
"Source Link": "https://github.com/0xPARC/zk-bug-tracker?tab=readme-ov-file#14-mimc-hash-assigned-but-not-constrained",
"Bug ID": "MiMC Hash: Assigned but not Constrained"
}
},
"Input": {
"Original": "input.json",
"Direct": "direct_input.json"
},
"Commands": {
"Setup Environment": "./zkbugs_setup.sh",
"Compile and Preprocess": "./zkbugs_compile_setup.sh",
"Positive Test": "./zkbugs_positive_test.sh",
"Clean": "./zkbugs_clean.sh",
"Compile": "./zkbugs_compile.sh"
},
"Short Description of the Vulnerability": "In `MiMCSponge` template, `outs[0]` is assigned but not constrained, so it can be any value. Note that the circuit code is modified from a newer version since the original buggy code couldn't be reproduced in Circom version 2. The bug idea is still the same.",
"Proposed Mitigation": "Use `<==` instead of `<--` to add a constraint to `outs[0]`.",
"Similar Bugs": [
"aptos-labs/keyless-zk-proofs/koukyosyumei_unconstrained_base64_decoded_len",
"inference-labs-inc/subnet-2-circom/koukyosyumei_subtract_unconstrained_multiplier",
"personaelabs/spartan-ecdsa/yacademy_under_constrained_circuits_compromising_the_soundness_of_the_system",
"siv-org/verifiable-private-overrides/koukyosyumei_extractstringfrompoint_shiftedfirstbyte_unconstrained",
"succinctlabs/telepathy-circuits/veridise_arrayxor_is_under_constrained"
],
"Executed": true,
"Compiled Direct": true,
"Compiled Original": true,
"Original Entrypoint": []
}
}
{
"MiMC Hash: Assigned but not Constrained": {
"Id": "iden3/circomlib/Kobi-Gurkan-MiMC-Hash-Assigned-but-not-Constrained",
"Path": "dataset/circom/iden3/circomlib/kobi_gurkan_mimc_hash_assigned_but_not_constrained",
"Project": "https://github.com/iden3/circomlib",
"Commit": "324b8bf8cc4a80357354752deb6c2ae5be22e5f5",
"Fix Commit": "109cdf40567fce284dca1d535819ce28922653e0",
"DSL": "Circom",
"Vulnerability": "Under-Constrained",
"Impact": "Soundness",
"Root Cause": "Assigned but Unconstrained",
"Reproduced": true,
"Codebase": "dataset/codebases/circom/iden3/circomlib/324b8bf8cc4a80357354752deb6c2ae5be22e5f5",
"Direct Entrypoint": "circuit.circom",
"Location": {
"Path": "circuits/mimcsponge.circom",
"Function": "MiMCSponge",
"Line": "26"
},
"Source": {
"Bug Tracker": {
"Source Link": "https://github.com/0xPARC/zk-bug-tracker?tab=readme-ov-file#14-mimc-hash-assigned-but-not-constrained",
"Bug ID": "MiMC Hash: Assigned but not Constrained"
}
},
"Input": {
"Original": "input.json",
"Direct": "direct_input.json"
},
"Commands": {
"Setup Environment": "./zkbugs_setup.sh",
"Compile and Preprocess": "./zkbugs_compile_setup.sh",
"Positive Test": "./zkbugs_positive_test.sh",
"Clean": "./zkbugs_clean.sh",
"Compile": "./zkbugs_compile.sh"
},
"Short Description of the Vulnerability": "In `MiMCSponge` template, `outs[0]` is assigned but not constrained, so it can be any value. Note that the circuit code is modified from a newer version since the original buggy code couldn't be reproduced in Circom version 2. The bug idea is still the same.",
"Proposed Mitigation": "Use `<==` instead of `<--` to add a constraint to `outs[0]`.",
"Similar Bugs": [
"aptos-labs/keyless-zk-proofs/koukyosyumei_unconstrained_base64_decoded_len",
"inference-labs-inc/subnet-2-circom/koukyosyumei_subtract_unconstrained_multiplier",
"personaelabs/spartan-ecdsa/yacademy_under_constrained_circuits_compromising_the_soundness_of_the_system",
"siv-org/verifiable-private-overrides/koukyosyumei_extractstringfrompoint_shiftedfirstbyte_unconstrained",
"succinctlabs/telepathy-circuits/veridise_arrayxor_is_under_constrained"
],
"Executed": true,
"Compiled Direct": true,
"Compiled Original": true,
"Original Entrypoint": []
}
}