Skip to content
Medium 5.3

Symfony: HtmlSanitizer MetaRefreshAttributeSanitizer Matches Only a Narrow Subset of the Browser Refresh Grammar: Incomplete Fix for CVE-2026-48761

CVE-2026-121373 First seen on SecPulse

Affected packages

PackageAffected → Fixed
sensiolabssymfony
≥ 6.1.0, < 6.4.50→ 6.4.50
≥ 7.0.0, < 7.4.23→ 7.4.23
≥ 8.0.0, < 8.1.11→ 8.1.11
composersymfony/html-sanitizer
< 8.1.11→ 8.1.11
composersymfony/symfony
< 8.1.11→ 8.1.11
Packagistsymfony/html-sanitizer
≥ 8.0.0, < 8.1.11→ 8.1.11
Packagistsymfony/symfony
≥ 8.0.0, < 8.1.11→ 8.1.11

Fix status by distribution

Records published by each distribution for this CVE. Fixed versions differ by release; check each link.

Original description The description as published by the source.

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', '');
// , correct

$s->sanitizeFor('head', '');
$s->sanitizeFor('head', '');
$s->sanitizeFor('head', '');
// URL survives in all three, host allow-list defeated

The rendered &#61; 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 `me…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details