cve.bz

CVE-2023-39318 golang go: Cross-site Scripting

6.1 mediumEPSS 0.9%Fix available

Medium (6.1) in golang go. EPSS 0.9% estimated probability of exploitation activity in the next 30 days. Fixed in stdlib 1.20.8, 1.21.1.

On this page
The html/template package does not properly handle HTML-like "" comment tokens, nor hashbang "#!" comment tokens, in <script> contexts. This may cause the template parser to improperly interpret the contents of <script> contexts, causing actions to be improperly escaped. This may be leveraged to perform an XSS attack.

Severity

CVSS 3.1

6.1 medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
EPSS
0.9% (unchanged from 0.9% a week ago; 0.9% 30 days ago) estimated probability of exploitation activity in the next 30 days; 62nd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2024-09-26. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-79 Improper Neutralization of Input During Web Page Generation (Cross-site Scripting)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2023-39318 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2023-39318?via=ask-ai-copy and https://cve.bz/cve/CVE-2023-39318?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2023-39318 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Go standard library html/templatebefore 1.20.8
Go standard library html/templatefrom 1.21.0-0 before 1.21.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GO-2023-2041Gostdlib<1.20.8
>=1.21.0-0 <1.21.1
1.20.8, 1.21.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12golang-1.19no fix listedDEBIAN-CVE-2023-39318
Ubuntu14.04:LTSgolang-1.10no fix listedUBUNTU-CVE-2023-39318
Ubuntu16.04:LTSgolang-1.6, golang-1.10no fix listedUBUNTU-CVE-2023-39318
Ubuntu18.04:LTSgolang-1.8, golang-1.9, golang-1.10no fix listedUBUNTU-CVE-2023-39318
Ubuntu20.04:LTSgolang-1.13, golang-1.14no fix listedUBUNTU-CVE-2023-39318
Ubuntu20.04:LTSgolang-1.181.18.1-1ubuntu1~20.04.3UBUNTU-CVE-2023-39318 USN-7109-1
Ubuntu20.04:LTSgolang-1.201.20.3-1ubuntu0.1~20.04.1UBUNTU-CVE-2023-39318 USN-6574-1
Ubuntu20.04:LTSgolang-1.211.21.1-1~ubuntu20.04.2USN-6574-1
Ubuntu22.04:LTSgolang-1.171.17.13-3ubuntu1.2UBUNTU-CVE-2023-39318 USN-7061-1
Ubuntu22.04:LTSgolang-1.181.18.1-1ubuntu1.2UBUNTU-CVE-2023-39318 USN-7109-1
Ubuntu22.04:LTSgolang-1.201.20.3-1ubuntu0.1~22.04.1UBUNTU-CVE-2023-39318 USN-6574-1
Ubuntu22.04:LTSgolang-1.211.21.1-1~ubuntu22.04.2USN-6574-1
UbuntuPro:16.04:LTSgolang-1.181.18.1-1ubuntu1~16.04.6+esm1UBUNTU-CVE-2023-39318 USN-7109-1
4 more for Ubuntu in the JSON and on Ubuntu's page.
Red Hatenterprise_linux:8::appstreamaardvark-dns2:1.10.0-1.module+el8.10.0+21209+52deeb51RHSA-2024:2988
Red Hatenterprise_linux:8::appstreambuildah, buildah-tests, buildah-debuginfo and 2 more1:1.24.6-7.module+el8.9.0+20656+56f336b9RHSA-2024:0121
Red Hatenterprise_linux:8::appstreambuildah, buildah-tests, buildah-debuginfo and 2 more2:1.33.6-2.module+el8.10.0+21371+46937eceRHSA-2024:2988
Red Hatenterprise_linux:8::appstreamcockpit-podman0:46-1.module+el8.9.0+20656+56f336b9RHSA-2024:0121
Red Hatenterprise_linux:8::appstreamcockpit-podman0:84.1-1.module+el8.10.0+21373+0d273fdfRHSA-2024:2988
Red Hatenterprise_linux:8::appstreamconmon, conmon-debuginfo, conmon-debugsource2:2.1.4-2.module+el8.9.0+20656+56f336b9RHSA-2024:0121
Red Hatenterprise_linux:8::appstreamconmon, conmon-debuginfo, conmon-debugsource3:2.1.10-1.module+el8.10.0+21077+98b84d8aRHSA-2024:2988
Red Hatenterprise_linux:8::appstreamcontainer-selinux2:2.205.0-3.module+el8.9.0+20656+56f336b9RHSA-2024:0121
Red Hatenterprise_linux:8::appstreamcontainer-selinux2:2.229.0-2.module+el8.10.0+21196+3f0abbcaRHSA-2024:2988
Red Hatenterprise_linux:8::appstreamcontainernetworking-plugins, containernetworking-plugins-debuginfo, containernetworking-plugins-debugsource1:1.1.1-6.module+el8.9.0+20875+8dd9d5d2RHSA-2024:0121
Red Hatenterprise_linux:8::appstreamcontainernetworking-plugins, containernetworking-plugins-debuginfo, containernetworking-plugins-debugsource1:1.4.0-2.module+el8.10.0+21366+f9cb49f8RHSA-2024:2988
Red Hatenterprise_linux:8::appstreamcontainers-common2:1-38.module+el8.9.0+20656+56f336b9RHSA-2024:0121
143 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Module for Development Tools 15 SP4, Linux Enterprise Module for Development Tools 15 SP5go1.201.20.8-150000.1.23.1SUSE-SU-2023:3700-1
SUSELinux Enterprise Module for Development Tools 15 SP4, Linux Enterprise Module for Development Tools 15 SP5go1.20-openssl1.20.8.1-150000.1.11.1SUSE-SU-2023:3840-1
SUSELinux Enterprise Module for Development Tools 15 SP4, Linux Enterprise Module for Development Tools 15 SP5go1.211.21.1-150000.1.6.1SUSE-SU-2023:3701-1
SUSELinux Enterprise Module for Development Tools 15 SP4, Linux Enterprise Module for Development Tools 15 SP5go1.21-openssl1.21.4.1-150000.1.5.1SUSE-SU-2023:4469-1
SUSEPackage Hub 12go1.21-41.1openSUSE-SU-2023:0360-1
SUSEPackage Hub 12go1.211.21.3-2.1openSUSE-SU-2023:0360-1
openSUSELeap 15.4, Leap 15.5go1.201.20.8-150000.1.23.1SUSE-SU-2023:3700-1
openSUSELeap 15.4, Leap 15.5go1.20-openssl1.20.8.1-150000.1.11.1SUSE-SU-2023:3840-1
openSUSELeap 15.4, Leap 15.5go1.211.21.1-150000.1.6.1SUSE-SU-2023:3701-1
openSUSELeap 15.4, Leap 15.5go1.21-openssl1.21.4.1-150000.1.5.1SUSE-SU-2023:4469-1
openSUSETumbleweedgo1.201.20.8-1.1openSUSE-SU-2024:13216-1
openSUSETumbleweedgo1.211.21.1-1.1openSUSE-SU-2024:13217-1
AlmaLinux8buildah, buildah-tests1:1.24.6-7.module_el8.9.0+3627+db8ec155ALSA-2024:0121
AlmaLinux8buildah-tests1:1.24.6-7.module_el8.9.0+3687+dcd7ef8fALSA-2024:0121
AlmaLinux8cockpit-podman46-1.module_el8.7.0+3344+5bcd850fALSA-2024:0121
AlmaLinux8conmon2:2.1.4-2.module_el8.9.0+3627+db8ec155ALSA-2024:0121
AlmaLinux8conmon2:2.1.4-2.module_el8.9.0+3687+dcd7ef8fALSA-2024:0121
AlmaLinux8container-selinux2:2.205.0-3.module_el8.9.0+3627+db8ec155ALSA-2024:0121
AlmaLinux8containernetworking-plugins1:1.1.1-6.module_el8.9.0+3711+04fcca5eALSA-2024:0121
AlmaLinux8containers-common2:1-38.module_el8.9.0+3627+db8ec155ALSA-2024:0121
AlmaLinux8crit, criu, criu-libs and 2 more3.15-3.module_el8.6.0+2877+8e437bf5ALSA-2024:0121
AlmaLinux8crit, criu, criu-libs and 2 more3.15-3.module_el8.6.0+3137+d33c3efbALSA-2024:0121
AlmaLinux8crun1.8.7-1.module_el8.9.0+3683+33eb0febALSA-2024:0121
AlmaLinux8fuse-overlayfs1.9-2.module_el8.9.0+3627+db8ec155ALSA-2024:0121
18 more for AlmaLinux in the JSON.
Rocky Linux8aardvark-dns2:1.10.0-1.module+el8.10.0+1815+5fe7415eRLSA-2024:2988
Rocky Linux8aardvark-dns2:1.10.0-1.module+el8.10.0+1825+623b0c20RLSA-2024:2988
Rocky Linux8aardvark-dns2:1.10.0-1.module+el8.10.0+1843+6892ab28RLSA-2024:2988
Rocky Linux8aardvark-dns2:1.10.0-1.module+el8.10.0+1872+2e18eb19RLSA-2024:2988
Rocky Linux8buildah1:1.24.6-7.module+el8.9.0+1445+07728297RLSA-2024:0121
Rocky Linux8cockpit-podman0:46-1.module+el8.9.0+1445+07728297RLSA-2024:0121
Rocky Linux8cockpit-podman0:84.1-1.module+el8.10.0+1815+5fe7415eRLSA-2024:2988
Rocky Linux8cockpit-podman0:84.1-1.module+el8.10.0+1825+623b0c20RLSA-2024:2988
Rocky Linux8cockpit-podman0:84.1-1.module+el8.10.0+1843+6892ab28RLSA-2024:2988
Rocky Linux8cockpit-podman0:84.1-1.module+el8.10.0+1872+2e18eb19RLSA-2024:2988
Rocky Linux8cockpit-podman0:84.1-1.module+el8.10.0+1874+ce489889RLSA-2024:2988
Rocky Linux8cockpit-podman0:84.1-1.module+el8.10.0+1880+8e896d1bRLSA-2024:2988
74 more for Rocky Linux in the JSON.

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

