Vulnerabilities in pkg:npm/devbridge-autocomplete
PACKAGEGHSA-hvqh-jw65-wcpq is a MODERATE (CVSS 5.4) formatgroup and formatresult fail to vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Devbridge autocomplete libraries in the npm ecosystem. The issue involves formatgroup and formatresult fail to escape html in untrusted inputs. Remediation is available by upgrading affected packages to version 2.0.1.
pkg:npm/devbridge-autocomplete
Vulnerability advisories affecting package pkg:npm/devbridge-autocomplete. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-hvqh-jw65-wcpq | - | MODERATE | devbridge-autocomplete has XSS in its default formatters: formatGroup and formatResult fail to escape HTML in untrusted inputs |
GHSA-hvqh-jw65-wcpq at a Glance
Security Impact
CVSS: 5.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N).
How to Fix GHSA-hvqh-jw65-wcpq
To remediate this vulnerability, upgrade all affected Devbridge 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.
npm install devbridge-autocomplete@2.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls devbridge-autocomplete
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-hvqh-jw65-wcpq, inspect your project dependencies using npm:
npm ls devbridge-autocomplete
Analyze the terminal output to locate any version of Devbridge autocomplete in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.1), your application is affected.
Note: The npm ls devbridge-autocomplete command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
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 Devbridge 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
GHSA-hvqh-jw65-wcpq Affected Devbridge autocomplete Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
devbridge-autocomplete
|
npm |
< 2.0.1
|
2.0.1
|
References
Frequently Asked Questions
What is GHSA-hvqh-jw65-wcpq?
Which Devbridge autocomplete versions are affected?
What version fixes GHSA-hvqh-jw65-wcpq?
Is devbridge-autocomplete affected?
What is the CVSS score of GHSA-hvqh-jw65-wcpq?
What CWE is associated with GHSA-hvqh-jw65-wcpq?
How can I check npm dependencies for GHSA-hvqh-jw65-wcpq?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hvqh-jw65-wcpq",
"modified" : "2026-06-22T23:00:50Z",
"published" : "2026-06-22T23:00:50Z",
"aliases" : [ ],
"summary" : "devbridge-autocomplete has XSS in its default formatters: formatGroup and formatResult fail to escape HTML in untrusted inputs",
"details" : "### Summary\n\nThe 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.\n\n### Details\n\n**1. `formatGroup` — `category` is interpolated raw.**\n\n`src/format.ts`:\n\n```ts\nfunction formatGroup(suggestion, category) {\n return '<div class=\"autocomplete-group\">' + category + '</div>';\n}\n```\n\nIf `groupBy` is used and the grouping field of any suggestion contains HTML, that HTML is executed.\n\n**2. `formatResult` — early-return branch returns `suggestion.value` raw.**\n\n`src/format.ts`:\n\n```ts\nfunction formatResult(suggestion, currentValue) {\n if (!currentValue) {\n return suggestion.value; // un-escaped\n }\n /* ... non-empty path escapes correctly ... */\n}\n```\n\nThe 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`.\n\n### PoC (formatGroup)\n\n```html\n<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>PoC: formatGroup XSS in jQuery-Autocomplete v2.0.0</title>\n</head>\n<body>\n <input id=\"ac\" type=\"text\" placeholder=\"Type 'a' to trigger\" autocomplete=\"off\">\n\n <script src=\"https://code.jquery.com/jquery-3.7.1.min.js\"></script>\n <script src=\"dist/jquery.autocomplete.js\"></script>\n <script>\n var poisoned = [\n { value: 'Apple', data: { category: \"<img src=x onerror=\\\"alert('XSS via formatGroup')\\\">\" } },\n { value: 'Avocado', data: { category: 'Safe Group' } }\n ];\n\n $('#ac').devbridgeAutocomplete({\n lookup: poisoned,\n groupBy: 'category',\n minChars: 1\n });\n </script>\n</body>\n</html>\n```\n\nOriginally identified by an earlier human analysis; the PoC above was produced with the assistance of Claude Opus 4.7.\n\n### Impact\n\nXSS in pages that render attacker-controllable suggestion data. The actual impact depends on what the embedding page has access to (cookies, session tokens, DOM), per standard reflected/stored XSS.\n\n### Patch\n\nBoth formatters now run their interpolated input through the browser's text-node escaping (`createElement` + `textContent`) before producing the HTML string. Fixed in version `2.0.1`.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "devbridge-autocomplete"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.0.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/devbridge/jQuery-Autocomplete/security/advisories/GHSA-hvqh-jw65-wcpq"
}, {
"type" : "WEB",
"url" : "https://github.com/devbridge/jQuery-Autocomplete/commit/63ff096ff5b77a90aac7fb5dad7c86e538a59ce0"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/devbridge/jQuery-Autocomplete"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-22T23:00:50Z",
"nvd_published_at" : null
}
}