{"id":"CVE-2026-121373","aliases":["GHSA-wm2w-4mgj-vw33"],"url":"https://o3.security/vulnerability/CVE-2026-121373","summary":"Symfony: HtmlSanitizer MetaRefreshAttributeSanitizer Matches Only a Narrow Subset of the Browser Refresh Grammar (Incomplete Fix for CVE-2026-48761)","details":"### Description\n\nThe `MetaRefreshAttributeSanitizer` introduced for CVE-2026-48761 sanitizes the refresh URL only when the `content` attribute matches:\n\n```php\n/^(\\s*\\d+\\s*[;,]\\s*url\\s*=\\s*)([\"\\']?)(.+?)\\2(\\s*)$/i\n```\n\nThe 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.\n\n```php\n$c = (new HtmlSanitizerConfig())->allowStaticElements()->allowLinkHosts(['trusted.example']);\n$s = new HtmlSanitizer($c);\n\n$s->sanitizeFor('head', '<meta http-equiv=\"refresh\" content=\"0;url=https://evil.example/\">');\n// <meta http-equiv=\"refresh\" />, correct\n\n$s->sanitizeFor('head', '<meta http-equiv=\"refresh\" content=\"0 url=https://evil.example/\">');\n$s->sanitizeFor('head', '<meta http-equiv=\"refresh\" content=\"0;https://evil.example/\">');\n$s->sanitizeFor('head', '<meta http-equiv=\"refresh\" content=\"9 , https://evil.example/\">');\n// URL survives in all three, host allow-list defeated\n```\n\nThe 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.\n\nThree 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/`.\n\nThis is reachable under any configuration that allows `meta` with `http-equiv` and `content`, including the documented `allowStaticElements()` preset.\n\n### Resolution\n\nThe 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.\n\nReviewers 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.\n\nThe patches for this issue are available [here](https://github.com/symfony/symfony/commit/2d4c4fe36200858b91132a95076fff3d9de89d26) for branch 6.4 (and forward-ported to 7.4, 8.1 and 8.2).\n\n### Credits\n\nSymfony would like to thank [Ilia Alshanetsky](https://github.com/iliaal) for reporting the issue.","published":"2026-11-04T12:59:22.585Z","modified":"2026-11-08T02:47:32.819362586Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"Packagist","name":"symfony/html-sanitizer","fixedVersion":"6.4.50"},{"ecosystem":"Packagist","name":"symfony/html-sanitizer","fixedVersion":"7.4.23"},{"ecosystem":"Packagist","name":"symfony/html-sanitizer","fixedVersion":"8.1.11"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"6.4.50"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"7.4.23"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"8.1.11"}],"fix":{"url":"https://github.com/symfony/symfony/commit/2d4c4fe36200858b91132a95076fff3d9de89d26","label":"symfony/symfony@2d4c4fe"},"references":[{"type":"WEB","url":"https://packagist.org/packages/symfony/html-sanitizer"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/121xxx/CVE-2026-121373.json"},{"type":"ADVISORY","url":"https://github.com/symfony/symfony/security/advisories/GHSA-wm2w-4mgj-vw33"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-121373"},{"type":"FIX","url":"https://github.com/symfony/symfony/commit/2d4c4fe36200858b91132a95076fff3d9de89d26"},{"type":"PACKAGE","url":"https://github.com/symfony/html-sanitizer"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/html-sanitizer/CVE-2026-121373.yaml"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-121373.yaml"},{"type":"PACKAGE","url":"https://github.com/symfony/symfony"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v6.4.50"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v7.4.23"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v8.1.11"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-11-08T02:47:32.819362586Z"}}