The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-32289

CVE-2026-32289: Template Literal XSS Vulnerability

CVE-2026-32289 is a cross-site scripting flaw in JS template literals caused by improper context tracking and escaping. This vulnerability allows attackers to inject malicious scripts. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: April 10, 2026

CVE-2026-32289 Overview

CVE-2026-32289 is a Cross-Site Scripting (XSS) vulnerability in the Go programming language's html/template package. The vulnerability stems from improper context tracking across template branches for JavaScript template literals, combined with incorrect brace depth tracking for template actions within JS template literals. These flaws can result in actions being incorrectly or improperly escaped, enabling XSS attacks against web applications built with Go.

Critical Impact

Web applications using Go's html/template package with JavaScript template literals may be vulnerable to XSS attacks due to improper escaping of user-controlled content in template branches.

Affected Products

  • Go programming language html/template package
  • Web applications using Go templates with JavaScript template literals
  • Go-based web frameworks utilizing the affected template functionality

Discovery Timeline

  • 2026-04-08 - CVE-2026-32289 published to NVD
  • 2026-04-08 - Last updated in NVD database

Technical Details for CVE-2026-32289

Vulnerability Analysis

The vulnerability exists in Go's html/template package, which is designed to automatically escape dynamic content to prevent injection attacks. However, two distinct issues were identified in how the package handles JavaScript template literals (backtick-delimited strings in JavaScript):

First, the template engine fails to properly track the escaping context when template branches (such as {{if}} and {{else}} blocks) are used within JS template literals. This means that content rendered in different branches may receive inconsistent or incorrect escaping treatment.

Second, the template engine does not correctly track brace depth (${...}) within JavaScript template literals. JavaScript template literals allow embedded expressions using ${} syntax, and the failure to properly track these nested structures results in the wrong escaping rules being applied to dynamic content.

Root Cause

The root cause is improper state management in the html/template parser when processing JavaScript template literals. The context-sensitive escaping mechanism loses track of the current parsing state when encountering branching logic or nested brace expressions within template literals. This architectural limitation means the escaping logic cannot accurately determine whether content should be treated as being inside or outside of a JavaScript expression context.

Attack Vector

An attacker can exploit this vulnerability by crafting input that, when processed through a vulnerable Go template containing JavaScript template literals with branches or nested expressions, results in malicious JavaScript code being rendered without proper escaping. This enables classic XSS attack scenarios where:

  1. User-controlled data is passed to a Go template
  2. The template renders this data within a JavaScript template literal context
  3. Due to incorrect escaping, the attacker's payload executes in the victim's browser

The exploitation requires the target application to use html/template with JavaScript template literals that contain conditional branches or template actions, and to render user-controlled input within these constructs.

Detection Methods for CVE-2026-32289

Indicators of Compromise

  • Unexpected JavaScript execution in web application responses
  • User-reported suspicious behavior or redirects on affected pages
  • Web application firewall alerts indicating XSS payload patterns in requests
  • Anomalous client-side JavaScript errors logged by monitoring systems

Detection Strategies

  • Review Go template files for usage of JavaScript template literals with conditional branches ({{if}}, {{else}}, {{range}})
  • Audit templates that embed user-controlled data within backtick-delimited JavaScript strings
  • Implement Content Security Policy (CSP) headers to detect and block unauthorized script execution
  • Deploy web application firewall rules to detect common XSS payloads targeting template injection

Monitoring Recommendations

  • Enable verbose logging for template rendering in development and staging environments
  • Monitor for CSP violation reports that may indicate exploitation attempts
  • Implement browser-side monitoring for unexpected script executions
  • Review server logs for requests containing JavaScript-specific characters in unexpected parameters

How to Mitigate CVE-2026-32289

Immediate Actions Required

  • Update Go to the latest patched version that addresses this vulnerability
  • Audit all Go templates for usage of JavaScript template literals with branching logic
  • Consider temporarily removing or refactoring templates that use JS template literals with conditional branches
  • Implement strict Content Security Policy headers as a defense-in-depth measure

Patch Information

The Go team has addressed this vulnerability in a security update. The fix corrects the context tracking mechanism to properly handle template branches within JavaScript template literals and accurately track brace depth for embedded expressions. Administrators should review the Go.dev Change Log for patch details and the Go.dev Vulnerability Report for comprehensive vulnerability information. The official announcement is available via the Golang Announce Post.

Workarounds

  • Avoid using JavaScript template literals (backticks) in Go templates where user input may be rendered
  • Use traditional JavaScript string concatenation with explicit escaping functions instead of template literals
  • Implement additional manual escaping for any user-controlled data rendered in JavaScript contexts
  • Refactor templates to move dynamic JavaScript generation to server-side code with explicit sanitization
bash
# Configuration example
# Verify your Go version and update to the patched release
go version

# Update Go to the latest patched version
# Download from https://go.dev/dl/ or use your package manager

# Rebuild your application with the updated Go version
go build -o myapp ./cmd/myapp

# Audit templates for affected patterns using grep
grep -r "{{.*}}" --include="*.html" --include="*.tmpl" . | grep -E "\`.*\$\{.*\}\`"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechN/A

  • SeverityNONE

  • CVSS ScoreN/A

  • EPSS Probability0.01%

  • Known ExploitedNo
  • Impact Assessment
  • ConfidentialityNone
  • IntegrityNone
  • AvailabilityNone
  • Technical References
  • Go.dev Change Log

  • Go.dev Issue Tracker

  • Golang Announce Post

  • Go.dev Vulnerability Report
  • Latest CVEs
  • CVE-2026-43328: Linux Kernel Use-After-Free Vulnerability

  • CVE-2026-43329: Linux Kernel Netfilter DoS Vulnerability

  • CVE-2026-43330: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-43331: Linux Kernel DOS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English