-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uninitialized Memory Exposure #7
Comments
@Ilshidur - love how you remembered to say thanks, I do the same with my PR's. Important to show appreciation to maintainer(s) for their efforts. |
Hello. This is also reported by nsp and currently shows up in Is there an easy way to fix this? :) |
From what I understand from Snyk’s report, it should be fixable by stringifying if (this.fromEncoding) {
if (Buffer.isBuffer(data)) data = data.toString()
+ if (typeof data === 'number') data = String(data)
data = new Buffer(data, this.fromEncoding)
} Or did I miss something? |
It's about the second argument to the Buffer constructor – just need to enforce that it's undefined/null or a string (or not a number) |
Given the hackerone report, this doesn’t seem to be about the second argument passed to the
It’s about the fact that on Node 4.x and below, passing a number as a first argument to the Isn’t it? |
You're absolutely right – my bad. Sorry, I got confused when I was reviewing #8 – which misses the Buffer case |
@hugogiraudel #9 should fix it – let me know if you spot any issues with it |
Perfect, thank you! :) |
This has been fixed in |
@mhart NSP doesn't recognize this as patched https://nodesecurity.io/advisories/664. Has that been patched and if yes how could we mark it as patched? |
Yes it's been patched – that's what this issue is about. I don't know anything about nodesecurity.io – maybe @Ilshidur who reported this does? |
I don't really know about the validation process of nsp and Snyk. Sadly, I couldn't find any indication about marking this package as patched. However, I sometimes witnessed package authors notifying the Snyk team about their fix. As you are the maintainer of lots of projects (some of which I love !), I can contact the respective teams about this fix if you want. |
According to Snyk, stringstream has a vulnerability when run on Node.js 4.x and below.
The bug comes from this line : https://github.com/mhart/StringStream/blob/v0.0.5/stringstream.js#L32
More details can be found here : https://hackerone.com/reports/321670
Thank you for the package, by the way !
The text was updated successfully, but these errors were encountered: