Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions SPECS/docker-buildx/CVE-2026-25680.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
From a41d5f6f770016cd9c9a05d51a9b4a578e64e3ba Mon Sep 17 00:00:00 2001
From: Roland Shoemaker <roland@golang.org>
Date: Tue, 12 May 2026 15:36:39 -0400
Subject: [PATCH] html: improve Noah's Ark clause performance

Instead of iterating over each element in the stack, and checking each
attribute against each other attribute in a ~cubic fashion, sort the
attributes and just use slices.Equal.

Thanks to IPC Labs for reporting this issue.

Fixes CVE-2026-25680

Change-Id: Iec3513ba0b5da4f28f1359d24846401b9ab76ee3
Reviewed-on: https://go-review.googlesource.com/c/net/+/781702
TryBot-Bypass: Roland Shoemaker <roland@golang.org>
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Upstream-reference: https://github.com/golang/net/commit/08be507abce89191d78cd49da60f4501fc910472.patch
---
vendor/golang.org/x/net/html/parse.go | 34 ++++++++++++++++-----------
1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go
index 3392845..4bd5e6d 100644
--- a/vendor/golang.org/x/net/html/parse.go
+++ b/vendor/golang.org/x/net/html/parse.go
@@ -5,9 +5,11 @@
package html

import (
+ "cmp"
"errors"
"fmt"
"io"
+ "slices"
"strings"

a "golang.org/x/net/html/atom"
@@ -328,6 +330,14 @@ func (p *parser) addText(text string) {
})
}

