# CVE-2024-21524: node-stringbuilder vulnerable to Out-of-bounds Read

- Severity: High 8.2 (CVSS:3.1, scored by snyk) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H/E:P`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.87%, higher than 59% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2024-07-10T05:00:05.257Z
- Modified: 2026-06-17T07:09:40.537Z
- Also known as: GHSA-g533-xq5w-jmf3
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: snyk

## Description

All versions of the package node-stringbuilder are vulnerable to Out-of-bounds Read due to incorrect memory length calculation, by calling ToBuffer, ToString, or CharAt on a StringBuilder object with a non-empty string value input. It's possible to return previously allocated memory, for example, by providing negative indexes, leading to an Information Disclosure.

(As written by CVE List.)

## Affected

- node-stringbuilder: before *
- magiclen node-stringbuilder: before *
- node-stringbuilder (npm): up to 2.2.7
- magiclen stringbuilder: up to 2.2.7

## Every score

- snyk: CVSS:3.1 8.2 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H/E:P`
- GitHub: CVSS:3.1 8.2 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H`
- GitHub: CVSS:4.0 High `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 9.1 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H`

## References

- <https://security.snyk.io/vuln/SNYK-JS-NODESTRINGBUILDER-6421617> (exploit, third-party-advisory, web)
- <https://gist.github.com/dellalibera/0bb022811224f81d998fa61c3175ee67> (exploit, third-party-advisory, web)
- <https://github.com/magiclen/node-stringbuilder/blob/5c2797d3d6bf8cb6d10fe1e077609cef9a5a7de0/src/node-stringbuilder.c%23L1281> (broken-link)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-21524> (advisory)
- <https://github.com/magiclen/node-stringbuilder> (package)
- <https://github.com/magiclen/node-stringbuilder/blob/5c2797d3d6bf8cb6d10fe1e077609cef9a5a7de0/src/node-stringbuilder.c#L1281> (web)

## Sources

- CVE List: [CVE-2024-21524](https://www.cve.org/CVERecord?id=CVE-2024-21524), CVE Terms of Use, modified 2024-08-01
- GitHub Advisory Database: [GHSA-g533-xq5w-jmf3](https://github.com/advisories/GHSA-g533-xq5w-jmf3), CC-BY-4.0, modified 2024-07-10
- NVD: [CVE-2024-21524](https://nvd.nist.gov/vuln/detail/CVE-2024-21524), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-21524 · Whole record: https://cve.day/CVE-2024-21524.json · Rebuilt by cve.day 2026-11-25T22:58:42.726Z
