Skip to content

fix(http3): only send QUIC DATAGRAM after SETTINGS_H3_DATAGRAM negotiation - #4155

Draft
larseggert wants to merge 1 commit into
mainfrom
fix-ANT-2026-JE9BAEXL
Draft

larseggert wants to merge 1 commit into
mainfrom
fix-ANT-2026-JE9BAEXL

Conversation

@larseggert

Copy link
Copy Markdown
Collaborator

connect-udp chose QUIC DATAGRAM frames whenever the peer's max_datagram_frame_size was non-zero, even if either side had not sent SETTINGS_H3_DATAGRAM = 1, which RFC 9297 §2.1.1 forbids. HTTP Datagrams now go out as DATAGRAM capsules on the CONNECT stream unless the transport parameter, the peer's received setting and the local setting all allow QUIC DATAGRAM. WebTransport is unchanged, because it cannot be negotiated without the setting.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-JE9BAEXL.

Copilot AI balanced review requested due to automatic review settings October 22, 2026 10:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review found no blocking issues in the focused negotiation fix or bidirectional regression coverage; tests were not executed.

No open issues 🎉

What changed in this PR

This PR fixes HTTP/3 datagram selection for connect-udp: QUIC DATAGRAM is used only when the peer’s transport parameter and both endpoints’ HTTP/3 settings allow it. Otherwise, datagrams use capsules on the CONNECT stream. WebTransport behavior remains unchanged.

Changes:

  • Gate QUIC DATAGRAM sending on transport support and local and received peer settings.
  • Pass the negotiation result to the session’s existing capsule fallback.
  • Add bidirectional regression coverage verifying capsule delivery without QUIC DATAGRAM frames.
File Description
neqo-http3/​tests/​connect_udp.rs Extracts configurable session setup and tests fallback when the proxy disables HTTP/3 datagrams.
neqo-http3/​src/​features/​extended_connect/​session.rs Selects capsule fallback using the caller’s negotiation result.
neqo-http3/​src/​connection.rs Checks datagram negotiation before sending and condenses the existing 0-RTT settings comment.

Review effort: Balanced

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings.

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.81%. Comparing base (3f539e1) to head (76d4661).
⚠️ Report is 65 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4155      +/-   ##
==========================================
- Coverage   96.97%   96.81%   -0.17%     
==========================================
  Files         113      118       +5     
  Lines       42253    42607     +354     
  Branches    42253    42607     +354     
==========================================
+ Hits        40976    41250     +274     
- Misses       1263     1333      +70     
- Partials       14       24      +10     
Flag Coverage Δ
freebsd 94.70% <100.00%> (-0.14%) ⬇️
linux 97.02% <100.00%> (-0.01%) ⬇️
macos 95.12% <100.00%> (-0.04%) ⬇️
windows 95.22% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
neqo-common 99.32% <100.00%> (ø)
neqo-http3 95.62% <100.00%> (+<0.01%) ⬆️
neqo-qpack 96.71% <ø> (ø)
neqo-transport 97.66% <100.00%> (-0.03%) ⬇️
neqo-udp 90.03% <ø> (ø)
mtu 89.13% <ø> (ø)

@codspeed

codspeed Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will regress 1 benchmark

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 5 improved benchmarks
❌ 1 regressed benchmark
✅ 95 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Walltime 1-conn/1-1b-resp (aka. HPS) 3.5 ms 3.6 ms -2.03%
⚡ Walltime 1-conn/10_000-parallel-1b-resp (aka. RPS) 81.6 ms 78.4 ms +4.17%
⚡ Walltime walltime/pacing-true/varying-seeds 4.7 ms 4.5 ms +3.77%
⚡ Walltime walltime/pacing-true/same-seed 4.5 ms 4.4 ms +2.72%
⚡ Walltime walltime/pacing-false/same-seed 4 ms 3.9 ms +2.6%
⚡ Walltime walltime/pacing-false/varying-seeds 4 ms 3.9 ms +2.29%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix-ANT-2026-JE9BAEXL (76d4661) with main (db74969)

Open in CodSpeed

@larseggert larseggert added p3 Backlog client-side Issue relates more to clients extended-connect WebTransport, CONNECT, connect-udp, HTTP datagrams labels Oct 27, 2026
@larseggert
larseggert force-pushed the fix-ANT-2026-JE9BAEXL branch from 8d0a4be to a01cbcc Compare October 28, 2026 10:21

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings.

…ation

Fall back to DATAGRAM capsules for connect-udp unless SETTINGS_H3_DATAGRAM=1 was both sent and received (RFC 9297 §2.1.1).

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-JE9BAEXL.
@larseggert
larseggert force-pushed the fix-ANT-2026-JE9BAEXL branch from a01cbcc to 76d4661 Compare October 28, 2026 14:42

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings.

@github-actions

Copy link
Copy Markdown
Contributor

Failed Interop Tests

QUIC Interop Runner, client vs. server, differences relative to main at db74969.

neqo-pr as clientneqo-pr as server
neqo-pr vs. go-x-net: BP BA
neqo-pr vs. haproxy: M BP BA
neqo-pr vs. kwik: 🚀H LR M 🚀Z U ⚠️3 L1 C1 ⚠️BP
neqo-pr vs. linuxquic: run cancelled after 20 min
neqo-pr vs. lsquic: L1 C1
neqo-pr vs. msquic: A L1 C1
neqo-pr vs. mvfst: A BA
neqo-pr vs. neqo: 🚀Z A
neqo-pr vs. nginx: BP BA
neqo-pr vs. ngtcp2: Z L1 C1 CM
neqo-pr vs. picoquic: A BA
neqo-pr vs. quic-go: A
neqo-pr vs. quiche: BP BA
neqo-pr vs. s2n-quic: CM
neqo-pr vs. tquic: S BP BA
neqo-pr vs. xquic: S R Z A L1 C1
go-x-net vs. neqo-pr: CM
kwik vs. neqo-pr: BP BA CM
linuxquic vs. neqo-pr: run cancelled after 20 min
msquic vs. neqo-pr: 🚀Z CM
mvfst vs. neqo-pr: Z L1 C1 CM
neqo vs. neqo-pr: run cancelled after 20 min
openssl vs. neqo-pr: LR M A CM
quic-go vs. neqo-pr: run cancelled after 20 min
quic-zig vs. neqo-pr: baseline result missing
quiche vs. neqo-pr: 🚀C1 CM
quinn vs. neqo-pr: V2 CM
s2n-quic vs. neqo-pr: ⚠️L1 BA CM
tquic vs. neqo-pr: CM
xquic vs. neqo-pr: baseline result missing
All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

neqo-pr as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

neqo-pr as server

@github-actions

Copy link
Copy Markdown
Contributor

Client/server transfer results

Performance differences relative to db74969.

Transfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.

Client vs. server Mean±σ Min–Max Median±MAD MiB/s±σ ΔMedian
google-neqo-cubic 80.6 ± 0.4 79.3 – 81.9 80.6 ± 0.4 396.8 ± 2.2 💔 +1.1 (+1.3%)
neqo-neqo-newreno 22.9 ± 0.2 22.5 – 23.4 22.9 ± 0.2 1396.8 ± 12.5 💚 -0.3 (-1.3%)
neqo-neqo-newreno-nopacing 22.7 ± 0.2 22.3 – 23.2 22.7 ± 0.2 1411.3 ± 12.8 💔 +0.2 (+1.0%)
quiche-neqo-cubic 36.1 ± 0.6 34.7 – 37.7 36.2 ± 0.5 886.4 ± 14.9 💚 -1.3 (-3.5%)

Table above only shows statistically significant changes. See all results below.

All results

Transfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.

Client vs. server Mean±σ Min–Max Median±MAD MiB/s±σ ΔMedian
google-google 155.1 ± 0.7 153.5 – 156.6 155.1 ± 0.7 206.3 ± 0.9
google-neqo-cubic 80.6 ± 0.4 79.3 – 81.9 80.6 ± 0.4 396.8 ± 2.2 💔 +1.1 (+1.3%)
neqo-google-cubic 247.8 ± 40.4 200.1 – 326.9 248.2 ± 62.8 129.1 ± 21.1 -8.6 (-3.3%)
neqo-neqo-cubic 22.9 ± 0.2 22.6 – 23.6 22.9 ± 0.2 1394.4 ± 12.0 +0.0 (+0.1%)
neqo-neqo-cubic-nopacing 23.2 ± 0.2 22.9 – 23.7 23.2 ± 0.2 1379.6 ± 11.1 +0.1 (+0.3%)
neqo-neqo-newreno 22.9 ± 0.2 22.5 – 23.4 22.9 ± 0.2 1396.8 ± 12.5 💚 -0.3 (-1.3%)
neqo-neqo-newreno-nopacing 22.7 ± 0.2 22.3 – 23.2 22.7 ± 0.2 1411.3 ± 12.8 💔 +0.2 (+1.0%)
neqo-quiche-cubic 34.6 ± 0.4 33.8 – 35.6 34.6 ± 0.3 924.8 ± 10.0 +0.0 (+0.1%)
neqo-s2n-cubic 45.6 ± 0.2 45.1 – 46.0 45.7 ± 0.2 701.4 ± 3.2 -0.0 (-0.0%)
quiche-neqo-cubic 36.1 ± 0.6 34.7 – 37.7 36.2 ± 0.5 886.4 ± 14.9 💚 -1.3 (-3.5%)
quiche-quiche 41.8 ± 0.3 41.1 – 42.3 41.8 ± 0.3 766.2 ± 4.7
s2n-neqo-cubic 127.0 ± 0.4 125.9 – 128.8 127.0 ± 0.3 251.9 ± 0.8 +0.4 (+0.3%)
s2n-s2n ⚠️ 176.0 ± 21.8 147.0 – 269.9 170.8 ± 1.0 181.8 ± 22.5

Download data for profiler.firefox.com or download performance comparison data.

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

No significant performance differences relative to db74969.

All results
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500
       time:   [57.045 ms 57.085 ms 57.127 ms]
       thrpt:  [1.7094 GiB/s 1.7107 GiB/s 1.7119 GiB/s]
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500
       time:   [56.526 ms 56.575 ms 56.625 ms]
       thrpt:  [1.7246 GiB/s 1.7261 GiB/s 1.7276 GiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500
       time:   [3.5415 ms 3.5423 ms 3.5431 ms]
       thrpt:  [282.24   B/s 282.31   B/s 282.37   B/s]
Found 6 outliers among 100 measurements (6.00%)
4 (4.00%) high mild
2 (2.00%) high severe
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500
       time:   [81.632 ms 81.822 ms 82.016 ms]
       thrpt:  [121.93 Kelem/s 122.22 Kelem/s 122.50 Kelem/s]
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild
streams-flow-controlled/walltime/1-streams/each-4194304-bytes
       time:   [12.644 ms 12.648 ms 12.652 ms]
       thrpt:  [316.15 MiB/s 316.26 MiB/s 316.36 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
streams-flow-controlled/walltime/10-streams/each-1048576-bytes
       time:   [34.445 ms 34.461 ms 34.476 ms]
       thrpt:  [290.06 MiB/s 290.18 MiB/s 290.31 MiB/s]
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) low mild
streams/walltime/1-streams/each-1000-bytes
       time:   [157.85 µs 158.50 µs 159.33 µs]
       thrpt:  [5.9856 MiB/s 6.0169 MiB/s 6.0417 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
streams/walltime/1000-streams/each-1-bytes
       time:   [4.4829 ms 4.4886 ms 4.4942 ms]
       thrpt:  [217.29 KiB/s 217.56 KiB/s 217.84 KiB/s]
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) low mild
streams/walltime/1000-streams/each-1000-bytes
       time:   [14.753 ms 14.767 ms 14.781 ms]
       thrpt:  [64.522 MiB/s 64.582 MiB/s 64.641 MiB/s]
transfer/walltime/pacing-false/same-seed
       time:   [3.7589 ms 3.7606 ms 3.7627 ms]
       thrpt:  [1.0382 GiB/s 1.0387 GiB/s 1.0392 GiB/s]
transfer/walltime/pacing-false/varying-seeds
       time:   [3.8782 ms 3.8808 ms 3.8838 ms]
       thrpt:  [1.0058 GiB/s 1.0066 GiB/s 1.0072 GiB/s]
transfer/walltime/pacing-true/same-seed
       time:   [4.1856 ms 4.1866 ms 4.1878 ms]
       thrpt:  [955.17 MiB/s 955.42 MiB/s 955.66 MiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
transfer/walltime/pacing-true/varying-seeds
       time:   [4.0675 ms 4.0731 ms 4.0802 ms]
       thrpt:  [980.34 MiB/s 982.05 MiB/s 983.39 MiB/s]

Instructions per cycle

Criterion reported no significant timing changes.

All benchmarks
Benchmark IPC before IPC after ΔIPC
transfer/walltime/pacing-false/varying-seeds 2.88 2.85 -1.2%
transfer/walltime/pacing-true/varying-seeds 2.85 2.88 +1.0%
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500 3.20 3.18 -0.9%
transfer/walltime/pacing-false/same-seed 2.86 2.84 -0.7%
streams-flow-controlled/walltime/1-streams/each-4194304-bytes 2.98 3.00 +0.7%
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500 3.19 3.17 -0.6%
streams-flow-controlled/walltime/10-streams/each-1048576-bytes 3.14 3.16 +0.6%
transfer/walltime/pacing-true/same-seed 2.88 2.89 +0.3%
streams/walltime/1-streams/each-1000-bytes 2.58 2.58 +0.3%
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500 2.21 2.22 +0.2%
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500 3.23 3.22 -0.2%
streams/walltime/1000-streams/each-1000-bytes 2.97 2.97 -0.1%
streams/walltime/1000-streams/each-1-bytes 3.26 3.26 +0.0%
Profiles for profiler.firefox.com (64)

Download data for profiler.firefox.com or download performance comparison data.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client-side Issue relates more to clients extended-connect WebTransport, CONNECT, connect-udp, HTTP datagrams p3 Backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants