|
| 1 | +From 16acb322637a8ee779fa757345d7aef0ac16e69e Mon Sep 17 00:00:00 2001 |
| 2 | +From: Rohit Rawat < [email protected]> |
| 3 | +Date: Thu, 2 Jan 2025 10:22:13 +0000 |
| 4 | +Subject: [PATCH] Fix CVE CVE-2024-45338 in |
| 5 | + application-gateway-kubernetes-ingress |
| 6 | + |
| 7 | +--- |
| 8 | + vendor/golang.org/x/net/html/doctype.go | 2 +- |
| 9 | + vendor/golang.org/x/net/html/foreign.go | 3 +-- |
| 10 | + vendor/golang.org/x/net/html/parse.go | 4 ++-- |
| 11 | + 3 files changed, 4 insertions(+), 5 deletions(-) |
| 12 | + |
| 13 | +diff --git a/vendor/golang.org/x/net/html/doctype.go b/vendor/golang.org/x/net/html/doctype.go |
| 14 | +index c484e5a..bca3ae9 100644 |
| 15 | +--- a/vendor/golang.org/x/net/html/doctype.go |
| 16 | ++++ b/vendor/golang.org/x/net/html/doctype.go |
| 17 | +@@ -87,7 +87,7 @@ func parseDoctype(s string) (n *Node, quirks bool) { |
| 18 | + } |
| 19 | + } |
| 20 | + if lastAttr := n.Attr[len(n.Attr)-1]; lastAttr.Key == "system" && |
| 21 | +- strings.ToLower(lastAttr.Val) == "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" { |
| 22 | ++ strings.EqualFold(lastAttr.Val, "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd") { |
| 23 | + quirks = true |
| 24 | + } |
| 25 | + } |
| 26 | +diff --git a/vendor/golang.org/x/net/html/foreign.go b/vendor/golang.org/x/net/html/foreign.go |
| 27 | +index 9da9e9d..e8515d8 100644 |
| 28 | +--- a/vendor/golang.org/x/net/html/foreign.go |
| 29 | ++++ b/vendor/golang.org/x/net/html/foreign.go |
| 30 | +@@ -40,8 +40,7 @@ func htmlIntegrationPoint(n *Node) bool { |
| 31 | + if n.Data == "annotation-xml" { |
| 32 | + for _, a := range n.Attr { |
| 33 | + if a.Key == "encoding" { |
| 34 | +- val := strings.ToLower(a.Val) |
| 35 | +- if val == "text/html" || val == "application/xhtml+xml" { |
| 36 | ++ if strings.EqualFold(a.Val, "text/html") || strings.EqualFold(a.Val, "application/xhtml+xml") { |
| 37 | + return true |
| 38 | + } |
| 39 | + } |
| 40 | +diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go |
| 41 | +index 291c919..d93fe03 100644 |
| 42 | +--- a/vendor/golang.org/x/net/html/parse.go |
| 43 | ++++ b/vendor/golang.org/x/net/html/parse.go |
| 44 | +@@ -1031,7 +1031,7 @@ func inBodyIM(p *parser) bool { |
| 45 | + if p.tok.DataAtom == a.Input { |
| 46 | + for _, t := range p.tok.Attr { |
| 47 | + if t.Key == "type" { |
| 48 | +- if strings.ToLower(t.Val) == "hidden" { |
| 49 | ++ if strings.EqualFold(t.Val, "hidden") { |
| 50 | + // Skip setting framesetOK = false |
| 51 | + return true |
| 52 | + } |
| 53 | +@@ -1459,7 +1459,7 @@ func inTableIM(p *parser) bool { |
| 54 | + return inHeadIM(p) |
| 55 | + case a.Input: |
| 56 | + for _, t := range p.tok.Attr { |
| 57 | +- if t.Key == "type" && strings.ToLower(t.Val) == "hidden" { |
| 58 | ++ if t.Key == "type" && strings.EqualFold(t.Val, "hidden") { |
| 59 | + p.addElement() |
| 60 | + p.oe.pop() |
| 61 | + return true |
| 62 | +-- |
| 63 | +2.39.4 |
| 64 | + |
0 commit comments