You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While buffer.go uses int32 type size not uint32 type, malformed dns response causes ReadFullFrom with negative size which leading to slice bounds out of range panic.
Here is the panic log (my dns server has additional fields): 2025/10/15 17:05:11.712529[Error] app/dns: failed to read response length > io: read/write on closed pipe panic: runtime error: slice bounds out of range [:-21477] goroutine 9214 [running]: github.com/xtls/xray-core/common/buf. (*Buffer).ReadFullFrom(Ox5af0a27200?, [Ox6f45a34200?,0x4000baad20?],0xf14d26c0?) github.com/xtls/xray-core/common/buf/ buffer.go:340 +0x23c github com/xtls/xray-core/app) dns.(*TCPNameServ er).sendQuery. func1(0x4000baac30) github. com/xtls/xray-core/ app/dns/ nameserver_tcp.go:184 +0x9c4 created by github.com/xtls/xray- core/app/dns. (*TCPNameServer) sendQuery in gor outine 9213 github.com/xtls/xray- core/app/dns/ nameserver. tcp.go:115 +0x274
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
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.
While buffer.go uses int32 type size not uint32 type, malformed dns response causes ReadFullFrom with negative size which leading to slice bounds out of range panic.
Here is the panic log (my dns server has additional fields):
2025/10/15 17:05:11.712529[Error] app/dns: failed to read response length > io: read/write on closed pipe panic: runtime error: slice bounds out of range [:-21477] goroutine 9214 [running]: github.com/xtls/xray-core/common/buf. (*Buffer).ReadFullFrom(Ox5af0a27200?, [Ox6f45a34200?,0x4000baad20?],0xf14d26c0?) github.com/xtls/xray-core/common/buf/ buffer.go:340 +0x23c github com/xtls/xray-core/app) dns.(*TCPNameServ er).sendQuery. func1(0x4000baac30) github. com/xtls/xray-core/ app/dns/ nameserver_tcp.go:184 +0x9c4 created by github.com/xtls/xray- core/app/dns. (*TCPNameServer) sendQuery in gor outine 9213 github.com/xtls/xray- core/app/dns/ nameserver. tcp.go:115 +0x274