GHSA-hvqh-jw65-wcpq: Devbridge autocomplete FormatGroup And FormatResult Fail To Vulnerability

MODERATE
CVSS 5.4
CWE-79
Published
Advisory Summary

GHSA-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.

GHSA-hvqh-jw65-wcpq at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-hvqh-jw65-wcpq
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Devbridge autocomplete
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (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.

devbridge-autocomplete fixed: 2.0.1
npm install devbridge-autocomplete@2.0.1
Verify Direct and Transitive Dependencies

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

### 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. ### Impact XSS 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. ### Patch Both 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`.

GHSA-hvqh-jw65-wcpq Affected Devbridge autocomplete Versions

1 component(s)
Fixed Versions:
2.0.1
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?
GHSA-hvqh-jw65-wcpq is a security vulnerability in Devbridge autocomplete involving formatGroup and formatResult fail to escape HTML in untrusted inputs under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Devbridge autocomplete versions are affected?
Affected versions include releases prior to 2.0.1 across affected packages: devbridge-autocomplete.
What version fixes GHSA-hvqh-jw65-wcpq?
Upgrading to 2.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is devbridge-autocomplete affected?
Yes, devbridge-autocomplete is affected in releases prior to 2.0.1. Upgrade your dependency to 2.0.1 or later.
What is the CVSS score of GHSA-hvqh-jw65-wcpq?
GHSA-hvqh-jw65-wcpq has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with GHSA-hvqh-jw65-wcpq?
GHSA-hvqh-jw65-wcpq 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 npm dependencies for GHSA-hvqh-jw65-wcpq?
Run the dependency tree command: 'npm ls devbridge-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-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
  }
}