Out-of-bounds Read Affecting fast-string-search package, versions *


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.07% (32nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-FASTSTRINGSEARCH-2392368
  • published16 Jun 2022
  • disclosed3 Feb 2022
  • creditCristian-Alexandru Staicu

Introduced: 3 Feb 2022

CVE-2022-25872  (opens in a new tab)
CWE-125  (opens in a new tab)
First added by Snyk

How to fix?

There is no fixed version for fast-string-search.

Overview

fast-string-search is a module that can search substrings in a string by using N-API and boyer-moore-magiclen.

Affected versions of this package are vulnerable to Out-of-bounds Read due to incorrect memory freeing and length calculation for any non-string input as the source. This allows the attacker to read previously allocated memory.

###PoC

const fss = require('fast-string-search');
fss.indexOf("My password is joke 9", "is"); 
let res = fss.indexOf(1, "9"); 
// res will contain the index of "9" from the previous input and not the current one.
console.log(res)

References

CVSS Scores

version 3.1