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

SEC-53 DoS in block_processor on txs with invalid EC sig #1384

Closed
Gustav-Simonsson opened this issue Jul 3, 2015 · 2 comments
Closed

SEC-53 DoS in block_processor on txs with invalid EC sig #1384

Gustav-Simonsson opened this issue Jul 3, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@Gustav-Simonsson
Copy link

If at https://github.com/ethereum/go-ethereum/blob/develop/core/block_processor.go#L77
an error is returned which does not match

(IsNonceErr(err) || state.IsGasLimitErr(err) || IsInvalidTxErr(err))

Then it panics on line 84 as the gas variable is nil:

--- FAIL: TestBcInvalidRLPTests (0.28s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x5197a8]

goroutine 1457 [running]:
testing.func·006()
    /home/gs/golang/src/testing/testing.go:441 +0x181
math/big.(*Int).Add(0xc20889df80, 0xc20889df80, 0x0, 0xc2085b1600)
    /home/gs/golang/src/math/big/int.go:112 +0x38
github.com/ethereum/go-ethereum/core.(*BlockProcessor).ApplyTransaction(0xc208c22c00, 0xc208515290, 0xc2088d4980, 0xc2092798c0, 0xc2085b1680, 0xc20889df80, 0xc20876a500, 0x30, 0x0, 0x0, ...)
    /home/gs/go/src/github.com/ethereum/go-ethereum/core/block_processor.go:84 +0x3f6

The error returned for for test cases TRANSCT_rvalue_TooShort, TRANSCT_rvalue_TooLarge and TRANSCT_svalue_TooLarge in https://github.com/ethereum/tests/blob/develop/BlockchainTests/bcInvalidRLPTest.json

is https://github.com/ethereum/go-ethereum/blob/develop/core/types/transaction.go#L172

We can fix this by either making these errors of type IsInvalidTxErr, but the core problem here is the check for errors specific to package core. This breaks as the tx processing calls into other packages, for example crypto, which has it's own set of errors and does not import package core.

Probably a better solution is to reconsider the error type checking in this case, and explicitly handle generic errors in a way that will properly reject the tx.

@Gustav-Simonsson
Copy link
Author

This PR adds but skips the test that trigger this: #1385

@Gustav-Simonsson
Copy link
Author

#1395

@obscuren obscuren closed this as completed Jul 6, 2015
maoueh pushed a commit to streamingfast/go-ethereum that referenced this issue Mar 30, 2023
maoueh pushed a commit to streamingfast/go-ethereum that referenced this issue Apr 10, 2023
* add ip ratelimit

* update

* update

* update explorer adddress

* updae recapcha

* remove binance

* cmd/faucet: fix conn to wrapped wsconn

* cmd/faucet: keystore updated to save and load one same addres once

* clean: remove btcd v0.20.1-beta and avoid to ambiguous import (#1)

* ci: fix truffle test (ethereum#1384)

---------

Co-authored-by: fudongbai <296179868@qq.com>
Co-authored-by: Nathan <galaxystroller@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants