做题的时候有考虑过CVE,但当时没去查……
CVE–2018-1000001
该题思路来源于glibc的CVE–2018-1000001,是一个glibc的缓冲区溢出漏洞,分析后发现能在堆上进行溢出。
以下分析stdlib/canonicalize.c中的__realpath()函数(__canonicalize_file_name仅仅调用__realpath(),没有其它操作)。
This pwn is a classic heap pwn. In its Edit() function exits a heap overflow of arbitrarily write.
Checksec:
1 | Arch: amd64-64-little |
This pwn exists off-by-one:
The program can Build(), Upgrade() and See() the house of orange. In Build(), the program first malloc a chunk of size 0x10 to store two address, one is color and price, and the other is the name. At the end of the Build(), a variable on bss will store the new house address and use it in Upgrade() and See(). We can use Upgrade() and See() to update and see the newest house.