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

Some out-of-range proof values pass the verification #423

Open
khovratovich opened this issue Sep 4, 2023 · 0 comments
Open

Some out-of-range proof values pass the verification #423

khovratovich opened this issue Sep 4, 2023 · 0 comments

Comments

@khovratovich
Copy link

Here one could submit a _pA[1] value that is out of range

function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[<%=IC.length-1%>] calldata _pubSignals) public view returns (bool) {

and it will silently be taken modulo q before point negation.
mstore(add(_pPairing, 32), mod(sub(q, calldataload(add(pA, 32))), q))

Consider range-checking the coordinate before processing.

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