CVE-2026-49216: symfony/ux-autocomplete Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-mwqm-4fw3-cjvr
CWE-79
Published
Advisory Summary

CVE-2026-49216 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting symfony/ux-autocomplete libraries in the Packagist ecosystem. The issue involves xss via unescaped ajax response data. Remediation is available by upgrading affected packages to version 2.36.0, 3.1.0.

CVE-2026-49216 at a Glance

CVE Identifier CVE-2026-49216
GHSA Identifier GHSA-mwqm-4fw3-cjvr
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product symfony/ux-autocomplete
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-49216

To remediate this vulnerability, upgrade all affected symfony/ux-autocomplete 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/ux-autocomplete fixed: 2.36.0
Upgrade symfony/ux-autocomplete to 2.36.0
symfony/ux-autocomplete fixed: 3.1.0
Upgrade symfony/ux-autocomplete to 3.1.0
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/ux-autocomplete

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-49216, inspect your project dependencies for symfony/ux-autocomplete:

inspect dependencies for symfony/ux-autocomplete

Analyze the terminal output to locate any version of symfony/ux-autocomplete in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.36.0), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In symfony/ux-autocomplete, 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 Stimulus controller shipped with `symfony/ux-autocomplete` renders AJAX response items into the dropdown by interpolating the `text` field directly into HTML template literals (`<div>${item[labelField]}</div>`) inside `_createAutocompleteWithRemoteData()`. The value is parsed as HTML rather than text, so any markup contained in the AJAX response is executed by the browser. When the dropdown values are derived from user-supplied content, an attacker can craft a string that triggers stored XSS in the browser of any other user who later opens a page containing an autocomplete widget backed by the same data. ### Resolution The `option` and `item` renderers used in `_createAutocompleteWithRemoteData()` now use TomSelect's `escape` helper to HTML-escape the value by default. Endpoints that legitimately return HTML (for example, to highlight the search term) can opt back in to the previous behavior by setting `options_as_html: true`. The `AutocompleteChoiceTypeExtension` normalizer that previously forced `options_as_html=false` when `autocomplete_url` was set has been dropped so the opt-in is reachable from the form layer. The patch for this issue is available [here](https://github.com/symfony/ux/commit/842ae54bc74de389299f975f01aafae272cb0019) for branch 2.x (and forward-ported to 3.x). ### Credits Symfony would like to thank Alex Ashkov for reporting the issue and Hugo Alliaume for providing the fix.

CVE-2026-49216 Affected symfony/ux-autocomplete Versions

2 component(s)
Fixed Versions:
2.36.03.1.0
Product / Package Ecosystem Affected Versions Fixed Version
symfony/ux-autocomplete
Packagist
≥ 2.2.0
< 2.36.0
2.36.0
symfony/ux-autocomplete
Packagist
≥ 3.0.0
< 3.1.0
3.1.0

References

Frequently Asked Questions

What is CVE-2026-49216?
CVE-2026-49216 is a security vulnerability in symfony/ux-autocomplete involving XSS via unescaped AJAX response data under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which symfony/ux-autocomplete versions are affected?
Affected versions include releases prior to 2.36.0, 3.1.0 across affected packages: symfony/ux-autocomplete.
What version fixes CVE-2026-49216?
Upgrading to 2.36.0, 3.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/ux-autocomplete affected?
Yes, symfony/ux-autocomplete is affected in releases prior to 2.36.0, 3.1.0. Upgrade your dependency to 2.36.0, 3.1.0 or later.
What CWE is associated with CVE-2026-49216?
CVE-2026-49216 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2026-49216?
Run the dependency tree command: 'inspect dependencies for symfony/ux-autocomplete'. 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-mwqm-4fw3-cjvr",
  "modified" : "2026-06-19T19:35:05Z",
  "published" : "2026-06-19T19:35:05Z",
  "aliases" : [ "CVE-2026-49216" ],
  "summary" : "symfony/ux-autocomplete: XSS via unescaped AJAX response data",
  "details" : "### Description\n\nThe Stimulus controller shipped with `symfony/ux-autocomplete` renders AJAX response items into the dropdown by interpolating the `text` field directly into HTML template literals (`<div>${item[labelField]}</div>`) inside `_createAutocompleteWithRemoteData()`. The value is parsed as HTML rather than text, so any markup contained in the AJAX response is executed by the browser.\n\nWhen the dropdown values are derived from user-supplied content, an attacker can craft a string that triggers stored XSS in the browser of any other user who later opens a page containing an autocomplete widget backed by the same data.\n\n### Resolution\n\nThe `option` and `item` renderers used in `_createAutocompleteWithRemoteData()` now use TomSelect's `escape` helper to HTML-escape the value by default. Endpoints that legitimately return HTML (for example, to highlight the search term) can opt back in to the previous behavior by setting `options_as_html: true`. The `AutocompleteChoiceTypeExtension` normalizer that previously forced `options_as_html=false` when `autocomplete_url` was set has been dropped so the opt-in is reachable from the form layer.\n\nThe patch for this issue is available [here](https://github.com/symfony/ux/commit/842ae54bc74de389299f975f01aafae272cb0019) for branch 2.x (and forward-ported to 3.x).\n\n### Credits\n\nSymfony would like to thank Alex Ashkov for reporting the issue and Hugo Alliaume for providing the fix.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/ux-autocomplete"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0"
      }, {
        "fixed" : "2.36.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/ux-autocomplete"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/ux/security/advisories/GHSA-mwqm-4fw3-cjvr"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/ux/commit/842ae54bc74de389299f975f01aafae272cb0019"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/ux-autocomplete/CVE-2026-49216.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/ux"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-19T19:35:05Z",
    "nvd_published_at" : null
  }
}