5.3medium
Symfony: HtmlSanitizer MetaRefreshAttributeSanitizer Matches Only a Narrow Subset of the Browser Refresh Grammar (Incomplete Fix for CVE-2026-48761)
- Severity
- 5.3medium CVSS:4.0 by Checkmarx
- Exploit likelihood
- 0.85% (higher than 59% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Checkmarx
- Also known as
- GHSA-wm2w-4mgj-vw33
Description
The Symfony HtmlSanitizer component MetaRefreshAttributeSanitizer, introduced to fix CVE-2026-48761, sanitizes the refresh URL of content attributes of meta tags using a regular expression that is too narrow, allowing sanitization to be bypassed, and resulting in potential URL redirection to untrusted sites in Symfony versions 6.1.x prior to 6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11. The shared declarative refresh steps in the WHATWG HTML Standard require a broader approach: the separator after the time may be ASCII whitespace alone, with no ; or ,, and the url= keyword is optional. Directives the browser honours, but the regular expression misses are returned unchanged, so the attacker URL skips UrlSanitizer entirely and both allowLinkSchemes and allowLinkHosts are defeated for the refresh navigation. This is reachable under any configuration that allows meta with http-equiv and content, including the documented allowStaticElements() preset.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| symfony/html-sanitizer | from 6.1.0 before 6.4.50, from 7.0.0 before 7.4.23, from 8.0.0 before 8.1.11 | CVE List |
| symfony/html-sanitizer (Packagist) | from 6.1.0 before 6.4.50, from 7.0.0 before 7.4.23, from 8.0.0 before 8.1.11 | GitHub Advisory Database |
| symfony/symfony (Packagist) | from 6.1.0 before 6.4.50, from 7.0.0 before 7.4.23, from 8.0.0 before 8.1.11 | GitHub Advisory Database |
All scores
| Checkmarx | 5.3medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N |
Classification
What each source says
CVE List
The Symfony HtmlSanitizer component MetaRefreshAttributeSanitizer, introduced to fix CVE-2026-48761, sanitizes the refresh URL of content attributes of meta tags using a regular expression that is too narrow, allowing sanitization to be bypassed, and resulting in potential URL redirection to untrusted sites in Symfony versions 6.1.x prior to 6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11. The shared declarative refresh steps in the WHATWG HTML Standard require a broader approach: the separator after the time may be ASCII whitespace alone, with no ; or ,, and the url= keyword is optional. Directives the browser honours, but the regular expression misses are returned unchanged, so the attacker URL skips UrlSanitizer entirely and both allowLinkSchemes and allowLinkHosts are defeated for the refresh navigation. This is reachable under any configuration that allows meta with http-equiv and content, including the documented allowStaticElements() preset.
GitHub Advisory Database
Description
The MetaRefreshAttributeSanitizer introduced for CVE-2026-48761 sanitizes the refresh URL only when the content attribute matches:
/^(\s*\d+\s*[;,]\s*url\s*=\s*)(["\']?)(.+?)\2(\s*)$/i
The browser grammar, the WHATWG shared declarative refresh steps, is broader: the separator after the time may be ASCII whitespace alone, with no ; or ,, and the url= keyword is optional. Directives the browser honours but the regex misses are returned unchanged, so the attacker URL skips UrlSanitizer entirely and both allowLinkSchemes and allowLinkHosts are defeated for the refresh navigation.
$c = (new HtmlSanitizerConfig())->allowStaticElements()->allowLinkHosts(['trusted.example']);
$s = new HtmlSanitizer($c);
$s->sanitizeFor('head', '<meta http-equiv="refresh" content="0;url=https://evil.example/">');
// <meta http-equiv="refresh" />, correct
$s->sanitizeFor('head', '<meta http-equiv="refresh" content="0 url=https://evil.example/">');
$s->sanitizeFor('head', '<meta http-equiv="refresh" content="0;https://evil.example/">');
$s->sanitizeFor('head', '<meta http-equiv="refresh" content="9 , https://evil.example/">');
// URL survives in all three, host allow-list defeated
The rendered = is entity-decoded back to = by the HTML parser before the refresh algorithm runs, so the browser sees a valid directive. Because the URL never reaches UrlSanitizer, a javascript: refresh URL is not filtered either.
Three further spellings were found while fixing and are covered by the same patch: 0,https://evil.example/, .5;url=https://evil.example/ with an empty integer part, and the specification's incomplete-url= quirk 0;uhttps://evil.example/.
This is reachable under any configuration that allows meta with http-equiv and content, including the documented allowStaticElements() preset.
Resolution
The sanitizer now parses the value following the WHATWG shared declarative refresh steps, and it fails safe: once a value looks like a refresh directive, any parse that does not end in a sanitized URL causes the attribute to be dropped rather than passed through.
Reviewers should note one unavoidable consequence. sanitizeAttribute() receives only the element name and the attribute value, never http-equiv, so every <meta content> value must be treated alike. A value such as <meta name="description" content="10 tips for cooking"> is now dropped, or rewritten as a relative URL when allowRelativeLinks() is enabled, because that same string on an http-equiv="refresh" element does make a browser navigate. The collateral is bounded to meta content values beginning with a digit or a full stop.
The patches for this issue are available here for branch 6.4 (and forward-ported to 7.4, 8.1 and 8.2).
Credits
Symfony would like to thank Ilia Alshanetsky for reporting the issue.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-121373 changed 2026-11-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-wm2w-4mgj-vw33 changed 2026-12-01 | CC-BY-4.0 |
| NVD | CVE-2026-121373 changed 2026-11-06 | Public domain |