
# quic_server_sim.py - Vulnerable QUIC server (simulated handshake)
import socket
def send_quic_initial(conn, addr, server_salt):
# Respond with a large "server hello" without validating source address
# In real QUIC, the server must echo the client's token; here we skip that.
payload = b'\x00' * 1200 # large response
conn.sendto(payload, addr)
server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_socket.bind(('0.0.0.0', 4433))
print("QUIC server on :4433")
while True:
data, addr = server_socket.recvfrom(1024)
# Vulnerability: respond to any initial packet, no token verification
send_quic_initial(server_socket, addr, b'salt')
A QUIC server implementation fails to enforce source address validation during the handshake, allowing an attacker to send a small initial packet with a spoofed source IP. The server responds with a much larger packet, enabling DDoS amplification.
python quic_server_sim.py