Advisory

GO-2023-2041

Also known as: BIT-golang-2023-39318, CVE-2023-39318

Summary

Improper handling of HTML-like comments in script contexts in html/template

Details

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

Not rated by the source.

Dates

Published
2023-09-07 16:11 UTC
Modified
2026-02-04 04:25 UTC

Affected packages and fixes

stdlib

Go · All systems

Affected

  • introduced 0, fixed 1.20.8, introduced 1.21.0-0, fixed 1.21.1 (semver)

Fixed versions

1.20.8, 1.21.1

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: Go Vulnerability Database · CC BY 4.0

Sources & licences