CVE-2023-39318
Improper handling of HTML-like comments in script contexts in html/template
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.
Exposure status: unknown. This page does not establish whether an installed system is affected or corrected.
Severity and exploitation evidence
EPSS: 0.930% · score date 2026-11-19. EPSS is an estimated probability over the next 30 days, not proof of exploitation.
CISA KEV: not included in the checked catalog; exploitation may still occur. Last checked: 2026-11-19T17:59:58.648Z. Public exploit availability is not used to set this status.
Verification by field
| Field | Status | Checked at (UTC) | Source |
|---|---|---|---|
| kev | verified | 2026-11-19T17:59:58.648Z | CISA KEV |
| cvss | unknown | unknown | unknown |
| epss | verified | 2026-11-19T16:04:36.838Z | FIRST EPSS |
| patches | verified | 2026-11-19T12:52:39.236Z | OSV |
| affected | verified | 2026-11-19T12:56:56.995Z | CVE Program |
| lifecycle | verified | 2026-11-19T12:56:56.995Z | CVE Program |
Affected versions and configuration
Go standard library html/template; default status: unaffected: 0 to < 1.20.8 [affected; scheme: semver]; 1.21.0-0 to < 1.21.1 [affected; scheme: semver]
Defaults, conditional configuration, package status and version schemes are retained below. A version range alone is not an exposure verdict.
CVE Program · cve-json · full conditions
{
"affected": [
{
"vendor": "Go standard library",
"product": "html/template",
"versions": [
{
"status": "affected",
"version": "0",
"lessThan": "1.20.8",
"versionType": "semver"
},
{
"status": "affected",
"version": "1.21.0-0",
"lessThan": "1.21.1",
"versionType": "semver"
}
],
"packageName": "html/template",
"collectionURL": "https://pkg.go.dev",
"defaultStatus": "unaffected",
"programRoutines": [
{
"name": "isComment"
},
{
"name": "escaper.escapeText"
},
{
"name": "tJS"
},
{
"name": "tLineCmt"
},
{
"name": "Template.Execute"
},
{
"name": "Template.ExecuteTemplate"
}
]
}
],
"additionalContainers": [
{
"title": "CVE Program Container",
"references": [
{
"url": "https://go.dev/issue/62196",
"tags": [
"x_transferred"
]
},
{
"url": "https://go.dev/cl/526156",
"tags": [
"x_transferred"
]
},
{
"url": "https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ",
"tags": [
"x_transferred"
]
},
{
"url": "https://pkg.go.dev/vuln/GO-2023-2041",
"tags": [
"x_transferred"
]
},
{
"url": "https://security.netapp.com/advisory/ntap-20231020-0009/",
"tags": [
"x_transferred"
]
},
{
"url": "https://security.gentoo.org/glsa/202311-09",
"tags": [
"x_transferred"
]
}
],
"providerMetadata": {
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE",
"dateUpdated": "2024-08-02T18:02:06.918Z"
}
},
{
"title": "CISA ADP Vulnrichment",
"metrics": [
{
"other": {
"type": "ssvc",
"content": {
"id": "CVE-2023-39318",
"role": "CISA Coordinator",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"version": "2.0.3",
"timestamp": "2024-09-26T16:02:51.219482Z"
}
}
}
],
"providerMetadata": {
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP",
"dateUpdated": "2024-09-26T16:05:10.408Z"
}
}
]
}Archived source JSONOSV · osv · full conditions
{
"id": "GO-2023-2041",
"aliases": [
"BIT-golang-2023-39318",
"CVE-2023-39318"
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"fixed": "1.20.8"
},
{
"introduced": "1.21.0-0"
},
{
"fixed": "1.21.1"
}
]
}
],
"package": {
"name": "stdlib",
"purl": "pkg:golang/stdlib",
"ecosystem": "Go"
},
"versions": [],
"database_specific": {
"source": "https://vuln.go.dev/ID/GO-2023-2041.json"
},
"ecosystem_specific": {
"imports": [
{
"path": "html/template",
"symbols": [
"Template.Execute",
"Template.ExecuteTemplate",
"escaper.escapeText",
"isComment",
"tJS",
"tLineCmt"
]
}
]
}
}
],
"severity": [],
"upstream": [],
"withdrawn": null,
"references": [
{
"url": "https://go.dev/issue/62196",
"type": "REPORT"
},
{
"url": "https://go.dev/cl/526156",
"type": "FIX"
},
{
"url": "https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ",
"type": "WEB"
}
],
"relatedGitRanges": [],
"database_specific": {
"url": "https://pkg.go.dev/vuln/GO-2023-2041",
"review_status": "REVIEWED"
}
}Archived source JSONCorrection evidence
Distribution packages and upstream releases are distinct. ESM channels may require the corresponding Ubuntu entitlement. Notes and branch ranges are not installable package versions. OSV fixed boundaries are ecosystem-specific version thresholds, not proof that a package is currently available or installed.
| Evidence type | Distribution / release | Package | Channel | Version or source note | Source |
|---|---|---|---|---|---|
| ecosystem-boundary | Go / package | stdlib | Not a distribution channel | 1.20.8 | Official record |
| ecosystem-boundary | Go / package | stdlib | Not a distribution channel | 1.21.1 | Official record |
Vendor notices and operational guidance
No connected vendor notice is available for this record.
Original sources and dates
- CVE ProgramConsulted: 2026-11-19T12:56:56.995ZArchived source JSON
Source publication: 2023-09-08T16:13:24.063Z
Source modification: 2025-02-13T17:02:46.777ZDocument fingerprint
d1b996676ecc82ce50ee738bfee38a0ebcd5113cdc839580802d705fa4f6bc1b - CISA KEVConsulted: 2026-11-19T17:59:58.648ZArchived source JSON
Source publication: not supplied
Source modification: 2026-11-18T19:17:41.0354ZDocument fingerprint
a35fdc67c7d9802988dcfc1d3ff1198da327948d1db122ab7692ac201055ac56 - OSVConsulted: 2026-11-19T12:52:39.236ZArchived source JSON
Source publication: 2023-09-07T16:11:17.000Z
Source modification: 2026-02-04T04:25:22.510ZDocument fingerprint
4ca7818b395ba1078372d8aa5d2c3c1d10796ecab94cc944cbdcb6a19ce4ed17 - FIRST EPSSConsulted: 2026-11-19T16:04:36.838ZArchived source JSON
Source publication: not supplied
Source modification: not suppliedDocument fingerprint
752b5a4ab7063ebae6041b8a2218e2c7a480f9f66d4152a818c6a0713b1fa460
Official status history
- UNKNOWN → PUBLISHED · · evidence