From dcb35293700d64227ae756b02e29d364a58e67ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Oct 2026 03:52:47 +0000 Subject: [PATCH] Bump codeberg.org/miekg/dns from 0.6.117 to 0.6.118 Bumps codeberg.org/miekg/dns from 0.6.117 to 0.6.118. --- updated-dependencies: - dependency-name: codeberg.org/miekg/dns dependency-version: 0.6.118 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 +- go.sum | 4 +- vendor/codeberg.org/miekg/dns/README.md | 1 + .../miekg/dns/internal/unpack/unpack.go | 45 +++++++++++-------- vendor/codeberg.org/miekg/dns/version.go | 2 +- vendor/modules.txt | 2 +- 6 files changed, 34 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 3ae5901862..647359939e 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/dnscrypt/dnscrypt-proxy -go 1.27 +go 1.27.0 require ( - codeberg.org/miekg/dns v0.6.117 + codeberg.org/miekg/dns v0.6.118 github.com/BurntSushi/toml v1.6.0 github.com/VividCortex/ewma v1.2.0 github.com/cloudflare/circl v1.6.5 diff --git a/go.sum b/go.sum index 4a635bbab6..0dedaaaa65 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -codeberg.org/miekg/dns v0.6.117 h1:1y9FOMy/6xdNIJhSKwdTUJGAtjuSTFaJiZCQ5C9905A= -codeberg.org/miekg/dns v0.6.117/go.mod h1:vbidSyLJl5JcDUL2LrXCUjRYSFa5tJweseQox0GOrTk= +codeberg.org/miekg/dns v0.6.118 h1:OGqwrxdJvXHeX7711q4YKYly+PG7C4AwP2v6jPqwJFU= +codeberg.org/miekg/dns v0.6.118/go.mod h1:vbidSyLJl5JcDUL2LrXCUjRYSFa5tJweseQox0GOrTk= github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= diff --git a/vendor/codeberg.org/miekg/dns/README.md b/vendor/codeberg.org/miekg/dns/README.md index a409f88862..83638d0a50 100644 --- a/vendor/codeberg.org/miekg/dns/README.md +++ b/vendor/codeberg.org/miekg/dns/README.md @@ -223,6 +223,7 @@ _all of them_ and _then some_ - 8777 - DNS Reverse IP Automatic Multicast Tunneling (AMT) Discovery - 8914 - Extended DNS Errors - 8976 - Message Digest for DNS Zones (ZONEMD RR) +- 9267 - Common Implementation Anti-Patterns - 9250 - DOQ (not implemented, waiting until Go supports QUIC) - 9461 - Service Binding Mapping for DNS Servers - 9462 - Discovery of Designated Resolvers diff --git a/vendor/codeberg.org/miekg/dns/internal/unpack/unpack.go b/vendor/codeberg.org/miekg/dns/internal/unpack/unpack.go index 5f5cfb834a..d10288997b 100644 --- a/vendor/codeberg.org/miekg/dns/internal/unpack/unpack.go +++ b/vendor/codeberg.org/miekg/dns/internal/unpack/unpack.go @@ -15,7 +15,8 @@ import ( const ( maxNameWireOctets = 255 // See RFC 1035 section 2.3.4 - + // This is the maximum number of compression pointers we follow, while unpacking a name. + maxCompressionPointers = (maxNameWireOctets+1)/2 - 2 // This is the maximum length of a domain name in presentation format. The // maximum wire length of a domain name is 255 octets (see above), with the // maximum label length being 63. The wire format requires one extra byte over @@ -107,7 +108,7 @@ func String(s *cryptobyte.String) (string, error) { // Name unpacks a name in a cryptobyte.String. func Name(s *cryptobyte.String, msgBuf []byte) (string, error) { name := make([]byte, 0, maxNamePresentationLength) - var ptrs bool + ptrs := uint8(0) // If we never see a pointer, we need to ensure that we advance s to our final position. cs := *s @@ -120,7 +121,7 @@ func Name(s *cryptobyte.String, msgBuf []byte) (string, error) { switch c & 0xC0 { case 0x00: // literal string if c == 0 { // If we see a zero-length label (root label), this is the end of the name. - if !ptrs { + if ptrs == 0 { *s = cs } if len(name) == 0 { @@ -129,13 +130,15 @@ func Name(s *cryptobyte.String, msgBuf []byte) (string, error) { return string(name), nil } - if len(name)+int(c) >= maxNamePresentationLength { + ln := len(name) + if ln+int(c) >= maxNamePresentationLength { return "", &Error{"name exceeded max wire-format octets"} } - ln := len(name) - name = name[:ln+int(c)+1] // extend slice - cs.CopyBytes(name[ln : ln+int(c)]) // copy label into correct place + name = name[:ln+int(c)+1] // extend slice + if !cs.CopyBytes(name[ln : ln+int(c)]) { // copy label into correct place + return "", &Error{"overflow name"} + } name[ln+int(c)] = '.' case 0xC0: // pointer @@ -147,7 +150,7 @@ func Name(s *cryptobyte.String, msgBuf []byte) (string, error) { return "", &Error{"overflow name"} } // If this is the first pointer we've seen, we need to advance s to our current position. - if !ptrs { + if ptrs == 0 { *s = cs } // The pointer should always point backwards to an earlier part of the message. Technically it could work pointing @@ -157,9 +160,11 @@ func Name(s *cryptobyte.String, msgBuf []byte) (string, error) { if int(off) >= Offset(cs, msgBuf)-2 { return "", &Error{"pointer not to prior occurrence of name"} } + if ptrs++; ptrs > maxCompressionPointers { + return "", &Error{"too many compression pointers"} + } // Jump to the offset in msgBuf. We carry msgBuf around with us solely for this line. cs = msgBuf[off:] - ptrs = true default: // 0x80 and 0x40 are reserved return "", &Error{"reserved domain name label type"} @@ -170,7 +175,7 @@ func Name(s *cryptobyte.String, msgBuf []byte) (string, error) { // MName unpacks a name in a cryptobyte.String, while also taking care of escaped dots (\.). func MName(s *cryptobyte.String, msgBuf []byte) (string, error) { name := make([]byte, 0, maxNamePresentationLength*2) // everything can be escaped... - var ptrs bool + ptrs := uint8(0) // If we never see a pointer, we need to ensure that we advance s to our final position. cs := *s @@ -183,7 +188,7 @@ func MName(s *cryptobyte.String, msgBuf []byte) (string, error) { switch c & 0xC0 { case 0x00: // literal string if c == 0 { // If we see a zero-length label (root label), this is the end of the name. - if !ptrs { + if ptrs == 0 { *s = cs } if len(name) == 0 { @@ -192,13 +197,15 @@ func MName(s *cryptobyte.String, msgBuf []byte) (string, error) { return string(name), nil } - if len(name)+int(c) >= maxNamePresentationLength { - return "", &Error{"name exceeded max wire-format octets: " + string(*s)} + ln := len(name) + if ln+int(c) >= maxNamePresentationLength { + return "", &Error{"name exceeded max wire-format octets"} } - ln := len(name) - name = name[:ln+int(c)+1] // extend slice - cs.CopyBytes(name[ln : ln+int(c)]) // copy label into correct place + name = name[:ln+int(c)+1] // extend slice + if !cs.CopyBytes(name[ln : ln+int(c)]) { // copy label into correct place + return "", &Error{"overflow name"} + } // if this names contains dots, it's embedded and should be escaped. dots := bytes.Count(name[ln:], []byte{'.'}) @@ -230,7 +237,7 @@ func MName(s *cryptobyte.String, msgBuf []byte) (string, error) { return "", &Error{"overflow name"} } // If this is the first pointer we've seen, we need to advance s to our current position. - if !ptrs { + if ptrs == 0 { *s = cs } // The pointer should always point backwards to an earlier part of the message. Technically it could work pointing @@ -240,9 +247,11 @@ func MName(s *cryptobyte.String, msgBuf []byte) (string, error) { if int(off) >= Offset(cs, msgBuf)-2 { return "", &Error{"pointer not to prior occurrence of name"} } + if ptrs++; ptrs > maxCompressionPointers { + return "", &Error{"too many compression pointers"} + } // Jump to the offset in msgBuf. We carry msgBuf around with us solely for this line. cs = msgBuf[off:] - ptrs = true default: // 0x80 and 0x40 are reserved return "", &Error{"reserved domain name label type"} diff --git a/vendor/codeberg.org/miekg/dns/version.go b/vendor/codeberg.org/miekg/dns/version.go index 32efe5f57e..7fd9da169d 100644 --- a/vendor/codeberg.org/miekg/dns/version.go +++ b/vendor/codeberg.org/miekg/dns/version.go @@ -3,7 +3,7 @@ package dns import "fmt" // Version is current version of this library. -var Version = v{0, 6, 117} +var Version = v{0, 6, 118} type v struct { Major, Minor, Patch int diff --git a/vendor/modules.txt b/vendor/modules.txt index ad3582b1ed..1dfaedd5eb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# codeberg.org/miekg/dns v0.6.117 +# codeberg.org/miekg/dns v0.6.118 ## explicit; go 1.27.0 codeberg.org/miekg/dns codeberg.org/miekg/dns/deleg