Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's a free idea for somebody at NPM or any other third party security provider: Tracking changes to network or fs access across versions

It should be possible to scan JS modules to determine either the fixed set of dependencies, the fixed set of system dependencies (ex: require('fs')), or whether it's not determinate (code contains "eval" or otherwise invokes require(...) with a non-constant). Including a package that has fs or net access would automatically include that taint as well.

The idea for this is that a malicious package would be more easily noticed as something like leftpad(...) suddenly requiring net access should be flagged. It's not a panacea as something malicious that already has fs or net access could do something new, but it would help add some sanity checks and give a smaller set of packages and versions to manually review.

I think deno (Node.js creator's new project using Typescript + Golang) has a similar idea but built in to the individual packages themselves where they need to explicitly include permissions for fs, net, etc. That'd be a great idea but getting to that point from the current (and growing) Node.js/NPM world is going to take a while.



Have a look at JSFuck: http://www.jsfuck.com


This is a losing game (think halting problem). This exact scenario was played by antivirus software versus malware in the 90s/00s. The antivirus was trying to figure out if the binary did something like modify a file on disk, while the virus was trying to obfuscate that or find innovative ways of doing it.

A isolation/capability solution is the only one that could work, leftpad shouldn't have access to anything but basic CPU compute.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: