Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html/template: errors returned from MarshalJSON are not correctly escaped [1.21 backport] #65968

Closed
gopherbot opened this issue Feb 27, 2024 · 2 comments
Labels
CherryPickApproved Used during the release process for point releases Security
Milestone

Comments

@gopherbot
Copy link

@rolandshoemaker requested issue #65697 to be considered for backport to the next 1.21 minor release.

@gopherbot please open backport issues, this is a PUBLIC track security issue.

@gopherbot gopherbot added CherryPickCandidate Used during the release process for point releases Security labels Feb 27, 2024
@gopherbot gopherbot added this to the Go1.21.8 milestone Feb 27, 2024
@rolandshoemaker rolandshoemaker added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Feb 27, 2024
@gopherbot
Copy link
Author

Change https://go.dev/cl/567515 mentions this issue: [release-branch.go1.21] html/template: escape additional tokens in MarshalJSON errors

@gopherbot
Copy link
Author

Closed by merging 3643147 to release-branch.go1.21.

gopherbot pushed a commit that referenced this issue Feb 28, 2024
…rshalJSON 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.

Updates #65697
Fixes #65968

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>
(cherry picked from commit ccbc725)
Reviewed-on: https://go-review.googlesource.com/c/go/+/567515
Reviewed-by: Carlos Amedee <carlos@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases Security
Projects
None yet
Development

No branches or pull requests

2 participants