title: Improper handling of special tags within script contexts in html/template
description: 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.
problem types: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
affected:
{
vendor: Go standard library
product: html/template
collectionURL: https://pkg.go.dev
packageName: html/template
versions:
version: 0, lessThan: 1.20.8, status: affected, versionType: semver
version: 1.21.0-0, lessThan: 1.21.1, status: affected, versionType: semver
programRoutines:
name: escaper.escapeText
name: tSpecialTagEnd
name: indexTagEnd
name: Template.Execute
name: Template.ExecuteTemplate
defaultStatus: unaffected
}