Repository navigation
capsule: reject a capsule that can never be buffered - #22998
Closed
MegaManSec wants to merge 1 commit into
Closed
MegaManSec wants to merge 1 commit into
MegaManSec wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new full-queue rejection path needs regression coverage.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Prevents capsule decoding from retrying indefinitely when an advertised payload cannot fit the receive queue.
Changes:
- Rejects incomplete capsules once the receive queue is full.
- Prevents
offset + payload_lenoverflow.
File summaries
| File | Description |
|---|---|
| lib/vquic/capsule.c | Adds size and full-buffer validation for capsule payloads. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The decoder waited for the full advertised payload before checking that it fits anywhere, so a peer advertising a length the receive queue can never hold made cf_capsule_recv() return CURLE_AGAIN forever. Check the destination buffer first and fail when the receive queue is full and still short of the capsule. Also bound the length so that offset + payload_len cannot wrap. Add a unit3400 case for the full-queue rejection.
MegaManSec
force-pushed
the
capsule-reject-oversized
branch
from
September 18, 2026 21:39
9358638 to
4bc4748
Compare
icing
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Curl_capsule_process_udp_raw()checked whether the full advertised payloadwas buffered before checking whether it fits anywhere.
cf_capsule_recv()stops filling at
Curl_bufq_is_full()(4 x 16 KiB), so a peer advertising alength the queue can never hold leaves the decoder returning
CURLE_AGAINindefinitely while consuming nothing.
cf_capsule_data_pending()keepsreporting data, since the queue is non-empty.
Reordering alone is not enough:
QUIC_TUNNEL_INBUF_SIZEis also 64 KiB, so alength just under it passes the destination-buffer check and still cannot be
buffered. Fail when the queue is full and still short of the capsule.
Also bound the length against
SIZE_MAX - offsetsooffset + payload_lencannot wrap on 32-bit.
HTTP/3 proxy support is experimental and off by default, so this is a plain
bug, not a security issue.