CVE-2026-27142: URLs in meta content attribute actions are not escaped in html/template

Published Mar 6, 2026
·
Updated

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.

Other sources

URLs in meta content attribute actions are not escaped in html/template

Microsoft

Affected Software

2 affected components
Golang Go<1.25.8
Golang Go=1.26.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Do not set htmlmetacontenturlescape=0; keep htmlmetacontenturlescape enabled so URLs in the HTML meta tag content attribute actions following "url=" are escaped.

    Go GODEBUG (htmlmetacontenturlescape) htmlmetacontenturlescape = 0
  2. Configuration

    Ensure escaping is enabled for URLs inserted into the content attribute of HTML meta tags (actions following "url="), since URLs in meta content attribute actions are not escaped in html/template.

    Go html/template URL escaping in meta content attribute actions (following "url=") = enabled

Event History

Mar 6, 2026
CVE Published
via MITRE·09:28 PM
Data Sourced
via MITRE·09:28 PM
DescriptionWeakness
Data Sourced
via NVD·10:16 PM
DescriptionSeverityWeaknessAffected Software
Mar 11, 2026
Data Sourced
via Microsoft·08:03 AM
DescriptionSeverityWeakness
May 3, 58659
Event
via Microsoft·04:03 PM

Frequently Asked Questions

1

What is the severity of CVE-2026-27142?

CVE-2026-27142 is classified as a moderate severity vulnerability due to the potential for XSS attacks.

2

How do I fix CVE-2026-27142?

To fix CVE-2026-27142, update to Golang Go version 1.26.0 or later, as earlier versions are affected.

3

What are the main risks associated with CVE-2026-27142?

The main risk associated with CVE-2026-27142 is that attackers could exploit the XSS vulnerability to execute malicious scripts in users' browsers.

4

Which versions of Golang are affected by CVE-2026-27142?

Golang Go versions prior to 1.26.0 and all versions below 1.25.8 are affected by CVE-2026-27142.

5

Is there a workaround for CVE-2026-27142?

Currently, there is no specific workaround for CVE-2026-27142 other than updating to a secure version of Golang.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203