Repository navigation
DNS outbound: Keep hijacked A/AAAA replies within the buffer - #7225
Merged
Merged
Conversation
handleIPQuery builds the reply into an 8 KB buffer. A lookup with more addresses than fit made the builder grow into a new slice, and the following Resize panicked, which stops the process. Keep at most 256 answers, which fit even with the longest name. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Meo597
requested changes
Oct 22, 2026
Meo597
left a comment
Collaborator
There was a problem hiding this comment.
Although no such panic reports have been received and I am skeptical about whether the trigger path exists in the real world, truncating the slice is fine.
Remove limit on the number of AAAA answers and add check for message size.
|
claude..., claude everywhere... |
black-raison-detre
added a commit
to black-raison-detre/Xray-core
that referenced
this pull request
Nov 7, 2026
Backport upstream XTLS#7225, XTLS#7327, XTLS#7236, and XTLS#7291 onto the v26.7.11 maintenance branch with focused regression coverage. Co-authored-by: Codex <[email protected]>
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.
handleIPQuerybuilds the A/AAAA reply into an 8 KB buffer but doesn't limit the answer count. When a lookup returns more addresses than fit (about 495 A or 282 AAAA), the builder grows into a new slice andb.Resizepanics, which stops the process. UDP, TCP and QUIC name servers can't return that much; DoH andlocalhostcan.Fix: keep at most 256 answers. The worst case (AAAA, longest name) is 7439 bytes.
Test:
TestHandleIPQueryManyIPsfails on main withslice bounds out of range [:16271] with capacity 8192.