CVE-2023-24538

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.
Code Injection
ProviderTypeBase ScoreAtk. VectorAtk. ComplexityPriv. RequiredVector
NISTNIST
9.8 CRITICAL
NETWORK
LOW
NONE
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GoCNA
---
---
CVEADP
---
---
CISA-ADPADP
9.8 CRITICAL
NETWORK
LOW
NONE
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Base Score
CVSS 3.x
EPSS Score
Percentile: 69%
VendorProductVersion
golanggo
𝑥
< 1.19.8
golanggo
1.20.0 ≤
𝑥
< 1.20.3
𝑥
= Vulnerable software versions
Debian logo
Debian Releases
Debian Product
Codename
golang-1.15
bullseye
vulnerable
buster
postponed
golang-1.19
bookworm
1.19.8-2
fixed
bullseye
no-dsa
buster
postponed
Ubuntu logo
Ubuntu Releases
Ubuntu Product
Codename
golang-1.10
oracular
dne
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
dne
focal
dne
bionic
needed
xenial
needed
trusty
ignored
golang-1.13
oracular
dne
noble
dne
mantic
dne
lunar
dne
kinetic
ignored
jammy
Fixed 1.13.8-1ubuntu2.22.04.2
released
focal
Fixed 1.13.8-1ubuntu1.2
released
bionic
Fixed 1.13.8-1ubuntu1~18.04.4+esm1
released
xenial
Fixed 1.13.8-1ubuntu1~16.04.3+esm3
released
trusty
ignored
golang-1.14
oracular
dne
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
dne
focal
needed
bionic
dne
xenial
ignored
trusty
ignored
golang-1.16
oracular
dne
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
dne
focal
Fixed 1.16.2-0ubuntu1~20.04.1
released
bionic
Fixed 1.16.2-0ubuntu1~18.04.2+esm1
released
xenial
ignored
trusty
ignored
golang-1.17
oracular
dne
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
Fixed 1.17.13-3ubuntu1.2
released
focal
dne
bionic
dne
xenial
ignored
trusty
ignored
golang-1.18
oracular
dne
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
Fixed 1.18.1-1ubuntu1.1
released
focal
Fixed 1.18.1-1ubuntu1~20.04.2
released
bionic
Fixed 1.18.1-1ubuntu1~18.04.4
released
xenial
Fixed 1.18.1-1ubuntu1~16.04.4
released
trusty
ignored
golang-1.19
oracular
dne
noble
dne
mantic
dne
lunar
not-affected
kinetic
Fixed 1.19.2-1ubuntu1.1
released
jammy
dne
focal
dne
bionic
dne
xenial
ignored
trusty
ignored
golang-1.20
oracular
dne
noble
dne
mantic
not-affected
lunar
not-affected
kinetic
dne
jammy
not-affected
focal
not-affected
bionic
dne
xenial
ignored
trusty
ignored
golang-1.6
oracular
dne
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
dne
focal
dne
bionic
dne
xenial
needed
trusty
ignored
golang-1.8
oracular
dne
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
dne
focal
dne
bionic
needed
xenial
ignored
trusty
ignored
golang-1.9
oracular
dne
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
dne
focal
dne
bionic
needed
xenial
ignored
trusty
ignored