CVE-2026-27142: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in Go standard library html/template
Actions which insert URLs into the content attribute of HTML meta tags are not escaped. This can allow XSS if the meta tag also has an http-equiv attribute with the value "refresh". A new GODEBUG setting has been added, htmlmetacontenturlescape, which can be used to disable escaping URLs in actions in the meta content attribute which follow "url=" by setting htmlmetacontenturlescape=0.
AI Analysis
Technical Summary
CVE-2026-27142 identifies a cross-site scripting (XSS) vulnerability within the Go programming language's standard library, specifically in the html/template package responsible for safe HTML templating. The issue stems from improper escaping of URLs inserted into the content attribute of HTML meta tags when these tags include an http-equiv attribute set to "refresh". The meta refresh tag is commonly used to redirect or refresh web pages after a specified time interval. In this context, the URL following "url=" in the content attribute is not properly neutralized, allowing an attacker to inject malicious JavaScript code that executes in the victim's browser. This vulnerability is classified under CWE-79, indicating improper neutralization of input during web page generation. The Go team introduced a new GODEBUG environment variable, htmlmetacontenturlescape, which controls whether URLs in meta content attributes are escaped; setting this to 0 disables escaping, potentially increasing exposure. Affected versions include all Go releases up to 1.26.0-0. No public exploits have been reported yet, but the vulnerability could be leveraged in web applications that dynamically generate meta refresh tags using untrusted input. Since the vulnerability allows script execution in users' browsers, it can lead to session hijacking, credential theft, or other client-side attacks. The lack of a CVSS score means severity must be assessed based on impact and exploitability factors.
Potential Impact
The primary impact of CVE-2026-27142 is the potential for cross-site scripting attacks, which can compromise the confidentiality and integrity of user data by executing arbitrary scripts in the context of trusted web applications. This can lead to session hijacking, theft of sensitive information such as cookies or credentials, defacement, or redirection to malicious sites. Since the vulnerability involves meta refresh tags, attackers might exploit automatic page redirects to inject malicious payloads without requiring user interaction beyond visiting a crafted page. Organizations using Go's html/template package to generate web pages with meta refresh tags that include URLs derived from user input are at risk. This can affect web services, APIs, and internal tools built with Go, especially those that dynamically generate HTML content. The vulnerability could undermine user trust and lead to regulatory or compliance issues if exploited. Although no known exploits exist currently, the ease of exploitation and the widespread use of Go in web development suggest a significant potential impact if left unmitigated.
Mitigation Recommendations
To mitigate CVE-2026-27142, organizations should first upgrade to a Go version where this vulnerability is addressed once a patch is released. Until then, developers should avoid inserting untrusted user input into the content attribute of meta refresh tags. Review all templates and code paths generating meta refresh tags to ensure URLs are properly sanitized and escaped. Avoid disabling the htmlmetacontenturlescape escaping by setting it to 0 unless absolutely necessary and fully understood, as this increases risk. Implement strict input validation and output encoding for any data used in HTML meta tags. Consider replacing meta refresh redirects with safer alternatives like HTTP redirects or JavaScript-based navigation with proper sanitization. Conduct thorough code audits and penetration testing focusing on XSS vectors involving meta tags. Employ Content Security Policy (CSP) headers to restrict script execution and reduce the impact of potential XSS attacks. Monitor web application logs for unusual meta tag usage or injection attempts. Educate developers on secure templating practices and the risks of improper escaping in HTML generation.
Affected Countries
United States, Germany, China, India, United Kingdom, Canada, Australia, France, Japan, South Korea
CVE-2026-27142: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in Go standard library html/template
Description
Actions which insert URLs into the content attribute of HTML meta tags are not escaped. This can allow XSS if the meta tag also has an http-equiv attribute with the value "refresh". A new GODEBUG setting has been added, htmlmetacontenturlescape, which can be used to disable escaping URLs in actions in the meta content attribute which follow "url=" by setting htmlmetacontenturlescape=0.
AI-Powered Analysis
Technical Analysis
CVE-2026-27142 identifies a cross-site scripting (XSS) vulnerability within the Go programming language's standard library, specifically in the html/template package responsible for safe HTML templating. The issue stems from improper escaping of URLs inserted into the content attribute of HTML meta tags when these tags include an http-equiv attribute set to "refresh". The meta refresh tag is commonly used to redirect or refresh web pages after a specified time interval. In this context, the URL following "url=" in the content attribute is not properly neutralized, allowing an attacker to inject malicious JavaScript code that executes in the victim's browser. This vulnerability is classified under CWE-79, indicating improper neutralization of input during web page generation. The Go team introduced a new GODEBUG environment variable, htmlmetacontenturlescape, which controls whether URLs in meta content attributes are escaped; setting this to 0 disables escaping, potentially increasing exposure. Affected versions include all Go releases up to 1.26.0-0. No public exploits have been reported yet, but the vulnerability could be leveraged in web applications that dynamically generate meta refresh tags using untrusted input. Since the vulnerability allows script execution in users' browsers, it can lead to session hijacking, credential theft, or other client-side attacks. The lack of a CVSS score means severity must be assessed based on impact and exploitability factors.
Potential Impact
The primary impact of CVE-2026-27142 is the potential for cross-site scripting attacks, which can compromise the confidentiality and integrity of user data by executing arbitrary scripts in the context of trusted web applications. This can lead to session hijacking, theft of sensitive information such as cookies or credentials, defacement, or redirection to malicious sites. Since the vulnerability involves meta refresh tags, attackers might exploit automatic page redirects to inject malicious payloads without requiring user interaction beyond visiting a crafted page. Organizations using Go's html/template package to generate web pages with meta refresh tags that include URLs derived from user input are at risk. This can affect web services, APIs, and internal tools built with Go, especially those that dynamically generate HTML content. The vulnerability could undermine user trust and lead to regulatory or compliance issues if exploited. Although no known exploits exist currently, the ease of exploitation and the widespread use of Go in web development suggest a significant potential impact if left unmitigated.
Mitigation Recommendations
To mitigate CVE-2026-27142, organizations should first upgrade to a Go version where this vulnerability is addressed once a patch is released. Until then, developers should avoid inserting untrusted user input into the content attribute of meta refresh tags. Review all templates and code paths generating meta refresh tags to ensure URLs are properly sanitized and escaped. Avoid disabling the htmlmetacontenturlescape escaping by setting it to 0 unless absolutely necessary and fully understood, as this increases risk. Implement strict input validation and output encoding for any data used in HTML meta tags. Consider replacing meta refresh redirects with safer alternatives like HTTP redirects or JavaScript-based navigation with proper sanitization. Conduct thorough code audits and penetration testing focusing on XSS vectors involving meta tags. Employ Content Security Policy (CSP) headers to restrict script execution and reduce the impact of potential XSS attacks. Monitor web application logs for unusual meta tag usage or injection attempts. Educate developers on secure templating practices and the risks of improper escaping in HTML generation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- Go
- Date Reserved
- 2026-02-17T19:57:28.435Z
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 69ab4b1fc48b3f10ffddeb19
Added to database: 3/6/2026, 9:46:07 PM
Last enriched: 3/6/2026, 10:00:23 PM
Last updated: 3/6/2026, 11:58:13 PM
Views: 6
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.