Skip to content

Commit bd14562

Browse files
azurelinux-securityakhila-gurujujslobodzian
authored
[AutoPR- Security] Patch coredns for CVE-2026-26018, CVE-2026-26017 [HIGH] (#16160)
Co-authored-by: akhila-guruju <v-guakhila@microsoft.com> Co-authored-by: jslobodzian <joslobo@microsoft.com>
1 parent 6203c53 commit bd14562

3 files changed

Lines changed: 138 additions & 1 deletion

File tree

SPECS/coredns/CVE-2026-26017.patch

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
From e4b9a976441491881377947a200f414c7961e936 Mon Sep 17 00:00:00 2001
2+
From: younevsky <younevsky@gmail.com>
3+
Date: Wed, 25 Feb 2026 00:34:31 +0000
4+
Subject: [PATCH] plugin: reorder rewrite before acl to prevent bypass
5+
6+
Signed-off-by: younevsky <younevsky@gmail.com>
7+
8+
Upstream Patch reference: https://github.com/coredns/coredns/pull/7882.patch
9+
10+
Makefile target for the two z*.go files depends on plugin.cfg.
11+
So the change in plugin.cfg will trigger the rebuild of the two z*.go files.
12+
---
13+
plugin.cfg | 2 +-
14+
core/dnsserver/zdirectives.go | 2 +-
15+
core/plugin/zplugin.go | 2 +-
16+
3 files changed, 3 insertions(+), 3 deletions(-)
17+
18+
diff --git a/plugin.cfg b/plugin.cfg
19+
index 081a57e..42b5414 100644
20+
--- a/plugin.cfg
21+
+++ b/plugin.cfg
22+
@@ -43,13 +43,13 @@ log:log
23+
dnstap:dnstap
24+
local:local
25+
dns64:dns64
26+
-acl:acl
27+
any:any
28+
chaos:chaos
29+
loadbalance:loadbalance
30+
tsig:tsig
31+
cache:cache
32+
rewrite:rewrite
33+
+acl:acl
34+
header:header
35+
dnssec:dnssec
36+
autopath:autopath
37+
diff --git a/core/dnsserver/zdirectives.go b/core/dnsserver/zdirectives.go
38+
index bc4b086..66e2aec 100644
39+
--- a/core/dnsserver/zdirectives.go
40+
+++ b/core/dnsserver/zdirectives.go
41+
@@ -34,13 +34,13 @@ var Directives = []string{
42+
"dnstap",
43+
"local",
44+
"dns64",
45+
- "acl",
46+
"any",
47+
"chaos",
48+
"loadbalance",
49+
"tsig",
50+
"cache",
51+
"rewrite",
52+
+ "acl",
53+
"header",
54+
"dnssec",
55+
"autopath",
56+
diff --git a/core/plugin/zplugin.go b/core/plugin/zplugin.go
57+
index a357ddc..aa9d009 100644
58+
--- a/core/plugin/zplugin.go
59+
+++ b/core/plugin/zplugin.go
60+
@@ -3,7 +3,7 @@
61+
package plugin
62+
63+
import (
64+
- // Include all plugins.
65+
+ // Include all the plugins.
66+
_ "github.com/coredns/caddy/onevent"
67+
_ "github.com/coredns/coredns/plugin/acl"
68+
_ "github.com/coredns/coredns/plugin/any"
69+
--
70+
2.43.0
71+

SPECS/coredns/CVE-2026-26018.patch

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
From 02391769e4f3eff1d5bace4c82505c213b495625 Mon Sep 17 00:00:00 2001
2+
From: YOUNEVSKY <77975903+younevsky@users.noreply.github.com>
3+
Date: Wed, 25 Feb 2026 10:21:04 +0000
4+
Subject: [PATCH] plugin/loop: use crypto/rand for query name generation
5+
(#7881)
6+
7+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
8+
Upstream-reference: https://github.com/coredns/coredns/commit/7ae1c40db200a29d8160707bcffb232c53a2005c.patch
9+
---
10+
plugin/loop/setup.go | 19 ++++++++++++++-----
11+
1 file changed, 14 insertions(+), 5 deletions(-)
12+
13+
diff --git a/plugin/loop/setup.go b/plugin/loop/setup.go
14+
index 4e076c6..5d9d5b5 100644
15+
--- a/plugin/loop/setup.go
16+
+++ b/plugin/loop/setup.go
17+
@@ -1,6 +1,8 @@
18+
package loop
19+
20+
import (
21+
+ "crypto/rand"
22+
+ "math/big"
23+
"net"
24+
"strconv"
25+
"time"
26+
@@ -9,7 +11,6 @@ import (
27+
"github.com/coredns/coredns/core/dnsserver"
28+
"github.com/coredns/coredns/plugin"
29+
"github.com/coredns/coredns/plugin/pkg/dnsutil"
30+
- "github.com/coredns/coredns/plugin/pkg/rand"
31+
)
32+
33+
func init() { plugin.Register("loop", setup) }
34+
@@ -76,12 +77,20 @@ func parse(c *caddy.Controller) (*Loop, error) {
35+
return New(zones[0]), nil
36+
}
37+
38+
-// qname returns a random name. <rand.Int()>.<rand.Int().<zone>.
39+
+// qname returns a secure random name: <random-int>.<random-int>.<zone>.
40+
func qname(zone string) string {
41+
- l1 := strconv.Itoa(r.Int())
42+
- l2 := strconv.Itoa(r.Int())
43+
+ l1 := secureRandIntString()
44+
+ l2 := secureRandIntString()
45+
46+
return dnsutil.Join(l1, l2, zone)
47+
}
48+
49+
-var r = rand.New(time.Now().UnixNano())
50+
+func secureRandIntString() string {
51+
+ // Generate a random 62-bit integer
52+
+ n, err := rand.Int(rand.Reader, big.NewInt(1<<62))
53+
+ if err != nil {
54+
+ // Fallback to startup time in case rand.Reader is unavailable
55+
+ return strconv.FormatInt(time.Now().UnixNano(), 10)
56+
+ }
57+
+ return n.String()
58+
+}
59+
--
60+
2.45.4
61+

SPECS/coredns/coredns.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Fast and flexible DNS server
44
Name: coredns
55
Version: 1.11.1
6-
Release: 25%{?dist}
6+
Release: 26%{?dist}
77
License: Apache License 2.0
88
Vendor: Microsoft Corporation
99
Distribution: Mariner
@@ -49,6 +49,8 @@ Patch13: CVE-2025-47950.patch
4949
Patch14: CVE-2025-58063.patch
5050
Patch15: CVE-2025-59530.patch
5151
Patch16: CVE-2025-68151.patch
52+
Patch17: CVE-2026-26017.patch
53+
Patch18: CVE-2026-26018.patch
5254

5355
BuildRequires: msft-golang
5456

@@ -87,6 +89,9 @@ install -p -m 755 -t %{buildroot}%{_bindir} %{name}
8789
%{_bindir}/%{name}
8890

8991
%changelog
92+
* Wed Mar 11 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.11.1-26
93+
- Patch for CVE-2026-26018, CVE-2026-26017
94+
9095
* Mon Jan 19 2026 Aditya Singh <v-aditysing@microsoft.com> - 1.11.1-25
9196
- Patch for CVE-2025-68151
9297

0 commit comments

Comments
 (0)