CVE-2018-21270: Out-of-bounds Read in stringstream

stringstream Updated 02 Oct 2025

Summary

20/06/2019
Yes i
Moderate
Not published

CVE-2018-21270: Out-of-bounds Read in stringstream. Affects stringstream versions < 0.0.6. Fixed in 0.0.6. How to fix ↓

Also tracked for

The same CVE-2018-21270 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The stringstream package is an npm module that provides a stream interface for reading and writing strings. It is commonly used in Node.js applications to manipulate string data. However, all versions of stringstream prior to version 0.0.6 are vulnerable to an out-of-bounds read issue. This vulnerability occurs when uninitialized buffers are allocated when a number is passed into the input stream. This vulnerability affects Node.js 4.x and below.

Vulnerability Detail

The out-of-bounds read vulnerability in stringstream can lead to information disclosure or a crash of the application. When a number is passed into the input stream, uninitialized buffers are allocated, which can result in reading data beyond the intended boundaries. An attacker could potentially exploit this vulnerability to access sensitive information or cause the application to behave unexpectedly.

How To Fix

Minimum fixed version

0.0.6

This is the first release that contains the fix.

npm install stringstream@0.0.6

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As there is no fix available, a possible workaround is to validate and sanitize user input before passing it to stringstream. By ensuring that only valid input is processed, the risk of triggering the vulnerability can be reduced. Here is an example of how input validation can be implemented in a Node.js application:

const input = getUserInput();

if (typeof input === 'string') {
  // Process the input using stringstream
} else {
  // Handle invalid input
}

Conclusion

The stringstream package is vulnerable to an out-of-bounds read issue when a number is passed into the input stream. This vulnerability can lead to information disclosure or application crashes. Unfortunately, there is no fix available at the moment. It is recommended to avoid using stringstream if user input is involved. Consider implementing input validation and exploring alternative packages to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for stringstream →

Share this vulnerability

FAQ

The vulnerability can potentially lead to information disclosure or application crashes. An attacker could exploit this issue to access sensitive data or cause the application to behave unexpectedly.

Node.js 4.x and below are affected by this vulnerability.

No, there is currently no fix available for this vulnerability in the stringstream package.

Yes, there are alternative packages available for string manipulation in Node.js. It is recommended to explore other options and choose a package that is actively maintained and does not have known vulnerabilities.

If you are currently using stringstream and passing user input into it, it is recommended to stop using the package or implement input validation and sanitization to mitigate the risk of this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for stringstream.

How To Fix

Minimum fixed version

0.0.6

This is the first release that contains the fix.

npm install stringstream@0.0.6

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback