]> Cypherpunks repositories - gostls13.git/commit
html/template: escape additional tokens in MarshalJSON errors
authorRoland Shoemaker <roland@golang.org>
Thu, 15 Feb 2024 01:18:36 +0000 (17:18 -0800)
committerRoland Shoemaker <roland@golang.org>
Tue, 27 Feb 2024 02:20:11 +0000 (02:20 +0000)
commitccbc725f2d678255df1bd326fa511a492aa3a0aa
treeced94819e022900dcd021726729e24bce55e9ee2
parentfc0d9a4b7d8bfd1130b1fe8419b50fffa76b00a9
html/template: escape additional tokens in MarshalJSON errors

Escape "</script" and "<!--" in errors returned from MarshalJSON errors
when attempting to marshal types in script blocks. This prevents any
user controlled content from prematurely terminating the script block.

Fixes #65697

Change-Id: Icf0e26c54ea7d9c1deed0bff11b6506c99ddef1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/564196
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
src/html/template/js.go
src/html/template/js_test.go