Repository navigation
fix: reject qpack dynamic reference at or above required insert count - #3807
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3807 +/- ##
=======================================
Coverage 96.77% 96.78%
=======================================
Files 120 120
Lines 40854 40910 +56
Branches 40854 40910 +56
=======================================
+ Hits 39538 39595 +57
+ Misses 1291 1290 -1
Partials 25 25
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Signed-off-by: Martin Thomson <mt@lowentropy.net>
|
Let's hold this one. We might just rip server push out entirely. |
|
Sure. One note for when you come back to it: the check isn't push-specific. It sits in decode_header_block, which the client runs on every header block it decodes, so plain response headers on request streams hit the same path. Push promises were just the second caller, so this stays relevant if push goes away with #3816. |
|
Oops, I meant to add that comment to a different PR. Ignore that. I'll merge this when CI finishes. |
Benchmark resultsNo significant performance differences relative to 76673b1. All resultsstreams/walltime/1-streams/each-1000-bytes: No change in performance detected. time: [548.48 µs 550.63 µs 553.09 µs]
thrpt: [1.7243 MiB/s 1.7320 MiB/s 1.7388 MiB/s]
change:
time: [-0.6935% -0.0954% +0.5395] (p = 0.76 > 0.05)
thrpt: [-0.5366% +0.0955% +0.6984]
No change in performance detected.
Found 14 outliers among 100 measurements (14.00%)
4 (4.00%) high mild
10 (10.00%) high severestreams/walltime/1000-streams/each-1-bytes: Change within noise threshold. time: [10.974 ms 10.989 ms 11.005 ms]
thrpt: [88.738 KiB/s 88.863 KiB/s 88.988 KiB/s]
change:
time: [-1.9123% -1.7307% -1.5390] (p = 0.00 < 0.05)
thrpt: [+1.5631% +1.7611% +1.9496]
Change within noise threshold.streams/walltime/1000-streams/each-1000-bytes: No change in performance detected. time: [31.556 ms 31.593 ms 31.631 ms]
thrpt: [30.150 MiB/s 30.186 MiB/s 30.222 MiB/s]
change:
time: [-0.6463% -0.2775% +0.0055] (p = 0.09 > 0.05)
thrpt: [-0.0055% +0.2783% +0.6506]
No change in performance detected.streams-flow-controlled/walltime/1-streams/each-4194304-bytes: Change within noise threshold. time: [27.063 ms 27.104 ms 27.147 ms]
thrpt: [147.34 MiB/s 147.58 MiB/s 147.80 MiB/s]
change:
time: [+1.0665% +1.3448% +1.6085] (p = 0.00 < 0.05)
thrpt: [-1.5830% -1.3270% -1.0552]
Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mildstreams-flow-controlled/walltime/10-streams/each-1048576-bytes: Change within noise threshold. time: [71.369 ms 71.797 ms 72.237 ms]
thrpt: [138.43 MiB/s 139.28 MiB/s 140.12 MiB/s]
change:
time: [+0.4544% +1.3095% +2.1605] (p = 0.00 < 0.05)
thrpt: [-2.1148% -1.2926% -0.4523]
Change within noise threshold.transfer/walltime/pacing-false/varying-seeds: No change in performance detected. time: [18.496 ms 18.508 ms 18.519 ms]
thrpt: [215.99 MiB/s 216.13 MiB/s 216.26 MiB/s]
change:
time: [-0.0905% -0.0092% +0.0707] (p = 0.82 > 0.05)
thrpt: [-0.0706% +0.0092% +0.0906]
No change in performance detected.
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) low mild
3 (3.00%) high mildtransfer/walltime/pacing-true/varying-seeds: Change within noise threshold. time: [18.633 ms 18.644 ms 18.655 ms]
thrpt: [214.42 MiB/s 214.55 MiB/s 214.67 MiB/s]
change:
time: [-1.3242% -1.2451% -1.1648] (p = 0.00 < 0.05)
thrpt: [+1.1785% +1.2608% +1.3420]
Change within noise threshold.
Found 7 outliers among 100 measurements (7.00%)
5 (5.00%) low mild
2 (2.00%) high mildtransfer/walltime/pacing-false/same-seed: Change within noise threshold. time: [18.508 ms 18.518 ms 18.530 ms]
thrpt: [215.87 MiB/s 216.00 MiB/s 216.13 MiB/s]
change:
time: [+1.0022% +1.1930% +1.3281] (p = 0.00 < 0.05)
thrpt: [-1.3107% -1.1789% -0.9922]
Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mildtransfer/walltime/pacing-true/same-seed: Change within noise threshold. time: [18.756 ms 18.779 ms 18.815 ms]
thrpt: [212.60 MiB/s 213.00 MiB/s 213.26 MiB/s]
change:
time: [+0.6928% +0.8371% +1.0293] (p = 0.00 < 0.05)
thrpt: [-1.0188% -0.8301% -0.6880]
Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severeDownload data for |
Client/server transfer resultsPerformance differences relative to 76673b1. No significant performance differences. 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 |
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
|
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
decode_header_block validates each dynamic reference only through get_dynamic, which confirms the entry is still in the live table but never checks it against the block's own Required Insert Count. RFC 9204 Section 2.2.3 requires a reference whose absolute index is at or above the Required Insert Count to be a decoding error, because the encoder committed to exactly that many entries; the entry can still be present when later insertions arrive on the encoder stream.
Before: a client decoding a response or push header block accepts such a reference and returns headers whose value depends on insertions the block never declared.
After: the reference is rejected with Decompression (QPACK_DECOMPRESSION_FAILED), the same as every other malformed reference in the block. References within the count decode unchanged.
The check sits at the reference resolution in the decoder, wrapping the four dynamic reads, since that is the only layer holding both the resolved absolute index and req_insert_cnt. It also covers Section 2.2.1, since a Required Insert Count smaller than the block needs surfaces as a reference at or above it. The tradeoff is one more decode that fails closed against trusting an over-optimistic Required Insert Count.