Summary
Symfony's HtmlSanitizer UrlAttributeSanitizer Omits action/formaction/poster/cite, javascript: URI Survives Sanitization (XSS)
Description
symfony/html-sanitizer lets applications sanitise untrusted HTML. UrlAttributeSanitizer is the visitor responsible for validating URL-valued attributes and stripping dangerous schemes from them; it runs on every element regardless of configuration. Whether an attribute is kept is decided by the element/attribute allow-list; validating the scheme of a URL attribute is solely UrlAttributeSanitizer's responsibility.
UrlAttributeSanitizer::getSupportedAttributes() returned only ['src', 'href', 'lowsrc', 'background', 'ping']. The HTML URL-valued attributes action (<form>), formaction (<button>, <input type=image>), poster (<video>) and cite (<blockquote>, <q>, <del>, <ins>) were missing from that list, so DomVisitor never invoked scheme validation for them. As a result, when a configuration admits one of those attributes, a javascript: URI in it survived sanitisation.
Conditions for exploitation
allowSafeElements() is not affected: <form> and the formaction attribute are both flagged unsafe in W3CReference, and allowElement('form') resets the element's attribute list. Reaching the vulnerable attributes requires a deliberately permissive configuration, for example:
<form>+action:allowElement('form', '*'),allowElement('form', ['action', …]),allowElement('form')->allowAttribute('action', 'form'), or theallowStaticElements()preset (whose docblock already warns the output "may still contain other dangerous behaviors");<button>/<input type=image>+formaction:allowElement(…, '*'),allowAttribute('formaction', …), orallowStaticElements();<blockquote>/<q>/<del>/<ins>+cite, or<video>+poster: similarly via'*',allowAttribute(), orallowStaticElements().
For the action / formaction cases the victim must additionally submit the form or click the button.
Resolution
UrlAttributeSanitizer now also handles action, formaction, cite and poster. action / formaction / cite are validated against the link schemes (like <a href>, so javascript: is rejected and data: is dropped too); poster is validated against the media schemes (so data: images keep working). The behaviour of <a href> and <img src> is unchanged.
One behaviour change to be aware of: a relative action="/submit" on an allowed <form> is now dropped by default (the same as <a href> / <img src> today); ->allowRelativeLinks() re-enables it.
The patch for this issue is available here for branch 6.4.
Credits
Symfony would like to thank Himanshu Anand and Rémi Pelloux for reporting the issue and Nicolas Grekas for providing the fix.
Impact
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
symfony/html-sanitizer to 6.4.40 or later; symfony/html-sanitizer to 7.4.12 or later; symfony/html-sanitizer to 8.0.12 or later; symfony/symfony to 6.4.40 or later; symfony/symfony to 7.4.12 or later; symfony/symfony to 8.0.12 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-45753? CVE-2026-45753 is a low-severity cross-site scripting (XSS) vulnerability in symfony/html-sanitizer (composer), affecting versions >= 6.1.0, < 6.4.40. It is fixed in 6.4.40, 7.4.12, 8.0.12. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- Which packages are affected by CVE-2026-45753?
symfony/html-sanitizer(composer) (versions >= 6.1.0, < 6.4.40)symfony/symfony(composer) (versions >= 6.1.0, < 6.4.40)
- Is there a fix for CVE-2026-45753? Yes. CVE-2026-45753 is fixed in 6.4.40, 7.4.12, 8.0.12. Upgrade to this version or later.
- Is CVE-2026-45753 exploitable, and should I be worried? Whether CVE-2026-45753 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-45753 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-45753?
- Upgrade
symfony/html-sanitizerto 6.4.40 or later - Upgrade
symfony/html-sanitizerto 7.4.12 or later - Upgrade
symfony/html-sanitizerto 8.0.12 or later - Upgrade
symfony/symfonyto 6.4.40 or later - Upgrade
symfony/symfonyto 7.4.12 or later - Upgrade
symfony/symfonyto 8.0.12 or later
- Upgrade