CVE-2026-32289: Golang Package Vulnerability Leading to XSS via Improper Context Tracking in JS Template Literals

golang Updated 13 Apr 2026

Summary

13/04/2026
Yes i
Unknown
Not published

CVE-2026-32289: JsBraceDepth Context Tracking Bugs (XSS) in html/template. Affects golang across 2 version ranges.

< 1.25.9 >= 1.26.0-0, < 1.26.2

Fixed in 1.25.9 or 1.26.2, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2026-32289 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Golang, developed by Google, is an open-source programming language designed for simplicity and efficiency. It is widely used for building web servers, data pipelines, and other applications. The language's html/template package is essential for rendering HTML and managing templates in web applications. However, this package has a vulnerability that affects how JavaScript template literals are processed, potentially exposing applications to cross-site scripting (XSS) attacks.

Vulnerability Detail

The vulnerability arises from improper context tracking across template branches in JavaScript template literals. When branches are used, the escaping of content may not be applied correctly, leading to potential XSS vulnerabilities. Additionally, template actions within these literals fail to track brace depth accurately, resulting in incorrect escaping. This could allow malicious scripts to be executed in the context of a user's browser, compromising the security of web applications.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.25.9 1.25.9
  • >= 1.26.0-0, < 1.26.2 1.26.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If immediate updating is not feasible, consider sanitizing user inputs and outputs to mitigate the risk of XSS attacks. Implementing a robust content security policy (CSP) can also help reduce the impact of potential vulnerabilities.

Conclusion

CVE-2026-32289 represents a significant security risk for applications using the Golang html/template package due to improper context tracking in JavaScript template literals. It is crucial for developers to update to the patched versions to safeguard their applications against potential XSS attacks.

See every vulnerability recorded for golang →

Share this vulnerability

FAQ

CVE-2026-32289 is a vulnerability in the Golang package that affects the html/template functionality, leading to potential XSS attacks due to improper context tracking in JavaScript template literals.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By checking your manifest file like package-lock.json, you can determine if your application is affected by this vulnerability.

If exploited, this vulnerability can allow attackers to execute malicious scripts in the user's browser, potentially leading to data theft, session hijacking, or other malicious activities.

Yes, you can implement input sanitization and a content security policy (CSP) to help mitigate the risk of XSS attacks while you work on updating the package.

Detailed information about CVE-2026-32289 can be found on the official GitHub repository and security advisory pages related to Golang.

Related vulnerabilities

Recent vulnerabilities recorded for golang.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.25.9 1.25.9
  • >= 1.26.0-0, < 1.26.2 1.26.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback