From e1d99158811380a0901b57bb31bc5962bd83b837 Mon Sep 17 00:00:00 2001 From: Azure Linux Security Servicing Account Date: Wed, 27 May 2026 12:08:03 +0000 Subject: [PATCH 1/3] Patch cni-plugins for CVE-2026-42506, CVE-2026-27136 --- SPECS/cni-plugins/CVE-2026-27136.patch | 75 +++++++++++++++++++++++++ SPECS/cni-plugins/CVE-2026-42506.patch | 76 ++++++++++++++++++++++++++ SPECS/cni-plugins/cni-plugins.spec | 7 ++- 3 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 SPECS/cni-plugins/CVE-2026-27136.patch create mode 100644 SPECS/cni-plugins/CVE-2026-42506.patch diff --git a/SPECS/cni-plugins/CVE-2026-27136.patch b/SPECS/cni-plugins/CVE-2026-27136.patch new file mode 100644 index 00000000000..cf5ce250f05 --- /dev/null +++ b/SPECS/cni-plugins/CVE-2026-27136.patch @@ -0,0 +1,75 @@ +From 7c97195cfc6d79f6b9d52fc70eb2543965dfa2bd Mon Sep 17 00:00:00 2001 +From: Roland Shoemaker +Date: Fri, 8 May 2026 12:09:06 -0700 +Subject: [PATCH] html: ignore duplicate attributes during tokenization + +During tokenization ignore attributes with names we've already seen, +per WHATWG 13.2.5.33. This removes a parser misalignment that could be +leveraged to confuse sanitizers. + +Thanks to ensy for reporting this issue. + +Fixes CVE-2026-27136 + +Change-Id: Ib0a3edb8dbea35c431f74f8b0bbe6229625d7e1f +Reviewed-on: https://go-review.googlesource.com/c/net/+/781685 +Reviewed-by: Neal Patel +Reviewed-by: Nicholas Husin +TryBot-Bypass: Roland Shoemaker +Auto-Submit: Gopher Robot +Reviewed-by: Nicholas Husin +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: https://github.com/golang/net/commit/a452f3cc17168a60bc3f439a3ae0fcffc32eca0e.patch +--- + vendor/golang.org/x/net/html/token.go | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/vendor/golang.org/x/net/html/token.go b/vendor/golang.org/x/net/html/token.go +index 9bbdf7d..8f475e3 100644 +--- a/vendor/golang.org/x/net/html/token.go ++++ b/vendor/golang.org/x/net/html/token.go +@@ -156,6 +156,7 @@ type Tokenizer struct { + // incremented on each call to TagAttr. + pendingAttr [2]span + attr [][2]span ++ attrNames map[string]bool + nAttrReturned int + // rawTag is the "script" in "" that closes the next token. If + // non-empty, the subsequent call to Next will return a raw or RCDATA text +@@ -867,6 +868,7 @@ func (z *Tokenizer) readStartTag() TokenType { + func (z *Tokenizer) readTag(saveAttr bool) { + z.attr = z.attr[:0] + z.nAttrReturned = 0 ++ clear(z.attrNames) + // Read the tag name and attribute key/value pairs. + z.readTagName() + if z.skipWhiteSpace(); z.err != nil { +@@ -880,9 +882,11 @@ func (z *Tokenizer) readTag(saveAttr bool) { + z.raw.end-- + z.readTagAttrKey() + z.readTagAttrVal() +- // Save pendingAttr if saveAttr and that attribute has a non-empty key. +- if saveAttr && z.pendingAttr[0].start != z.pendingAttr[0].end { ++ // Save pendingAttr if saveAttr and that attribute has a non-empty key, and the key hasn't been seen before. ++ key := strings.ToLower(string(z.buf[z.pendingAttr[0].start:z.pendingAttr[0].end])) ++ if saveAttr && z.pendingAttr[0].start != z.pendingAttr[0].end && !z.attrNames[key] { + z.attr = append(z.attr, z.pendingAttr) ++ z.attrNames[key] = true + } + if z.skipWhiteSpace(); z.err != nil { + break +@@ -1269,8 +1273,9 @@ func NewTokenizer(r io.Reader) *Tokenizer { + // The input is assumed to be UTF-8 encoded. + func NewTokenizerFragment(r io.Reader, contextTag string) *Tokenizer { + z := &Tokenizer{ +- r: r, +- buf: make([]byte, 0, 4096), ++ r: r, ++ buf: make([]byte, 0, 4096), ++ attrNames: make(map[string]bool), + } + if contextTag != "" { + switch s := strings.ToLower(contextTag); s { +-- +2.45.4 + diff --git a/SPECS/cni-plugins/CVE-2026-42506.patch b/SPECS/cni-plugins/CVE-2026-42506.patch new file mode 100644 index 00000000000..219f1b0d0ed --- /dev/null +++ b/SPECS/cni-plugins/CVE-2026-42506.patch @@ -0,0 +1,76 @@ +From 2d74e15927d5afe82bd4cc3056e49fe5c6f6bbcb Mon Sep 17 00:00:00 2001 +From: Roland Shoemaker +Date: Fri, 8 May 2026 11:58:29 -0700 +Subject: [PATCH] html: properly check namespace in "in body" any other end tag + +When processing "any other end tag" in the "in body" insertion mode, +when searching for a matching start tag, properly check that said tag is +in the HTML namespace. + +Thanks to ensy for reporting this issue. + +Fixes CVE-2026-42506 + +Change-Id: Ia05867b3d8f8df69f7e9410a85d126fe0b092875 +Reviewed-on: https://go-review.googlesource.com/c/net/+/781700 +Auto-Submit: Gopher Robot +TryBot-Bypass: Roland Shoemaker +Reviewed-by: Nicholas Husin +Reviewed-by: Nicholas Husin +Reviewed-by: Neal Patel +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: https://github.com/golang/net/commit/0dc5b7a5f81d7155ade6d5e9db35992998679932.patch +--- + vendor/golang.org/x/net/html/parse.go | 4 +--- + .../x/net/html/testdata/go/in_body_end.dat | 17 +++++++++++++++++ + 2 files changed, 18 insertions(+), 3 deletions(-) + create mode 100644 vendor/golang.org/x/net/html/testdata/go/in_body_end.dat + +diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go +index 4d12a1c..3392845 100644 +--- a/vendor/golang.org/x/net/html/parse.go ++++ b/vendor/golang.org/x/net/html/parse.go +@@ -1368,8 +1368,6 @@ func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom, tagName string) { + } + + // inBodyEndTagOther performs the "any other end tag" algorithm for inBodyIM. +-// "Any other end tag" handling from 12.2.6.5 The rules for parsing tokens in foreign content +-// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign + func (p *parser) inBodyEndTagOther(tagAtom a.Atom, tagName string) { + for i := len(p.oe) - 1; i >= 0; i-- { + // Two element nodes have the same tag if they have the same Data (a +@@ -1379,7 +1377,7 @@ func (p *parser) inBodyEndTagOther(tagAtom a.Atom, tagName string) { + // Uncommon (custom) tags get a zero DataAtom. + // + // The if condition here is equivalent to (p.oe[i].Data == tagName). +- if (p.oe[i].DataAtom == tagAtom) && ++ if p.oe[i].Namespace == "" && (p.oe[i].DataAtom == tagAtom) && + ((tagAtom != 0) || (p.oe[i].Data == tagName)) { + p.oe = p.oe[:i] + break +diff --git a/vendor/golang.org/x/net/html/testdata/go/in_body_end.dat b/vendor/golang.org/x/net/html/testdata/go/in_body_end.dat +new file mode 100644 +index 0000000..5e14b34 +--- /dev/null ++++ b/vendor/golang.org/x/net/html/testdata/go/in_body_end.dat +@@ -0,0 +1,17 @@ ++#data ++--> ++#errors ++#document ++| ++| ++| ++| ++| ++| ++| ++|