Tags: race-condition
Rating:
tl;dr:
1. Notice that gethostbyname2 is not thread safe and overwrites the results each time it's called
2. Notice race condition between threads calling gethostbyname2
3. Block one thread on IPv6 request, and in the meantime overwrite the IPv4 address it will query later for localhost
Full writeup: https://github.com/p4-team/ctf/tree/master/2019-09-21-dragonctf/rms