-
Notifications
You must be signed in to change notification settings - Fork 13
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
🔥NPM audit reports Denial of Service vulnerability #7
Comments
Hi @Dangoo, thanks for letting me know. Unfortunately no one got in touch with me reporting any issue as stated at npm. |
Mail was sent to support@npmjs.com - hopefully I will get a report on the allegation. |
Human errors may happen in human environments. Deserialization of untrusted data using this package is dangerous. Even though it uses safer-eval to try and sandbox evaluated code, it is vulnerable to DoS by deserializing 'function(){while(true){}}()'. Minimal viable sample: const serializeToJs = require('serialize-to-js')
var str = 'function(){while(true){}}()'
var res = serializeToJs.deserialize(str) // will never finish
console.log(res) As I will not be able to fix the issue I'd propose the following option:
Any other ideas? |
I disclosed this issue via npmjs.com, assuming they will contact the package owner. I guess they didn't... Sorry it turned out this way. A worker thread with time based termination is probably the best option, though this has to be min-maxed in some way - after all, if the timer is too long an attacker can still throttle their target by creating a ton of worker threads, and if it is too short legitimate work might terminate too early. Maybe create a limit on how many worker threads can be created, and possibly even a queue, to protect against the former. It would still restrict the service, but at least it won't crash or thrash when flooded. |
Could another option be to serialize functions into a string representation, and not deserialize them? This would be more useful than no deserialization. |
At the moment upgrading to >=2.0.0 removes the vulnerability but then installing eslint brings it right back. Here is my dependency hell: Updating eslint adds the audit warning back for serialize-to-js |
Hi @salientknight,
|
yeah I was able to update to version 3 but Parcel seems to using version <2 and claims it's a NPM false report issue. Either way, updating causes a warning that eslint@^5.0.0 is not installed (as noted above). I have done a new npm i and deleted json and I just seem locked a circle. |
Closing this issue as modules have been separated. |
Hi, just wanted to let you know, that of today NPM released an advisory that
serialize-to-js
is vulnerable to Denial of Service attacks with a high severity.https://npmjs.com/advisories/790
Would be great if you could look into it and hopefully resolve the vulnerability soon :)
The text was updated successfully, but these errors were encountered: