{"id":"CVE-2026-45753","aliases":["GHSA-hhg7-c65m-h7ff"],"url":"https://o3.security/vulnerability/CVE-2026-45753","summary":"Symfony: HtmlSanitizer UrlAttributeSanitizer Omits action/formaction/poster/cite — javascript: URI Survives Sanitization (XSS)","details":"### Description\n\n`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.\n\n`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.\n\n### Conditions for exploitation\n\n`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:\n\n* `<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\");\n* `<button>` / `<input type=image>` + `formaction`: `allowElement(…, '*')`, `allowAttribute('formaction', …)`, or `allowStaticElements()`;\n* `<blockquote>` / `<q>` / `<del>` / `<ins>` + `cite`, or `<video>` + `poster`: similarly via `'*'`, `allowAttribute()`, or `allowStaticElements()`.\n\nFor the `action` / `formaction` cases the victim must additionally submit the form or click the button.\n\n### Resolution\n\n`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.\n\nOne 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.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/26a598fcfc4f903cc55ff202f642ee621839825e) for branch 6.4.\n\n### Credits\n\nSymfony would like to thank Himanshu Anand and Rémi Pelloux for reporting the issue and Nicolas Grekas for providing the fix.","published":"2026-07-14T18:21:13.644Z","modified":"2026-08-12T03:51:24.151843640Z","cvss":null,"epss":{"score":0.00293,"percentile":0.21907,"asOf":"2026-08-16"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"symfony/html-sanitizer","fixedVersion":"6.4.40"},{"ecosystem":"Packagist","name":"symfony/html-sanitizer","fixedVersion":"7.4.12"},{"ecosystem":"Packagist","name":"symfony/html-sanitizer","fixedVersion":"8.0.12"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"6.4.40"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"7.4.12"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"8.0.12"}],"fix":{"url":"https://github.com/symfony/symfony/commit/487728e7e180a674a6d4c01bd0cb56161cc441b7","label":"symfony/symfony@487728e"},"references":[{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v6.4.40"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v7.4.12"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v8.0.12"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/45xxx/CVE-2026-45753.json"},{"type":"ADVISORY","url":"https://github.com/symfony/symfony/security/advisories/GHSA-hhg7-c65m-h7ff"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45753"},{"type":"FIX","url":"https://github.com/symfony/symfony/commit/487728e7e180a674a6d4c01bd0cb56161cc441b7"},{"type":"WEB","url":"https://github.com/symfony/symfony/commit/26a598fcfc4f903cc55ff202f642ee621839825e"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/html-sanitizer/CVE-2026-45753.yaml"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45753.yaml"},{"type":"PACKAGE","url":"https://github.com/symfony/symfony"},{"type":"WEB","url":"https://symfony.com/cve-2026-45753"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:24.151843640Z"}}