Out-of-bounds Read
Description
fast-string-search npm package vulnerable to out-of-bounds read via incorrect memory handling for non-string inputs, allowing memory disclosure.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
fast-string-search npm package vulnerable to out-of-bounds read via incorrect memory handling for non-string inputs, allowing memory disclosure.
Vulnerability
Overview The fast-string-search package, which provides fast substring search using N-API and the Boyer-Moore algorithm, is vulnerable to an out-of-bounds read in all versions. The root cause lies in incorrect memory freeing and length calculation when a non-string value is passed as the source argument to functions such as indexOf [1][3]. This flaw occurs because the internal C++ code does not properly validate the type of the input, leading to improper memory management.
Exploitation
Details An attacker can trigger the vulnerability by passing a numeric or other non-string value as the source parameter. No authentication is required—the attack surface is limited to any application that uses fast-string-search with unsanitized input. The Snyk advisory includes a proof-of-concept: calling fss.indexOf(1, "9") after a legitimate search may return indices from the previous string, demonstrating memory leakage [3].
Impact
Successful exploitation allows an attacker to read previously allocated memory, potentially leaking sensitive data such as passwords, tokens, or other confidential information. The impact is limited to memory disclosure; arbitrary code execution is not directly possible via this vulnerability.
Mitigation
Status As of this writing, there is no patched version of fast-string-search. The project appears to be unmaintained, and users should migrate to alternative libraries (e.g., the built-in String.prototype.indexOf or Buffer.indexOf) to eliminate the risk [3].
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
fast-string-searchnpm | <= 1.4.3 | — |
Affected products
2- fast-string-search/fast-string-searchdescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4- github.com/advisories/GHSA-hmqg-p8f8-3qrwghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-25872ghsaADVISORY
- github.com/magiclen/node-fast-string-search/blob/c8dd9fc966abc80b327f509e63360f59e0de9fb5/src/fast-string-search.c%23L192ghsax_refsource_MISCWEB
- snyk.io/vuln/SNYK-JS-FASTSTRINGSEARCH-2392368ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.