CVE-2026-121373: Symfony HtmlSanitizer MetaRefreshAttributeSanitizer Matches Only A Vulnerability

MODERATE
Advisory Identifier: GHSA-wm2w-4mgj-vw33
CWE-186 CWE-601
Published
Advisory Summary

CVE-2026-121373 is a MODERATE htmlsanitizer metarefreshattributesanitizer matches only a vulnerability (CWE-186: Overly Restrictive Regular Expression) affecting Symfony libraries in the Packagist ecosystem. The issue involves htmlsanitizer metarefreshattributesanitizer matches only a narrow subset of the browser refresh grammar: incomplete fix for cve-2026-48761. Remediation is available by upgrading affected packages to version 6.4.50, 7.4.23, 8.1.11.

CVE-2026-121373 at a Glance

CVE Identifier CVE-2026-121373
GHSA Identifier GHSA-wm2w-4mgj-vw33
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-186: Overly Restrictive Regular Expression
Affected Product Symfony
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-121373

To remediate this vulnerability, upgrade all affected Symfony dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

symfony/html-sanitizer fixed: 6.4.50
Upgrade symfony/html-sanitizer to 6.4.50
symfony/html-sanitizer fixed: 7.4.23
Upgrade symfony/html-sanitizer to 7.4.23
symfony/html-sanitizer fixed: 8.1.11
Upgrade symfony/html-sanitizer to 8.1.11
symfony/symfony fixed: 6.4.50
Upgrade symfony/symfony to 6.4.50
symfony/symfony fixed: 7.4.23
Upgrade symfony/symfony to 7.4.23
symfony/symfony fixed: 8.1.11
Upgrade symfony/symfony to 8.1.11
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for symfony/html-sanitizer

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-121373, inspect your project dependencies for Symfony:

inspect dependencies for symfony/html-sanitizer

Analyze the terminal output to locate any version of Symfony in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.4.50), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-186: Overly Restrictive Regular Expression, where a regular expression is overly restrictive, which prevents dangerous values from being detected. In Symfony, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Description The `MetaRefreshAttributeSanitizer` introduced for CVE-2026-48761 sanitizes the refresh URL only when the `content` attribute matches: ```php /^(\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. ```php $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 `&#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 `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](https://github.com/symfony/symfony/commit/2d4c4fe36200858b91132a95076fff3d9de89d26) for branch 6.4 (and forward-ported to 7.4, 8.1 and 8.2). ### Credits Symfony would like to thank [Ilia Alshanetsky](https://github.com/iliaal) for reporting the issue.

CVE-2026-121373 Affected Symfony Versions

6 component(s)
Fixed Versions:
6.4.507.4.238.1.11
Product / Package Ecosystem Affected Versions Fixed Version
symfony/html-sanitizer
Packagist
≥ 6.1.0
< 6.4.50
6.4.50
symfony/html-sanitizer
Packagist
≥ 7.0.0
< 7.4.23
7.4.23
symfony/html-sanitizer
Packagist
≥ 8.0.0
< 8.1.11
8.1.11
symfony/symfony
Packagist
≥ 6.1.0
< 6.4.50
6.4.50
symfony/symfony
Packagist
≥ 7.0.0
< 7.4.23
7.4.23
symfony/symfony
Packagist
≥ 8.0.0
< 8.1.11
8.1.11

References

Frequently Asked Questions

What is CVE-2026-121373?
CVE-2026-121373 is a security vulnerability in Symfony involving HtmlSanitizer MetaRefreshAttributeSanitizer Matches Only a Narrow Subset of the Browser Refresh Grammar: Incomplete Fix for CVE-2026-48761 under CWE-186: Overly Restrictive Regular Expression.
Which Symfony versions are affected?
Affected versions include releases prior to 6.4.50, 7.4.23, 8.1.11 across affected packages: symfony/html-sanitizer, symfony/symfony.
What version fixes CVE-2026-121373?
Upgrading to 6.4.50, 7.4.23, 8.1.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/html-sanitizer affected?
Yes, symfony/html-sanitizer is affected in releases prior to 6.4.50, 7.4.23, 8.1.11. Upgrade your dependency to 6.4.50, 7.4.23, 8.1.11 or later.
Is symfony/symfony affected?
Yes, symfony/symfony is affected in releases prior to 6.4.50, 7.4.23, 8.1.11. Upgrade your dependency to 6.4.50, 7.4.23, 8.1.11 or later.
What CWE is associated with CVE-2026-121373?
CVE-2026-121373 is classified under CWE-186: Overly Restrictive Regular Expression (A regular expression is overly restrictive, which prevents dangerous values from being detected.).
How can I check Packagist dependencies for CVE-2026-121373?
Run the dependency tree command: 'inspect dependencies for symfony/html-sanitizer'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wm2w-4mgj-vw33",
  "modified" : "2026-12-01T21:30:05Z",
  "published" : "2026-12-01T21:30:04Z",
  "aliases" : [ "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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/html-sanitizer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.1.0"
      }, {
        "fixed" : "6.4.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/html-sanitizer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.4.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/html-sanitizer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.1.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.1.0"
      }, {
        "fixed" : "6.4.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.4.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.1.11"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "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" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/2d4c4fe36200858b91132a95076fff3d9de89d26"
  }, {
    "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-186", "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-01T21:30:04Z",
    "nvd_published_at" : "2026-11-04T13:17:27Z"
  }
}