Repository navigation
fix: discard server Initial packets that carry a token - #3814
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3814 +/- ##
=======================================
Coverage 96.77% 96.78%
=======================================
Files 120 120
Lines 40854 40887 +33
Branches 40854 40887 +33
=======================================
+ Hits 39538 39573 +35
+ Misses 1291 1289 -2
Partials 25 25
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 9.32%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | simulated/10-streams/each-1048576-bytes |
9.7 MB | 12.4 MB | -21.83% |
| ❌ | Simulation | simulated/10-streams/each-1048576-bytes |
230.1 ms | 247.3 ms | -6.96% |
| ❌ | Simulation | coalesce_acked_from_zero 1 ranges |
1.4 µs | 1.4 µs | -4.03% |
| ❌ | Simulation | coalesce_acked_from_zero 3 ranges |
1.8 µs | 1.9 µs | -3.14% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing uwezkhan:client-initial-token (de2f9b1) with main (76673b1)
Benchmark resultsNo significant performance differences relative to 7f7750d. All resultsstreams/walltime/1-streams/each-1000-bytes: Change within noise threshold. time: [543.90 µs 545.88 µs 548.18 µs]
thrpt: [1.7397 MiB/s 1.7471 MiB/s 1.7534 MiB/s]
change:
time: [-1.0956% -0.5959% -0.0694] (p = 0.02 < 0.05)
thrpt: [+0.0694% +0.5994% +1.1077]
Change within noise threshold.
Found 11 outliers among 100 measurements (11.00%)
1 (1.00%) high mild
10 (10.00%) high severestreams/walltime/1000-streams/each-1-bytes: Change within noise threshold. time: [11.143 ms 11.159 ms 11.176 ms]
thrpt: [87.384 KiB/s 87.515 KiB/s 87.643 KiB/s]
change:
time: [+1.5414% +1.7608% +1.9872] (p = 0.00 < 0.05)
thrpt: [-1.9485% -1.7303% -1.5180]
Change within noise threshold.streams/walltime/1000-streams/each-1000-bytes: Change within noise threshold. time: [32.040 ms 32.083 ms 32.127 ms]
thrpt: [29.684 MiB/s 29.725 MiB/s 29.765 MiB/s]
change:
time: [+2.0454% +2.2589% +2.4591] (p = 0.00 < 0.05)
thrpt: [-2.4001% -2.2090% -2.0044]
Change within noise threshold.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mildstreams-flow-controlled/walltime/1-streams/each-4194304-bytes: Change within noise threshold. time: [27.312 ms 27.357 ms 27.403 ms]
thrpt: [145.97 MiB/s 146.21 MiB/s 146.46 MiB/s]
change:
time: [+2.0654% +2.2913% +2.5099] (p = 0.00 < 0.05)
thrpt: [-2.4485% -2.2400% -2.0236]
Change within noise threshold.streams-flow-controlled/walltime/10-streams/each-1048576-bytes: Change within noise threshold. time: [71.632 ms 72.021 ms 72.427 ms]
thrpt: [138.07 MiB/s 138.85 MiB/s 139.60 MiB/s]
change:
time: [+0.7550% +1.5840% +2.4128] (p = 0.00 < 0.05)
thrpt: [-2.3559% -1.5593% -0.7493]
Change within noise threshold.
Found 10 outliers among 100 measurements (10.00%)
1 (1.00%) low mild
9 (9.00%) high mildtransfer/walltime/pacing-false/varying-seeds: Change within noise threshold. time: [18.424 ms 18.434 ms 18.445 ms]
thrpt: [216.87 MiB/s 216.99 MiB/s 217.11 MiB/s]
change:
time: [+1.6094% +1.6841% +1.7611] (p = 0.00 < 0.05)
thrpt: [-1.7306% -1.6562% -1.5839]
Change within noise threshold.transfer/walltime/pacing-true/varying-seeds: Change within noise threshold. time: [18.740 ms 18.753 ms 18.766 ms]
thrpt: [213.16 MiB/s 213.30 MiB/s 213.45 MiB/s]
change:
time: [+0.4840% +0.5722% +0.6632] (p = 0.00 < 0.05)
thrpt: [-0.6589% -0.5689% -0.4817]
Change within noise threshold.
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) low mild
2 (2.00%) high mildtransfer/walltime/pacing-false/same-seed: Change within noise threshold. time: [18.506 ms 18.518 ms 18.530 ms]
thrpt: [215.87 MiB/s 216.00 MiB/s 216.14 MiB/s]
change:
time: [+0.8118% +0.9003% +0.9810] (p = 0.00 < 0.05)
thrpt: [-0.9715% -0.8923% -0.8053]
Change within noise threshold.transfer/walltime/pacing-true/same-seed: Change within noise threshold. time: [18.679 ms 18.691 ms 18.703 ms]
thrpt: [213.87 MiB/s 214.01 MiB/s 214.15 MiB/s]
change:
time: [+0.0826% +0.1684% +0.2600] (p = 0.00 < 0.05)
thrpt: [-0.2593% -0.1681% -0.0825]
Change within noise threshold.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) low mildDownload data for |
Failed Interop TestsQUIC Interop Runner, client vs. server, differences relative to
All resultsSucceeded Interop TestsQUIC Interop Runner, client vs. server neqo-pr as client
neqo-pr as server
Unsupported Interop TestsQUIC Interop Runner, client vs. server neqo-pr as client
neqo-pr as server
|
Client/server transfer resultsPerformance differences relative to 10c9e0c. Transfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.
Table above only shows statistically significant changes. See all results below. All resultsTransfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.
Download data for |
User-visible changes since v0.30.1: - Update nss-rs to 0.14.4, now requiring NSS >= 3.126: mozilla#3874 - WebTransport getStats() support: mozilla#3835 - Reliable reset handling for HTTP/3: mozilla#3777 - Optionally close a connection after N consecutive PTOs: mozilla#3662 - Reject 0-RTT downgrade of h3 datagram and WebTransport settings: mozilla#3852 - Reject connection-specific header fields in HTTP/3 messages: mozilla#3806 - Reject qpack dynamic reference at or above required insert count: mozilla#3807 - Discard server Initial packets that carry a token: mozilla#3814
User-visible changes since v0.30.1: - Update nss-rs to 0.14.4, now requiring NSS >= 3.126: mozilla#3874 - WebTransport getStats() support: mozilla#3835 - Reliable reset handling for HTTP/3: mozilla#3777 - Optionally close a connection after N consecutive PTOs: mozilla#3662 - Reject 0-RTT downgrade of h3 datagram and WebTransport settings: mozilla#3852 - Reject connection-specific header fields in HTTP/3 messages: mozilla#3806 - Reject qpack dynamic reference at or above required insert count: mozilla#3807 - Discard server Initial packets that carry a token: mozilla#3814
preprocess_packet validates a received Initial's Token Length only in the server arm, through is_valid_initial. A client-received Initial matches none of those arms, so the token that decode_long already parsed is ignored and the packet goes on to be decrypted and processed. RFC 9000, Section 17.2.2 says a server MUST set the Token Length of an Initial to 0, and a client that receives an Initial with a non-zero Token Length MUST discard it or close with PROTOCOL_VIOLATION. A server, or an off-path injector that derived the public Initial keys, can hand the client an Initial that carries a token and neqo accepts it.
Before: the client silently accepted the illegal token. After: preprocess_packet drops the packet as soon as a client sees an Initial with a non-empty token, beside the existing client Initial/Handshake path check so coalesced and replayed packets are covered too. Discarding is the safer of the two behaviors the RFC permits here, because the token length sits outside packet protection and closing on it would let an off-path packet end the connection; the tradeoff is that a genuinely misbehaving server gets no error signal back.