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

les: add Skip overflow check to GetBlockHeadersMsg handler #16891

Merged
merged 1 commit into from Jun 5, 2018

Conversation

Projects
None yet
3 participants
@zsfelfoldi
Contributor

zsfelfoldi commented Jun 4, 2018

This PR adds the same check for GetBlockHeadersMsg.Skip overflow attack that has already been implemented for the ETH protocol.

@karalabe

LGTM

@karalabe karalabe added this to the 1.8.10 milestone Jun 5, 2018

@karalabe karalabe merged commit a5237a2 into ethereum:master Jun 5, 2018

2 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
commit-message-check/gitcop All commit messages are valid
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@holiman

This comment has been minimized.

Contributor

holiman commented Jun 5, 2018

Might want to add

diff --git a/les/handler_test.go b/les/handler_test.go
index 31aad3ed4..fde7c2a11 100644
--- a/les/handler_test.go
+++ b/les/handler_test.go
@@ -75,6 +75,11 @@ func testGetBlockHeaders(t *testing.T, protocol int) {
                        &getBlockHeadersData{Origin: hashOrNumber{Number: limit / 2}, Amount: 1},
                        []common.Hash{bc.GetBlockByNumber(limit / 2).Hash()},
                },
+               // Overflow attack
+               {
+                       &getBlockHeadersData{Origin: hashOrNumber{Hash:bc.GetBlockByNumber(1).Hash()}, Amount: 1,Skip:0xFFFFFFFFFFFFFFFF},
+                               []common.Hash{},
+               },
                // Multiple headers should be retrievable in both directions
                {

kielbarry added a commit to kielbarry/go-ethereum that referenced this pull request Jun 7, 2018

@karalabe karalabe modified the milestones: 1.8.10, 1.8.11 Jun 11, 2018

jpeletier pushed a commit to epiclabs-io/go-ethereum that referenced this pull request Jun 14, 2018

kielbarry added a commit to kielbarry/go-ethereum that referenced this pull request Jul 9, 2018

firmianavan added a commit to firmianavan/go-ethereum that referenced this pull request Aug 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment