VYPR
Moderate severityNVD Advisory· Published Jun 17, 2022· Updated Sep 16, 2024

Out-of-bounds Read

CVE-2022-25872

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.

PackageAffected versionsPatched versions
fast-string-searchnpm
<= 1.4.3

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

4

News mentions

0

No linked articles in our index yet.