-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
New Tcache bins attack on 2.27 and later for arbitrary write #127
base: master
Are you sure you want to change the base?
Conversation
I think the idea is not very clear at the moment. I like the idea of bypassing double free protection by putting the same chunk into two different tcache. However, the current idea requires two different primitives: 1. size overwrite, 2. double free. And either of them can give us arbitrary write primitive on its own. |
I have made some changes to the code now you only need double-free primitive. This attack could be thought of as another version of the house of botcake and could be little more flexible as you don't have to fill tcache. |
Actually, the new version doesn't use overwrite primitive but a UAF. Normal program won't realloc a chunk after it is freed. |
Hey there, the one thing that sticks out to me is using the realloc function to exploit a double free. After seeing this, I played around with it for quite a while and realized that realloc can do a some interesting things:
When testing the second piece of functionality, I noticed that this works very well with tcache and smallbins! Then, kind of works because the unsorted bin validates the new size of the chunk, which means we can only overlap first half of the realloc chunk with this. Finally, the fastbins and largebins do not work because the chunk size is validated prior to removal. |
Below is a POC for the second point that I mentioned above. It would be interesting to add some quirks of realloc into this repository! I have also seen a fake chunk creates with realloc for a House of Spirit-like attack.
|
This attack will give arbitrary write by Tcache list poisoning.
I propose the name House Of Mango.
This is just a PoC I will refine the code and comments readability once the idea is validated.