# CVE-2026-94448: Go html/template XSS via stale context in consecutive expressions

Source: https://junglewise.ai/threats/cve-2026-94448-go-2026-6599-reset-context-tracking-on-consecutive-template  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-08. Updated: 2026-10-10  
License: CC BY 4.0 with a link back

CVE-2026-94448 · Severity: medium · CVSS 6.1 · Published 2026-10-08

Go's html/template package, used to safely render HTML and JavaScript in web applications, fails to properly track parsing context when processing consecutive JavaScript template literal expressions. An attacker can exploit this to inject malicious JavaScript code that bypasses the template's escaping protections, leading to cross-site scripting (XSS) attacks.

Technologies: [go (Go)](https://junglewise.ai/threats/technologies/go), [stdlib (Go)](https://junglewise.ai/threats/technologies/go-stdlib). Vendors: [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is CVE-2026-94448 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-94448 being exploited in the wild.

**How severe is CVE-2026-94448?** Medium severity, with a CVSS score of 6.1, published 8 October 2026.

**Which products and versions are affected?** go (Go) prior to fix; stdlib (Go) SEMVER:introduced=0,fixed=1.26.9,introduced=1.27.0-0,fixed=1.27.2.

**Is there a fix for CVE-2026-94448?** Yes. stdlib (Go): upgrade to 1.27.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-94448 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-94448?** Check whether you run go (Go) or stdlib (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- stdlib (Go): upgrade to 1.27.2 or later

  ```sh
  go get stdlib@v1.27.2
  ```


## Technical details

The vulnerability exists in html/template's context tracking for JavaScript template literals containing consecutive expressions (e.g., `${expr1}${expr2}`). The parser fails to reset its context state upon entering a new template expression, causing subsequent regular expressions to be misidentified and improperly escaped. This allows attackers to inject unescaped JavaScript through crafted template literals, bypassing XSS protections.

## Affected products

- Go Go prior to fix

## Identifiers

- CVE-2026-94448
- GO-2026-6599

## Timeline

- 2026-10-08: disclosed

## References

- [https://go.dev/cl/839866](https://go.dev/cl/839866)
- [https://go.dev/issue/81821](https://go.dev/issue/81821)

## Related threats

- [Go HTTP/1 server race condition in MaxBytesReader header handling](https://junglewise.ai/threats/cve-2026-97054-for-http-1-servers-when-maxbytesreader-s-limit-is-exceeded)
- [Go command unsafe pkg-config flag handling in cgo](https://junglewise.ai/threats/cve-2026-97039-building-a-malicious-package-that-uses-cgo-pkg-config-directives)
- [Go linker code injection via malicious package compilation](https://junglewise.ai/threats/cve-2026-97038-building-a-malicious-package-containing-syso-files-or-cgo-linker)
- [Go arbitrary code execution via malicious cgo linker flags](https://junglewise.ai/threats/cve-2026-97037-building-a-malicious-package-that-uses-cgo-could-cause-arbitrary)
- [Go cgo arbitrary code execution via Apple linker argument injection](https://junglewise.ai/threats/cve-2026-97036-on-darwin-building-a-malicious-package-that-uses-cgo-could-cause)
