CVE-2026-49216
JSON

5.1medium

Symfony UX: XSS in symfony/ux-autocomplete via unescaped AJAX response data

Severity
5.1medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.31% (higher than 16% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-mwqm-4fw3-cjvr

Description

Symfony UX is a JavaScript ecosystem for Symfony. From 2.2.0 until 2.36.0 and 3.1.0, the Stimulus controller in symfony/ux-autocomplete renders AJAX response items in _createAutocompleteWithRemoteData() by interpolating the text field into HTML template literals (<div>${item[labelField]}</div>) rather than text, allowing attacker-controlled markup from user-supplied dropdown values to execute in the browser of any user who opens an autocomplete widget backed by the same data. This issue is fixed in versions 2.36.0 and 3.1.0.

Affected

Product or packageVersionsReported by
symfony ux>= 3.0.0, < 3.1.0, < 2.36.0, from 2.2.0 before 2.36.0, 3.0.0CVE List, NVD
symfony/ux-autocomplete (Packagist)from 2.2.0 before 2.36.0, from 3.0.0 before 3.1.0GitHub Advisory Database

All scores

GitHub_M5.1medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
NVD5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-79

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Symfony UX is a JavaScript ecosystem for Symfony. From 2.2.0 until 2.36.0 and 3.1.0, the Stimulus controller in symfony/ux-autocomplete renders AJAX response items in _createAutocompleteWithRemoteData() by interpolating the text field into HTML template literals (<div>${item[labelField]}</div>) rather than text, allowing attacker-controlled markup from user-supplied dropdown values to execute in the browser of any user who opens an autocomplete widget backed by the same data. This issue is fixed in versions 2.36.0 and 3.1.0.

GitHub Advisory Database
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 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.

NVD (es)

Symfony UX es un ecosistema JavaScript para Symfony. Desde la versión 2.2.0 hasta la 2.36.0 y la 3.1.0, el controlador Stimulus en symfony/ux-autocomplete renderiza elementos de respuesta AJAX en _createAutocompleteWithRemoteData() interpolando el campo de texto en literales de plantilla HTML ([div]${item[labelField]}[/div]) en lugar de como texto, permitiendo que marcado controlado por el atacante, proveniente de valores de menú desplegable proporcionados por el usuario, se ejecute en el navegador de cualquier usuario que abra un widget de autocompletado respaldado por los mismos datos. Este problema está solucionado en las versiones 2.36.0 y 3.1.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-49216 changed 2026-07-21CVE Terms of Use
GitHub Advisory DatabaseGHSA-mwqm-4fw3-cjvr changed 2026-09-10CC-BY-4.0
NVDCVE-2026-49216 changed 2026-10-24Public domain