CVE-2023-39319

published 8 Sep 2023 · updated 12 Nov 2026

Improper handling of special tags within script contexts in html/template

6.1MediumCVSS 6.1EPSS 1%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 1%. Fixed in 1.20.8 and 1.21.1.

The html/template package does not apply the proper rules for handling occurrences of "<script", "<!--", and "</script" within JS literals in <script> contexts. This may cause the template parser to improperly consider script contexts to be terminated early, causing actions to be improperly escaped. This could be leveraged to perform an XSS attack.

Affected

Vendors, products and packages with version ranges

VendorProductVersionsFixed
Go standard library<1.20.8, >=1.21.0-0 <1.21.11.20.8, 1.21.1

Timeline

Every event on this vulnerability

Embed

A live severity badge for an advisory, README or ticket

CVE-2023-39319 severity on Zeptric[![CVE-2023-39319](https://zeptric.io/badge/cve/CVE-2023-39319.svg)](https://zeptric.io/cve/CVE-2023-39319)