Resources

People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!

curl HTTP/2 upload Use-After-Free- 2237

onn4aPosted 27 Days Ago
  • During a file upload, curl mishandles the HTTP/2 Reset Stream received from a server. This happens because multi.c converts the reset into a retry, and calls multi_done(). Because Curl_conn_ev_data_done() makes Curl forget about the transfer, the buffered unsent remainder of the upload body is flushed. Now, curl opens a new stream, and frees the pointer. On the retry, the Curl_easy object is thus UAFed.
  • The report shows an ASCII table of the control flow that leads to the bug. I actually really like this, especially for maintainers that would understand their codebase so deeply.
  • The exploitability for RCE seems doable but requires a deep knowledge of the system, the settings used on the call, and many other things. Because of this, it was rated as high instead of critical. Still, pretty neat that a UAF was found in Curl that could be exploited for RCE! This is one of the most solid codebases out there.