]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.20] html/template: disallow angle brackets in CSS values
authorRoland Shoemaker <bracewell@google.com>
Thu, 13 Apr 2023 22:40:44 +0000 (15:40 -0700)
committerCarlos Amedee <carlos@golang.org>
Tue, 2 May 2023 16:32:02 +0000 (16:32 +0000)
commit090590fdccc8442728aa31601927da1bf2ef1288
tree302c0178f028fc677b2bcfaeb578b2e990424ecf
parent25b4f4062589a349117aaf52edf8db8ffa68773b
[release-branch.go1.20] html/template: disallow angle brackets in CSS values

Angle brackets should not appear in CSS contexts, as they may affect
token boundaries (such as closing a <style> tag, resulting in
injection). Instead emit filterFailsafe, matching the behavior for other
dangerous characters.

Thanks to Juho Nurminen of Mattermost for reporting this issue.

For #59720
Fixes #59812
Fixes CVE-2023-24539

Change-Id: Iccc659c9a18415992b0c05c178792228e3a7bae4
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1826636
Reviewed-by: Julie Qiu <julieqiu@google.com>
Run-TryBot: Roland Shoemaker <bracewell@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1851492
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Roland Shoemaker <bracewell@google.com>
TryBot-Result: Security TryBots <security-trybots@go-security-trybots.iam.gserviceaccount.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/491336
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/html/template/css.go
src/html/template/css_test.go