PT-2023-8807 · Go+11 · Go+11

Sohom Datta

·

Published

2023-04-04

·

Updated

2025-09-13

·

CVE-2023-24538

CVSS v2.0

10

Critical

VectorAV:N/AC:L/Au:N/C:C/I:C/A:C
Name of the Vulnerable Software and Affected Versions Go versions prior to 1.21
Description The issue is related to the improper handling of backticks (`) as Javascript string delimiters in templates, which can lead to the injection of arbitrary Javascript code into the Go template. This occurs when a Go template action is used within a Javascript template literal. The decision was made to disallow Go template actions from being used inside Javascript template literals due to the complexity of ES6 template literals and the potential for string interpolation. With the fix, Template.Parse returns an Error when it encounters templates like this.
Recommendations For versions prior to 1.21, users can re-enable the previous behavior using the GODEBUG flag jstmpllitinterp=1, but this should be used with caution as backticks will now be escaped. It is recommended to update to Go 1.21 or later to resolve the issue. As a temporary workaround, consider avoiding the use of Go template actions within Javascript template literals to minimize the risk of exploitation.

Fix

Code Injection

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

ALSA-2023:6346
ALSA-2023:6363
ALSA-2023:6402
ALSA-2023:6473
ALSA-2023:6474
ALSA-2023:6938
ALSA-2023:6939
ALT-PU-2023-1575
ALT-PU-2023-1598
ALT-PU-2023-4736
ALT-PU-2023-4785
ALT-PU-2023-5492
ALT-PU-2023-7055
AZL-25992
AZL-25993
AZL-34751
AZL-37296
AZL-37411
AZL-78990
BDU:2024-01979
BIT-GOLANG-2023-24538
CESA-2023_3319
CESA-2023_6938
CESA-2023_6939
CVE-2023-24538
GO-2023-1703
MGASA-2023-0145
OESA-2023-1237
OESA-2024-1001
OESA-2024-1074
OESA-2024-2551
OESA-2024-2552
OESA-2024-2582
OESA-2025-1059
OPENSUSE-SU-2024:12841-1
OPENSUSE-SU-2024:12845-1
RHSA-2023:3318
RHSA-2023:3319
RHSA-2023:3323
RHSA-2023:3366
RHSA-2023:3445
RHSA-2023:3450
RHSA-2023:3536
RHSA-2023:3540
RHSA-2023:3612
RHSA-2023:4003
RHSA-2023:4093
RHSA-2023:4470
RHSA-2023:5964
RHSA-2023:6346
RHSA-2023:6363
RHSA-2023:6402
RHSA-2023:6473
RHSA-2023:6474
RHSA-2023:6938
RHSA-2023:6939
RHSA-2023_3318
RHSA-2023_3319
RHSA-2023_6346
RHSA-2023_6363
RHSA-2023_6402
RHSA-2023_6473
RHSA-2023_6474
RHSA-2023_6938
RHSA-2023_6939
SUSE-SU-2023:1791-1
SUSE-SU-2023:1792-1
SUSE-SU-2023:2105-1
SUSE-SU-2023:2105-2
SUSE-SU-2023:2127-1
USN-6038-1
USN-6038-2
USN-6140-1
USN-7061-1

Affected Products

Alt Linux
Almalinux
Astra Linux
Centos
Debian
Go
Linuxmint
Red Hat
Red Os
Rocky Linux
Suse
Ubuntu