Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package v2ray-core for openSUSE:Factory checked in at 2021-12-27 16:07:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/v2ray-core (Old) and /work/SRC/openSUSE:Factory/.v2ray-core.new.2520 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "v2ray-core" Mon Dec 27 16:07:27 2021 rev:18 rq:942765 version:4.44.0 Changes: -------- --- /work/SRC/openSUSE:Factory/v2ray-core/v2ray-core.changes 2021-12-02 02:28:02.244030493 +0100 +++ /work/SRC/openSUSE:Factory/.v2ray-core.new.2520/v2ray-core.changes 2021-12-27 16:07:38.561710912 +0100 @@ -1,0 +2,7 @@ +Sat Dec 25 14:01:53 UTC 2021 - opensuse-packaging <opensuse-packag...@opensuse.org> + +- Update version to 4.44.0 + * Fix DoS attack vulnerability in CommandSwitchAccountFactory. (@geeknik) + * Apply timeout to DNS outbound. (#1330 @nekohasekai) + +------------------------------------------------------------------- Old: ---- v2ray-core-4.43.0.tar.gz New: ---- v2ray-core-4.44.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ v2ray-core.spec ++++++ --- /var/tmp/diff_new_pack.rzzfEy/_old 2021-12-27 16:07:39.433711531 +0100 +++ /var/tmp/diff_new_pack.rzzfEy/_new 2021-12-27 16:07:39.437711534 +0100 @@ -25,7 +25,7 @@ %define import_path github.com/v2fly/v2ray-core/v4 Name: v2ray-core -Version: 4.43.0 +Version: 4.44.0 Release: 0 Summary: Network tools for building a computer network License: MIT ++++++ dlc.dat ++++++ ++++ 2762 lines (skipped) ++++ between dlc.dat ++++ and /work/SRC/openSUSE:Factory/.v2ray-core.new.2520/dlc.dat ++++++ geoip.dat ++++++ Binary files /var/tmp/diff_new_pack.rzzfEy/_old and /var/tmp/diff_new_pack.rzzfEy/_new differ ++++++ v2ray-core-4.43.0.tar.gz -> v2ray-core-4.44.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/v2ray-core-4.43.0/core.go new/v2ray-core-4.44.0/core.go --- old/v2ray-core-4.43.0/core.go 2021-10-02 18:07:52.000000000 +0200 +++ new/v2ray-core-4.44.0/core.go 2021-12-05 20:27:41.000000000 +0100 @@ -18,7 +18,7 @@ ) var ( - version = "4.43.0" + version = "4.44.0" build = "Custom" codename = "V2Fly, a community-driven edition of V2Ray." intro = "A unified platform for anti-censorship." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/v2ray-core-4.43.0/infra/conf/dns_proxy.go new/v2ray-core-4.44.0/infra/conf/dns_proxy.go --- old/v2ray-core-4.43.0/infra/conf/dns_proxy.go 2021-10-02 18:07:52.000000000 +0200 +++ new/v2ray-core-4.44.0/infra/conf/dns_proxy.go 2021-12-05 20:27:41.000000000 +0100 @@ -9,9 +9,10 @@ ) type DNSOutboundConfig struct { - Network cfgcommon.Network `json:"network"` - Address *cfgcommon.Address `json:"address"` - Port uint16 `json:"port"` + Network cfgcommon.Network `json:"network"` + Address *cfgcommon.Address `json:"address"` + Port uint16 `json:"port"` + UserLevel uint32 `json:"userLevel"` } func (c *DNSOutboundConfig) Build() (proto.Message, error) { @@ -20,6 +21,7 @@ Network: c.Network.Build(), Port: uint32(c.Port), }, + UserLevel: c.UserLevel, } if c.Address != nil { config.Server.Address = c.Address.Build() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/v2ray-core-4.43.0/proxy/dns/config.pb.go new/v2ray-core-4.44.0/proxy/dns/config.pb.go --- old/v2ray-core-4.43.0/proxy/dns/config.pb.go 2021-10-02 18:07:52.000000000 +0200 +++ new/v2ray-core-4.44.0/proxy/dns/config.pb.go 2021-12-05 20:27:41.000000000 +0100 @@ -28,7 +28,8 @@ // Server is the DNS server address. If specified, this address overrides the // original one. - Server *net.Endpoint `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` + Server *net.Endpoint `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` + UserLevel uint32 `protobuf:"varint,2,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` } func (x *Config) Reset() { @@ -70,6 +71,13 @@ return nil } +func (x *Config) GetUserLevel() uint32 { + if x != nil { + return x.UserLevel + } + return 0 +} + var File_proxy_dns_config_proto protoreflect.FileDescriptor var file_proxy_dns_config_proto_rawDesc = []byte{ @@ -77,18 +85,20 @@ 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x1a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x41, 0x0a, 0x06, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x45, - 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, - 0x5d, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x28, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, - 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2f, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x14, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, - 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x44, 0x6e, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, + 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x5d, + 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2f, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x14, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, + 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x44, 0x6e, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/v2ray-core-4.43.0/proxy/dns/config.proto new/v2ray-core-4.44.0/proxy/dns/config.proto --- old/v2ray-core-4.43.0/proxy/dns/config.proto 2021-10-02 18:07:52.000000000 +0200 +++ new/v2ray-core-4.44.0/proxy/dns/config.proto 2021-12-05 20:27:41.000000000 +0100 @@ -12,4 +12,5 @@ // Server is the DNS server address. If specified, this address overrides the // original one. v2ray.core.common.net.Endpoint server = 1; + uint32 user_level = 2; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/v2ray-core-4.43.0/proxy/dns/dns.go new/v2ray-core-4.44.0/proxy/dns/dns.go --- old/v2ray-core-4.43.0/proxy/dns/dns.go 2021-10-02 18:07:52.000000000 +0200 +++ new/v2ray-core-4.44.0/proxy/dns/dns.go 2021-12-05 20:27:41.000000000 +0100 @@ -7,6 +7,7 @@ "context" "io" "sync" + "time" "golang.org/x/net/dns/dnsmessage" @@ -16,8 +17,10 @@ "github.com/v2fly/v2ray-core/v4/common/net" dns_proto "github.com/v2fly/v2ray-core/v4/common/protocol/dns" "github.com/v2fly/v2ray-core/v4/common/session" + "github.com/v2fly/v2ray-core/v4/common/signal" "github.com/v2fly/v2ray-core/v4/common/task" "github.com/v2fly/v2ray-core/v4/features/dns" + "github.com/v2fly/v2ray-core/v4/features/policy" "github.com/v2fly/v2ray-core/v4/transport" "github.com/v2fly/v2ray-core/v4/transport/internet" ) @@ -25,8 +28,8 @@ func init() { common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) { h := new(Handler) - if err := core.RequireFeatures(ctx, func(dnsClient dns.Client) error { - return h.Init(config.(*Config), dnsClient) + if err := core.RequireFeatures(ctx, func(dnsClient dns.Client, policyManager policy.Manager) error { + return h.Init(config.(*Config), dnsClient, policyManager) }); err != nil { return nil, err } @@ -44,10 +47,12 @@ ipv6Lookup dns.IPv6Lookup ownLinkVerifier ownLinkVerifier server net.Destination + timeout time.Duration } -func (h *Handler) Init(config *Config, dnsClient dns.Client) error { +func (h *Handler) Init(config *Config, dnsClient dns.Client, policyManager policy.Manager) error { h.client = dnsClient + h.timeout = policyManager.ForLevel(config.UserLevel).Timeouts.ConnectionIdle if ipv4lookup, ok := dnsClient.(dns.IPv4Lookup); ok { h.ipv4Lookup = ipv4lookup @@ -160,6 +165,9 @@ } } + ctx, cancel := context.WithCancel(ctx) + timer := signal.CancelAfterInactivity(ctx, cancel, h.timeout) + request := func() error { defer conn.Close() @@ -173,6 +181,8 @@ return err } + timer.Update() + if !h.isOwnLink(ctx) { isIPQuery, domain, id, qType := parseIPQuery(b.Bytes()) if isIPQuery { @@ -198,6 +208,8 @@ return err } + timer.Update() + if err := writer.WriteMessage(b); err != nil { return err } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/v2ray-core-4.43.0/proxy/vmess/encoding/commands.go new/v2ray-core-4.44.0/proxy/vmess/encoding/commands.go --- old/v2ray-core-4.43.0/proxy/vmess/encoding/commands.go 2021-10-02 18:07:52.000000000 +0200 +++ new/v2ray-core-4.44.0/proxy/vmess/encoding/commands.go 2021-12-05 20:27:41.000000000 +0100 @@ -139,7 +139,7 @@ } cmd.Level = uint32(data[levelStart]) timeStart := levelStart + 1 - if len(data) < timeStart { + if len(data) < timeStart+1 { return nil, newError("insufficient length.") } cmd.ValidMin = data[timeStart] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/v2ray-core-4.43.0/proxy/vmess/encoding/commands_test.go new/v2ray-core-4.44.0/proxy/vmess/encoding/commands_test.go --- old/v2ray-core-4.43.0/proxy/vmess/encoding/commands_test.go 2021-10-02 18:07:52.000000000 +0200 +++ new/v2ray-core-4.44.0/proxy/vmess/encoding/commands_test.go 2021-12-05 20:27:41.000000000 +0100 @@ -1,6 +1,7 @@ package encoding_test import ( + "github.com/stretchr/testify/assert" "testing" "github.com/google/go-cmp/cmp" @@ -35,3 +36,23 @@ t.Error(r) } } + +func TestSwitchAccountBugOffByOne(t *testing.T) { + sa := &protocol.CommandSwitchAccount{ + Port: 1234, + ID: uuid.New(), + AlterIds: 1024, + Level: 128, + ValidMin: 16, + } + + buffer := buf.New() + csaf := CommandSwitchAccountFactory{} + common.Must(csaf.Marshal(sa, buffer)) + + Payload := buffer.Bytes() + + cmd, err := csaf.Unmarshal(Payload[:len(Payload)-1]) + assert.Error(t, err) + assert.Nil(t, cmd) +} ++++++ v2ray-extra.zip ++++++ Binary files /var/tmp/diff_new_pack.rzzfEy/_old and /var/tmp/diff_new_pack.rzzfEy/_new differ ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/v2ray-core/vendor.tar.gz /work/SRC/openSUSE:Factory/.v2ray-core.new.2520/vendor.tar.gz differ: char 1, line 1