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

[Fix] Add additional input/output checks to Execution verification #2511

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

raychu86
Copy link
Contributor

@raychu86 raychu86 commented Jul 1, 2024

Motivation

This PR adds additional safety checks to Execution verification. Previously we weren't explicitly checking the number of transition inputs/outputs; we were passing through the inputs and outputs to the Varuna proof verification as the guarantee. The problem is that the Varuna verifier pads the inputs with Field::zero. This means that malicious parties can craft a mutated transactions by taking an honest execution transaction, adding an extra Output::ExternalRecord(Field::zero)) output that uses the same proof (and different fee), and crafting a new transaction with a new ID that performs the same state transition.

We fix this by adding an explicit check against the number if inputs and the number of outputs in each transition.

TLDR:
This "attack" can NOT perform malicious state changes. It will be able to cause the honest transaction to be rejected, but still perform the same state changes. The risk is that this may cause a victim to be enticed/confused into re-executing their transaction.

The CI run is here.

Test Plan

A test has been added to ensure that the mutated transaction fails to verify due to the newly added check against the number of outputs.

Related Issues

Partially related to possible transaction mutations discussed here - #2451.

@raychu86 raychu86 requested a review from vicsn July 1, 2024 22:09
Copy link
Contributor

@vicsn vicsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@zosorock zosorock merged commit ef547d9 into AleoNet:mainnet-staging Jul 29, 2024
83 checks passed
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

Successfully merging this pull request may close these issues.

5 participants