+func attrCompare(a, b Attribute) int {
+ return cmp.Or(
+ cmp.Compare(a.Namespace, b.Namespace),
+ cmp.Compare(a.Key, b.Key),
+ cmp.Compare(a.Val, b.Val),
+ )
+}
+
// addElement adds a child element based on the current token.
func (p *parser) addElement() {
p.addChild(&Node{
@@ -343,6 +353,10 @@ func (p *parser) addFormattingElement() {
tagAtom, attr := p.tok.DataAtom, p.tok.Attr
p.addElement()

+ // In order to optimize the search, we need the attributes to be sorted, so we
+ // can just use slices.Equal.
+ slices.SortFunc(attr, attrCompare)
+
// Implement the Noah's Ark clause, but with three per family instead of two.
identicalElements := 0
findIdenticalElements:
@@ -360,19 +374,7 @@ findIdenticalElements:
if n.DataAtom != tagAtom {
continue
}
- if len(n.Attr) != len(attr) {
- continue
- }
- compareAttributes:
- for _, t0 := range n.Attr {
- for _, t1 := range attr {
- if t0.Key == t1.Key && t0.Namespace == t1.Namespace && t0.Val == t1.Val {
- // Found a match for this attribute, continue with the next attribute.
- continue compareAttributes
- }
- }
- // If we get here, there is no attribute that matches a.
- // Therefore the element is not identical to the new one.
+ if !slices.Equal(n.Attr, attr) {
continue findIdenticalElements
}

@@ -382,7 +384,11 @@ findIdenticalElements:
}
}

- p.afe = append(p.afe, p.top())
+ // Sort the attributes to optimize future identical-element searches.
+ top := p.top()
+ slices.SortFunc(top.Attr, attrCompare)
+
+ p.afe = append(p.afe, top)
}

// Section 12.2.4.3.
--
2.45.4

113 changes: 113 additions & 0 deletions SPECS/docker-buildx/CVE-2026-25681.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
From ad069ba0be8708962939d544ac5a30609ec70e1b Mon Sep 17 00:00:00 2001
From: Roland Shoemaker <roland@golang.org>
Date: Mon, 4 May 2026 11:47:15 -0700
Subject: [PATCH] html: escape greater-than symbol in doctype identifiers

During parsing, we unescape character references. When rendering, we
re-escape certain characters in certain scenarios in order to avoid
token content causing unexpected parser behavior.

We appear to have not taken this into account when rendering DOCTYPE
tokens, allowing ">" in PUBLIC/SYSTEM identifier strings, which trigger
a abrupt-doctype-system-identifier parse error which immediately emits
the current DOCTYPE token and then continues parsing in the data state.

This may cause bypass in HTML santizers which use the html package for
parsing.

Thanks to ensy for reporting this issue.

Fixes CVE-2026-25681

Change-Id: I1d5be92129d17bfbf0917148db2672d57c224a18
Reviewed-on: https://go-review.googlesource.com/c/net/+/781703
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
TryBot-Bypass: Roland Shoemaker <roland@golang.org>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Upstream-reference: https://github.com/golang/net/commit/4ece7b612ad44ad6c4d5e0d5d4df9c18cc211905.patch
---
vendor/golang.org/x/net/html/render.go | 19 +++++++++++++------
.../html/testdata/go/doctype_named_entity.dat | 8 ++++++++
2 files changed, 21 insertions(+), 6 deletions(-)
create mode 100644 vendor/golang.org/x/net/html/testdata/go/doctype_named_entity.dat

diff --git a/vendor/golang.org/x/net/html/render.go b/vendor/golang.org/x/net/html/render.go
index e8c1233..f3740cc 100644
--- a/vendor/golang.org/x/net/html/render.go
+++ b/vendor/golang.org/x/net/html/render.go
@@ -113,14 +113,14 @@ func render1(w writer, n *Node) error {
if _, err := w.WriteString(" PUBLIC "); err != nil {
return err
}
- if err := writeQuoted(w, p); err != nil {
+ if err := writeDoctypeQuoted(w, p); err != nil {
return err
}
if s != "" {
if err := w.WriteByte(' '); err != nil {
return err
}
- if err := writeQuoted(w, s); err != nil {
+ if err := writeDoctypeQuoted(w, s); err != nil {
return err
}
}
@@ -128,7 +128,7 @@ func render1(w writer, n *Node) error {
if _, err := w.WriteString(" SYSTEM "); err != nil {
return err
}
- if err := writeQuoted(w, s); err != nil {
+ if err := writeDoctypeQuoted(w, s); err != nil {
return err
}
}
@@ -251,19 +251,26 @@ func childTextNodesAreLiteral(n *Node) bool {
}
}

-// writeQuoted writes s to w surrounded by quotes. Normally it will use double
+// writeDoctypeQuoted writes s to w surrounded by quotes. Normally it will use double
// quotes, but if s contains a double quote, it will use single quotes.
+// If s contains any '>' characters, they are replaced with &gt; in order
+// to prevent triggering an abrupt-doctype-system-identifier parse error.
// It is used for writing the identifiers in a doctype declaration.
// In valid HTML, they can't contain both types of quotes.
-func writeQuoted(w writer, s string) error {
+func writeDoctypeQuoted(w writer, s string) error {
var q byte = '"'
if strings.Contains(s, `"`) {
+ // parseDoctype will never produce a Node with both quote types, but a user
+ // can construct their own Node that violates this assumption.
+ if strings.Contains(s, `'`) {
+ return errors.New("doctype contains both quote types, cannot be safely rendered")
+ }
q = '\''
}
if err := w.WriteByte(q); err != nil {
return err
}
- if _, err := w.WriteString(s); err != nil {
+ if _, err := w.WriteString(strings.ReplaceAll(s, ">", "&gt;")); err != nil {
return err
}
if err := w.WriteByte(q); err != nil {
diff --git a/vendor/golang.org/x/net/html/testdata/go/doctype_named_entity.dat b/vendor/golang.org/x/net/html/testdata/go/doctype_named_entity.dat
new file mode 100644
index 0000000..a8bd963
--- /dev/null
+++ b/vendor/golang.org/x/net/html/testdata/go/doctype_named_entity.dat
@@ -0,0 +1,8 @@
+#data
+<!DOCTYPE &gt; PUBLIC "&gt;" "&gt;">
+#errors
+#document
+| <!DOCTYPE > ">" ">">
+| <html>
+| <head>
+| <body>
--
2.45.4

61 changes: 61 additions & 0 deletions SPECS/docker-buildx/CVE-2026-39827.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
From dea4d512416306154b3fa843d1df540d61bace47 Mon Sep 17 00:00:00 2001
From: Nicola Murino <nicola.murino@gmail.com>
Date: Sun, 1 Mar 2026 11:49:28 +0100
Subject: [PATCH] ssh: prevent memory leak when rejecting channels

When a server rejects an incoming channel request via
NewChannel.Reject, the channel is left in the multiplexer's
channel list. Because the channel is never explicitly removed or
closed, its internal buffers and sync primitives remain allocated
for the lifetime of the SSH connection.

A malicious client could exploit this behavior by repeatedly
requesting to open channels that are destined to be rejected,
causing unbounded memory growth and potentially leading to a
Denial of Service (DoS) via resource exhaustion.

This change fixes the leak by calling ch.mux.chanList.remove
within the Reject method, removing the channel from the list and allowing the
garbage collector to reclaim the associated memory immediately.

Fixes golang/go#35127
Fixes CVE-2026-3982

Change-Id: Iaa177f5dfd151812dd404e528a4a1c77527a0e29
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/781320
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Upstream-reference: https://github.com/golang/crypto/commit/6c195c8a97ae3d91a366ebdd7787d5faa64bf42a.patch
---
vendor/golang.org/x/crypto/ssh/channel.go | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/vendor/golang.org/x/crypto/ssh/channel.go b/vendor/golang.org/x/crypto/ssh/channel.go
index 3967b65..77bac19 100644
--- a/vendor/golang.org/x/crypto/ssh/channel.go
+++ b/vendor/golang.org/x/crypto/ssh/channel.go
@@ -536,7 +536,17 @@ func (ch *channel) Reject(reason RejectionReason, message string) error {
Language: "en",
}
ch.decided = true
- return ch.sendMessage(reject)
+ err := ch.sendMessage(reject)
+
+ // Remove the channel from the mux to prevent memory leaks.
+ // Do not call ch.close() here: no goroutine holds a reference to a
+ // rejected channel's internal channels (msg, incomingRequests), so
+ // removing it from chanList is sufficient for GC. Calling close()
+ // would race with the mux loop goroutine (handlePacket or dropAll),
+ // causing a panic from closing an already-closed channel.
+ ch.mux.chanList.remove(ch.localId)
+
+ return err
}

func (ch *channel) Read(data []byte) (int, error) {
--
2.45.4

57 changes: 57 additions & 0 deletions SPECS/docker-buildx/CVE-2026-39835.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From bdabc78062a16543b86cfa71d6b2b1a5ddf2153c Mon Sep 17 00:00:00 2001
From: Nicola Murino <nicola.murino@gmail.com>
Date: Sun, 25 Jan 2026 15:55:17 +0100
Subject: [PATCH] ssh: fix panic when authority callbacks are nil

Previously, if CertChecker.IsHostAuthority or CertChecker.IsUserAuthority
were left unset, calling CheckHostKey or Authenticate would result in a
nil pointer dereference panic.

This change adds checks to ensure these callbacks are defined before
invocation, returning an error instead of panicking.

This issue was found during a security audit by NCC Group Cryptography
Services, sponsored by Teleport.

Fixes golang/go#79563
Fixes CVE-2026-39835

Change-Id: I2bd9c8d76646232e49f6aedc7b5334f3825918be
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/781660
Commit-Queue: Neal Patel <nealpatel@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Neal Patel <nealpatel@google.com>
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
Upstream-reference: https://github.com/golang/crypto/commit/ffd87b4878fa98ca2908ec534e1a410bf095a35e.patch
---
vendor/golang.org/x/crypto/ssh/certs.go | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/vendor/golang.org/x/crypto/ssh/certs.go b/vendor/golang.org/x/crypto/ssh/certs.go
index 27d0e14..2c442e4 100644
--- a/vendor/golang.org/x/crypto/ssh/certs.go
+++ b/vendor/golang.org/x/crypto/ssh/certs.go
@@ -342,6 +342,9 @@ func (c *CertChecker) CheckHostKey(addr string, remote net.Addr, key PublicKey)
if cert.CertType != HostCert {
return fmt.Errorf("ssh: certificate presented as a host key has type %d", cert.CertType)
}
+ if c.IsHostAuthority == nil {
+ return errors.New("ssh: cannot verify certificate, IsHostAuthority not set")
+ }
if !c.IsHostAuthority(cert.SignatureKey, addr) {
return fmt.Errorf("ssh: no authorities for hostname: %v", addr)
}
@@ -369,6 +372,9 @@ func (c *CertChecker) Authenticate(conn ConnMetadata, pubKey PublicKey) (*Permis
if cert.CertType != UserCert {
return nil, fmt.Errorf("ssh: cert has type %d", cert.CertType)
}
+ if c.IsUserAuthority == nil {
+ return nil, errors.New("ssh: cannot verify certificate, IsUserAuthority not set")
+ }
if !c.IsUserAuthority(cert.SignatureKey) {
return nil, fmt.Errorf("ssh: certificate signed by unrecognized authority")
}
--
2.45.4

Loading
Loading