Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
Medium

Go html/template escaper bypass leads to XSS in <script> blocks

IdentifiersCVE-2026-39826CWE-79

CVE-2026-39826 is a cross-site scripting vulnerability in Go's html/template package. When a trusted template author writes a <script> tag with an empty type attribute or a type attribute containing ASCII whitespace, the template engine incorrectly escapes data interpolated into that script block. This results in an escaper bypass in a context that should be treated as script content, allowing attacker-controlled data passed into the template to be emitted with insufficient escaping. The issue affects html/template's contextual auto-escaping logic for script tags under these malformed or ambiguous type-attribute conditions.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can lead to cross-site scripting in applications that render attacker-controlled data inside affected html/template-generated <script> blocks. An attacker may be able to execute arbitrary JavaScript in the victim's browser in the security context of the vulnerable application, enabling session theft, credential theft, DOM manipulation, phishing, or other client-side compromise.

Mitigation

If you can’t patch tonight, do this now.

If immediate upgrade is not possible, avoid using <script> tags in html/template templates with an empty type attribute or a type attribute containing ASCII whitespace. Do not place untrusted data into affected script contexts, and prefer patterns that keep attacker-controlled data out of inline JavaScript entirely until the runtime is upgraded. Review templates for nonstandard or malformed script type attributes.

Remediation

Patch, then assume compromise.

Upgrade to a fixed Go release that includes the html/template correction for CVE-2026-39826. The provided context states that the issue was fixed in Go 1.26.3 and Go 1.25.10.
PUBLIC EXPLOITS

Exploits

No public exploits tracked yet. Mallory keeps watching.

VALID 0 / 0 TOTALView more in app

No public exploit code observed for this vulnerability.

EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
GolangGoapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

ACTIVITY FEED

Recent activity

6 sources tracked across advisories and community write-ups. News coverage will land here when it surfaces.

No news coverage yet. Advisories and community discussion only.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity6

Community discussion across Reddit, Mastodon, and other social sources.