cvedb.io
CVE-2023-24538
CRITICAL · CVSS 9.8
EPSS exploitation probability: 0%
Published 2023-04-06T16:15:07.800 · Last modified 2026-06-17T05:39:29.670

Summary

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 Erro

Affected products

golang — go

Does this affect you?

Add your gear to cvedb and we'll alert you only when golang ships something exploited.

Check my exposure →

References

This product uses data from the NVD API but is not endorsed or certified by the NVD. Informational only; not professional security advice.