CVE-2026-27142

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

Published Mar 6, 2026 CVSS 3.1 · 6.1 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The Go standard library’s html/template package does not escape URLs that are inserted into the content attribute of meta tags. If a template renders a meta tag containing http-equiv="refresh" with a URL supplied from user input, the unescaped URL can be hijacked to inject arbitrary payloads, enabling a client‑side cross‑site scripting (XSS) attack. The flaw involves CWE‑79 and allows an attacker to execute arbitrary JavaScript in the context of the victim’s browser.

Affected Systems

The affected component is the Go standard library’s html/template package used when rendering web pages. No specific product version is mentioned in the public data, but any Go installation that uses html/template to generate meta tags with dynamic URLs is potentially vulnerable until the library is updated to the patched release.

Risk and Exploitability

The flaw is scored as CVSS 6.1, indicating a moderate severity, and the EPSS score is below 1 %, suggesting low current exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. Exploitation would require the attacker to influence the content passed to the template, such as through a form or URL parameter, and the attack vector is most likely client‑side via a web page that includes a meta‑refresh tag. Successful exploitation could lead to credential theft, session hijacking, or other XSS‑based damage in the victim’s browser.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Go runtime and compiler to the latest stable release that includes the fix for unescaped URLs in meta content attributes.
  • Ensure the GODEBUG environment variable htmlmetacontenturlescape is set to its default value (1) so that URLs are escaped, and avoid disabling this setting.
  • Review and modify any template code that generates meta tags with dynamic URLs; escape or validate the URLs using standard library functions before inserting them into the content attribute, and remove http-equiv="refresh" unless absolutely necessary.

Generated by OpenCVE AI on April 16, 2026 at 04:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Golang
Golang go
CPEs cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*
cpe:2.3:a:golang:go:1.26.0:*:*:*:*:*:*:*
Vendors & Products Golang
Golang go
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Go Standard Library
Go Standard Library html/template
Vendors & Products Go Standard Library
Go Standard Library html/template
Type Values Removed Values Added
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.
Title URLs in meta content attribute actions are not escaped in html/template
References
Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
Go
Published
Updated
Mar 16, 2026, 3:21 PM
Reserved
Feb 17, 2026, 7:57 PM
Status
Analyzed
Published
Mar 6, 2026, 10:16 PM
Modified
Jun 17, 2026, 10:26 AM
Severity
Moderate
Public date
Mar 6, 2026, 9:28 PM