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

Heap Overflow in WASI read/write API #323

Closed
ha1vk opened this issue Apr 7, 2022 · 1 comment
Closed

Heap Overflow in WASI read/write API #323

ha1vk opened this issue Apr 7, 2022 · 1 comment

Comments

@ha1vk
Copy link
Contributor

ha1vk commented Apr 7, 2022

the WASI API which uses iovs is not check the iovs' buf address and buf length,it would result in out of buffer.
run the poc,you will see the memory information leak
image
If you build with asan,you will see that buffer-overflow detected
root@ubuntu:~/Desktop# ./m3 ~/Desktop/wabt/bin/poc.wasm

==44312==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x631000038818 at pc 0x7f3b4c5ce93e bp 0x7ffcdce54020 sp 0x7ffcdce537c8
READ of size 28672 at 0x631000038818 thread T0
#0 0x7f3b4c5ce93d (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x4c93d)
.............

poc.wasm.zip

@vshymanskyy
Copy link
Member

Thanks for a great fix!

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

No branches or pull requests

2 participants