ProductPackageStateAdvisory
LVMS-4.14-RHEL-9lvms4/lvms-must-gather-rhel9:v4.14.1-3Fixed 2023-11-09RHBA-2023:6863
LVMS-4.14-RHEL-9lvms4/lvms-operator-bundle:v4.14.1-4Fixed 2023-11-09RHBA-2023:6863
LVMS-4.14-RHEL-9lvms4/lvms-rhel9-operator:v4.14.1-3Fixed 2023-11-09RHBA-2023:6863
LVMS-4.14-RHEL-9lvms4/topolvm-rhel9:v4.14.1-2Fixed 2023-11-09RHBA-2023:6863
Migration Toolkit for Virtualization 2.5migration-toolkit-virtualization/mtv-api-rhel9:2.5.3-11Fixed 2023-12-05RHBA-2023:7648
NETWORK-OBSERVABILITY-1.4.0-RHEL-9network-observability/network-observability-rhel9-operator:v1.4.0-51Fixed 2023-10-20RHSA-2023:5974
OADP-1.1-RHEL-8oadp/oadp-velero-rhel8:1.1.7-6Fixed 2023-10-25RHSA-2023:6115
OSSO-1.2-RHEL-8openshift-secondary-scheduler-operator/secondary-scheduler-operator-bundle:v1.2-8Fixed 2023-11-01RHSA-2023:6154
OSSO-1.2-RHEL-8openshift-secondary-scheduler-operator/secondary-scheduler-operator-rhel8:v1.2-13Fixed 2023-11-01RHSA-2023:6154
Red Hat Advanced Cluster Management for Kubernetes 2.6 for RHEL 8rhacm2/acm-governance-policy-addon-controller-rhel8:v2.6.8-6Fixed 2023-10-30RHSA-2023:6202
cert-manager Operator for Red Hat OpenShiftcert-manager/cert-manager-operator-rhel9Not affected
Cost Management Metrics Operatorcostmanagement-metrics-operator-containerAffected
Logging Subsystem for Red Hat OpenShiftopenshift-logging/logging-loki-rhel9Not affected
Node Maintenance Operatorworkload-availability/node-maintenance-rhel8-operatorAffected
OpenShift Developer Tools and ServiceshelmAffected
OpenShift Developer Tools and Servicesocp-tools-4/jenkins-rhel8Affected
OpenShift Pipelinesopenshift-pipelines-clientAffected
OpenShift Serverlessopenshift-serverless-1/client-kn-rhel8Will not fix
OpenShift Serverlessopenshift-serverless-clientsWill not fix
OpenShift Service Mesh 2openshift-golang-builder-containerAffected
111 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2023-39318.

Attack patterns (CAPEC)

  • CAPEC-63 Cross-Site Scripting (XSS) Likelihood: High · Severity: Very High
  • CAPEC-85 AJAX Footprinting Likelihood: High · Severity: Low
  • CAPEC-209 XSS Using MIME Type Mismatch Severity: Medium
  • CAPEC-588 DOM-Based XSS Likelihood: High · Severity: Very High
  • CAPEC-591 Reflected XSS Likelihood: High · Severity: Very High
  • CAPEC-592 Stored XSS Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON