Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect-return-in-assembly: Generated Solidity Verifier has Slither High Vulnerability #544

Open
infinitywarg opened this issue Jan 6, 2025 · 0 comments

Comments

@infinitywarg
Copy link

infinitywarg commented Jan 6, 2025

Solidity Verifier generated using snark.js when scanned with Slither v0.10.4 shows high vulnerabilities for assembly return.

https://github.com/crytic/slither/wiki/Detector-Documentation#incorrect-return-in-assembly

Suggested Fix:
Use the leave statement in assembly.

INFO:Detectors: MintVerifier.verifyProof(uint256[24],uint256[13]) (contracts/verifiers/MintVerifier.sol#145-1416) calls MintVerifier.verifyProof.asm_0.checkInput() (contracts/verifiers/MintVerifier.sol#224-231) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#220) MintVerifier.verifyProof(uint256[24],uint256[13]) (contracts/verifiers/MintVerifier.sol#145-1416) calls MintVerifier.verifyProof.asm_0.calculateD() (contracts/verifiers/MintVerifier.sol#1241-1328) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#1208) MintVerifier.verifyProof(uint256[24],uint256[13]) (contracts/verifiers/MintVerifier.sol#145-1416) calls MintVerifier.verifyProof.asm_0.calculateF() (contracts/verifiers/MintVerifier.sol#1330-1339) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#1208) MintVerifier.verifyProof(uint256[24],uint256[13]) (contracts/verifiers/MintVerifier.sol#145-1416) calls MintVerifier.verifyProof.asm_0.calculateE() (contracts/verifiers/MintVerifier.sol#1341-1352) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#1233) MintVerifier.verifyProof(uint256[24],uint256[13]) (contracts/verifiers/MintVerifier.sol#145-1416) calls MintVerifier.verifyProof.asm_0.checkPairing() (contracts/verifiers/MintVerifier.sol#1354-1396) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#1167) MintVerifier.verifyProof.asm_0.checkInput() (contracts/verifiers/MintVerifier.sol#224-231) calls MintVerifier.verifyProof.asm_0.checkField() (contracts/verifiers/MintVerifier.sol#217-222) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#220) MintVerifier.verifyProof.asm_0.calculateD() (contracts/verifiers/MintVerifier.sol#1241-1328) calls MintVerifier.verifyProof.asm_0.g1_mulAccC() (contracts/verifiers/MintVerifier.sol#1197-1220) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#1208) MintVerifier.verifyProof.asm_0.calculateD() (contracts/verifiers/MintVerifier.sol#1241-1328) calls MintVerifier.verifyProof.asm_0.g1_mulSet() (contracts/verifiers/MintVerifier.sol#1237-1239) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#1233) MintVerifier.verifyProof.asm_0.calculateD() (contracts/verifiers/MintVerifier.sol#1241-1328) calls MintVerifier.verifyProof.asm_0.g1_mulSetC() (contracts/verifiers/MintVerifier.sol#1222-1235) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#1233) MintVerifier.verifyProof.asm_0.calculateD() (contracts/verifiers/MintVerifier.sol#1241-1328) calls MintVerifier.verifyProof.asm_0.g1_acc() (contracts/verifiers/MintVerifier.sol#1156-1169) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#1167) MintVerifier.verifyProof.asm_0.calculateF() (contracts/verifiers/MintVerifier.sol#1330-1339) calls MintVerifier.verifyProof.asm_0.g1_mulAccC() (contracts/verifiers/MintVerifier.sol#1197-1220) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#1208) MintVerifier.verifyProof.asm_0.checkPairing() (contracts/verifiers/MintVerifier.sol#1354-1396) calls MintVerifier.verifyProof.asm_0.g1_mulSet() (contracts/verifiers/MintVerifier.sol#1237-1239) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#1233) MintVerifier.verifyProof.asm_0.checkPairing() (contracts/verifiers/MintVerifier.sol#1354-1396) calls MintVerifier.verifyProof.asm_0.g1_acc() (contracts/verifiers/MintVerifier.sol#1156-1169) which halt the execution return(uint256,uint256)(0,0x20) (contracts/verifiers/MintVerifier.sol#1167) Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#incorrect-return-in-assembly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant