[go] html/template: fix JavaScript regexp tracking

1 view
Skip to first unread message

Neal Patel (Gerrit)

unread,
Aug 5, 2026, 12:40:08 PM (5 days ago) Aug 5
to Neal Patel, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Roland Shoemaker, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com

Neal Patel submitted the change

Change information

Commit message:
html/template: fix JavaScript regexp tracking

This change prevents pathological inputs from
closing an unescaped `/` early, allowing for
attacker-controlled data to inject arbitrary
unscaped content.

Additionally, CL 532595 hints at the invariant
in TestEscapeText potentially getting the update
this change makes.

For #80435
Fixes CVE-2026-56858
Change-Id: I502b8960249fa9a2827b44b64d081d224ac57cbc
Reviewed-by: Neal Patel <neal...@google.com>
Reviewed-by: Roland Shoemaker <rol...@golang.org>
Files:
  • M src/html/template/escape_test.go
  • M src/html/template/transition.go
Change size: M
Delta: 2 files changed, 57 insertions(+), 3 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I502b8960249fa9a2827b44b64d081d224ac57cbc
Gerrit-Change-Number: 807100
Gerrit-PatchSet: 3
Gerrit-Owner: Neal Patel <ne...@golang.org>
Gerrit-Reviewer: Neal Patel <ne...@golang.org>
Gerrit-Reviewer: Neal Patel <neal...@google.com>
Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
open
diffy
satisfied_requirement

Mark Freeman (Gerrit)

unread,
Aug 5, 2026, 5:19:11 PM (5 days ago) Aug 5
to Neal Patel, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Neal Patel, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com

Mark Freeman submitted the change

Change information

Commit message:
[release-branch.go1.25] html/template: fix JavaScript regexp tracking


This change prevents pathological inputs from
closing an unescaped `/` early, allowing for
attacker-controlled data to inject arbitrary
unscaped content.

Additionally, CL 532595 hints at the invariant
in TestEscapeText potentially getting the update
this change makes.

For #80435
Fixes CVE-2026-56858

Change-Id: I502b8960249fa9a2827b44b64d081d224ac57cbc
Reviewed-on: https://go-review.googlesource.com/c/go/+/807100
Reviewed-by: Neal Patel <neal...@google.com>
LUCI-TryBot-Result: golang...@luci-project-accounts.iam.gserviceaccount.com <golang...@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <rol...@golang.org>
(cherry picked from commit 0157ee9c8d501bac60d2ec8689fac1eea740215a)
Reviewed-on: https://go-review.googlesource.com/c/go/+/811000
Files:
  • M src/html/template/escape_test.go
  • M src/html/template/transition.go
Change size: M
Delta: 2 files changed, 57 insertions(+), 3 deletions(-)
Branch: refs/heads/release-branch.go1.25
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Neal Patel
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: release-branch.go1.25
Gerrit-Change-Id: I502b8960249fa9a2827b44b64d081d224ac57cbc
Gerrit-Change-Number: 811000
Gerrit-PatchSet: 2
Gerrit-Owner: Mark Freeman <markf...@google.com>
Gerrit-Reviewer: Mark Freeman <markf...@google.com>
Gerrit-Reviewer: Neal Patel <neal...@google.com>
Gerrit-CC: Neal Patel <ne...@golang.org>
open
diffy
satisfied_requirement

Mark Freeman (Gerrit)

unread,
Aug 5, 2026, 5:19:16 PM (5 days ago) Aug 5
to Neal Patel, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Neal Patel, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com

Mark Freeman submitted the change

Change information

Commit message:
[release-branch.go1.26] html/template: fix JavaScript regexp tracking


This change prevents pathological inputs from
closing an unescaped `/` early, allowing for
attacker-controlled data to inject arbitrary
unscaped content.

Additionally, CL 532595 hints at the invariant
in TestEscapeText potentially getting the update
this change makes.

For #80435
Fixes CVE-2026-56858

Change-Id: I502b8960249fa9a2827b44b64d081d224ac57cbc
Reviewed-on: https://go-review.googlesource.com/c/go/+/807100
Reviewed-by: Neal Patel <neal...@google.com>
LUCI-TryBot-Result: golang...@luci-project-accounts.iam.gserviceaccount.com <golang...@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <rol...@golang.org>
(cherry picked from commit 0157ee9c8d501bac60d2ec8689fac1eea740215a)
Files:
  • M src/html/template/escape_test.go
  • M src/html/template/transition.go
Change size: M
Delta: 2 files changed, 57 insertions(+), 3 deletions(-)
Branch: refs/heads/release-branch.go1.26
Submit Requirements:
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: release-branch.go1.26
Gerrit-Change-Id: I502b8960249fa9a2827b44b64d081d224ac57cbc
Gerrit-Change-Number: 811020
open
diffy
satisfied_requirement

Mark Freeman (Gerrit)

unread,
Aug 5, 2026, 5:19:22 PM (5 days ago) Aug 5
to Neal Patel, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Neal Patel, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com

Mark Freeman submitted the change

Change information

Commit message:
[release-branch.go1.27] html/template: fix JavaScript regexp tracking


This change prevents pathological inputs from
closing an unescaped `/` early, allowing for
attacker-controlled data to inject arbitrary
unscaped content.

Additionally, CL 532595 hints at the invariant
in TestEscapeText potentially getting the update
this change makes.

For #80435
Fixes CVE-2026-56858

Change-Id: I502b8960249fa9a2827b44b64d081d224ac57cbc
Reviewed-on: https://go-review.googlesource.com/c/go/+/807100
Reviewed-by: Neal Patel <neal...@google.com>
LUCI-TryBot-Result: golang...@luci-project-accounts.iam.gserviceaccount.com <golang...@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <rol...@golang.org>
(cherry picked from commit 0157ee9c8d501bac60d2ec8689fac1eea740215a)
Files:
  • M src/html/template/escape_test.go
  • M src/html/template/transition.go
Change size: M
Delta: 2 files changed, 57 insertions(+), 3 deletions(-)
Branch: refs/heads/release-branch.go1.27
Submit Requirements:
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: release-branch.go1.27
Gerrit-Change-Id: I502b8960249fa9a2827b44b64d081d224ac57cbc
Gerrit-Change-Number: 811040
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages