Skip to content

Incorrect Bounds Checking Skips Verification of Epoch 0 (GSR-09) #2403

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

Closed
danforbes opened this issue Mar 18, 2022 · 0 comments · Fixed by #2503
Closed

Incorrect Bounds Checking Skips Verification of Epoch 0 (GSR-09) #2403

danforbes opened this issue Mar 18, 2022 · 0 comments · Fixed by #2503
Assignees

Comments

@danforbes
Copy link
Contributor

The function SkipVerify(), will skip BABE verification if the epoch is less than or equal to skipToEpoch.

When running a live node the variable skipToEpoch should be unused, however it will default to 0. Thus, headers will never be verified for epoch 0. As epochs begin counting from 0 the first epoch worth of blocks will not be verified allowing nodes to send malicious blocks that will be accepted.

Consider reducing the condition that compares epoch to s.skipToEpoch to use a strict inequality.

@kishansagathiya kishansagathiya self-assigned this Apr 27, 2022
kishansagathiya added a commit that referenced this issue Apr 28, 2022
compares epoch to s.skipToEpoch with strict inequality. So, far we were
checking less than or equal to, in which epoch 0 never gets verified.

Fixes #2403
kishansagathiya added a commit that referenced this issue May 5, 2022
compares epoch to s.skipToEpoch with strict inequality. So, far we were
checking less than or equal to, in which epoch 0 never gets verified.

Fixes #2403
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 a pull request may close this issue.

2 participants