CVE-2026-45753: Symfony: HtmlSanitizer UrlAttributeSanitizer Omits action/formaction/poster/cite — javascript: URI Survives Sanitization (XSS)

Published May 28, 2026
·
Updated

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 the allowStaticElements() preset (whose docblock already warns the output "may still contain other dangerous behaviors"); <button> / <input type=image> + formaction: allowElement(…, ''), allowAttribute('formaction', …), or allowStaticElements(); <blockquote> / <q> / <del> / <ins> + cite, or <video> + poster: similarly via '', allowAttribute(), or allowStaticElements().

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.

Other sources

Symfony is a PHP framework for web and console applications and a set of reusable PHP components. From 6.1.0-BETA1 until 6.4.40, 7.4.12, and 8.0.12, UrlAttributeSanitizer::getSupportedAttributes() omits URL-valued attributes including action, formaction, poster, and cite, so configurations that admit those attributes can leave javascript: URIs unsanitized and enable XSS when the resulting HTML is rendered or a victim submits a form or clicks a button. This issue is fixed in versions 6.4.40, 7.4.12, and 8.0.12.

MITRE

Affected Software

9 affected componentsFixes available
composer/symfony/symfony>=8.0.0<8.0.12
8.0.12
composer/symfony/symfony>=7.0.0<7.4.12
7.4.12
composer/symfony/symfony>=6.1.0<6.4.40
6.4.40
composer/symfony/html-sanitizer>=8.0.0<8.0.12
8.0.12
composer/symfony/html-sanitizer>=7.0.0<7.4.12
7.4.12
composer/symfony/html-sanitizer>=6.1.0<6.4.40
6.4.40
SensioLabs Symfony>=6.1.0<6.4.40
SensioLabs Symfony>=7.0.0<7.4.12
SensioLabs Symfony>=8.0.0<8.0.12

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/symfony/symfony to a version that resolves this vulnerability.

    Fixed in 8.0.12
  2. Upgrade

    Upgrade composer/symfony/symfony to a version that resolves this vulnerability.

    Fixed in 7.4.12
  3. Upgrade

    Upgrade composer/symfony/symfony to a version that resolves this vulnerability.

    Fixed in 6.4.40
  4. Upgrade

    Upgrade composer/symfony/html-sanitizer to a version that resolves this vulnerability.

    Fixed in 8.0.12
  5. Upgrade

    Upgrade composer/symfony/html-sanitizer to a version that resolves this vulnerability.

    Fixed in 7.4.12
  6. Upgrade

    Upgrade composer/symfony/html-sanitizer to a version that resolves this vulnerability.

    Fixed in 6.4.40
  7. Upgrade

    Upgrade symfony/html-sanitizer to a version that resolves this vulnerability.

    Fixed in 6.4.40
  8. Upgrade

    Upgrade symfony/html-sanitizer to a version that resolves this vulnerability.

    Fixed in 7.4.12
  9. Upgrade

    Upgrade symfony/html-sanitizer to a version that resolves this vulnerability.

    Fixed in 8.0.12
  10. Configuration

    If you rely on a relative `<form action="/submit">` being preserved for allowed `<form>` elements, call `->allowRelativeLinks()` because relative `action="/submit"` on an allowed `<form>` is now dropped by default after the fix.

    symfony/html-sanitizer UrlAttributeSanitizer / form action handling allowRelativeLinks() = enabled

Event History

May 28, 2026
Advisory Published
via GitHub·04:43 PM
Data Sourced
via GitHub·04:43 PM
DescriptionWeaknessAffected Software
Jul 14, 2026
CVE Published
via MITRE·06:21 PM
Data Sourced
via MITRE·06:21 PM
DescriptionWeakness
Data Sourced
via NVD·07:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-45753?

CVE-2026-45753 has a risk rating of 56.

2

What is CVE-2026-45753?

CVE-2026-45753 pertains to a vulnerability in the `symfony/html-sanitizer` related to improper handling of URL-valued attributes.

3

How do I fix CVE-2026-45753?

To fix CVE-2026-45753, update to the latest version of the `symfony/html-sanitizer` package that addresses this issue.

4

What applications are affected by CVE-2026-45753?

Applications using `composer/symfony/symfony` and `composer/symfony/html-sanitizer` are affected by CVE-2026-45753.

5

What type of vulnerability is CVE-2026-45753 classified as?

CVE-2026-45753 is classified as an XSS (Cross-Site Scripting) vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203