Templates do not properly consider backticks (`) as Javascript string delimiters, and do not escape them as expected. Backticks are used, since ES6, for JS template literals. If a template contains a Go template action within a Javascript template literal, the contents of the action can be used to terminate the literal, injecting arbitrary Javascript code into the Go template. As ES6 template literals are rather complex, and themselves can do string interpolation, the decision was made to simply disallow Go template actions from being used inside of them (e.g. "var a = {{.}}"), since there is no obviously safe way to allow this behavior. This takes the same approach as github.com/google/safehtml. With fix, Template.Parse returns an Error when it encounters templates like this, with an ErrorCode of value 12. This ErrorCode is currently unexported, but will be exported in the release of Go 1.21. Users who rely on the previous behavior can re-enable it using the GODEBUG flag jstmpllitinterp=1, with the caveat that backticks will now be escaped. This should be used with caution.
History

Sun, 08 Sep 2024 19:00:00 +0000

Type Values Removed Values Added
First Time appeared Redhat openshift Distributed Tracing
CPEs cpe:/a:redhat:openshift_distributed_tracing:2.9::el8
Vendors & Products Redhat openshift Distributed Tracing

Mon, 19 Aug 2024 22:30:00 +0000

Type Values Removed Values Added
CPEs cpe:/a:redhat:openshift_distributed_tracing:2.9::el8
Vendors & Products Redhat openshift Distributed Tracing

cve-icon MITRE

Status: PUBLISHED

Assigner: Go

Published: 2023-04-06T15:50:48.185Z

Updated: 2024-08-02T11:03:17.754Z

Reserved: 2023-01-25T21:19:20.642Z

Link: CVE-2023-24538

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Modified

Published: 2023-04-06T16:15:07.800

Modified: 2023-11-25T11:15:14.263

Link: CVE-2023-24538

cve-icon Redhat

Severity : Moderate

Publid Date: 2023-04-04T00:00:00Z

Links: CVE-2023-24538 - Bugzilla