Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Engineering
Bradley Meck Farias
January 23, 2023
npm has shipped a file explorer a little bit ago and it is rad to see! It is a wonderful feature but people may not understand just how big of infrastructure that something seemingly so simple needs to take. Engineers have to dig out lots of backend work and designs to handle something like this.
Like many things that appear to be simple lots of work and effort needs to be done for achieving the goals of something even so simple as a file explorer. Modern expectations might also make what seems simple actually be quite complex or even represent a shift in needs or desires of the average programmer. So, for a given tool we have to start asking questions and lamenting about all the complexity like:
All of these concerns and questions are just the very smallest bits of shipping a full file explorer at the scale of the npm registry. Which is quite impressive to see! It is easy to forget just how large the npm ecosystem is given how simple and seamless the file explorer looks. Most things couldn't handle how big the bandwidth of new packages are coming in, let alone setup the infrastructure to maintain tooling around all versions of all packages.
All of this though is a bunch of questions about what your tool can handle, not what a user wants or the goals of using the tool itself!
At Socket the goals of using a file explorer are not to just see individual files but to be able to peruse an interconnected set of dependencies and how they cause cascades of important information such as issues from dependencies to tracking where a variable came from. While our goals are around the product we serve; other companies like GitHub are doing things like providing enhanced searching for things like symbols in your code. These features are important to people visiting your file explorer because they alleviate the need to do something like clone a git repository or install a npm package to understand it.
In order to understand code, programmers have come to expect a certain level of features from their programming environments and those should be available on the web too. In the recent months this has become an even more complex topic as AI begins to have the ability to try to generate code or even explain code. Here are Socket Security we are trying to reach a level of comfort and familiarity while you use our product that allows you to understand at a glance rather than needing to study carefully. This would let you go from exploring to using (or not using!) packages quicker to accomplish you own goals rather than specifics of how code was written.
These goals come into a few basic things to keep in mind:
Programmers expect to be able to share code. In general when you are perusing an unfamiliar code base you may want to copy a link to a specific line of code and be able to come back to it. This could be to ask another person a question by sending them a link, keeping a bookmark for yourself for future reference, or even just because you like collecting fun snippets of code for memes. This is a bit complex though, as if you store the data as content addressable storage, you most likely would lose data if you link to it directly. Instead the context of the page needs to provide the data.
./bar.js
from ./foo.js
any permalink you provide to ./foo.js
needs to know which version of ./bar.js
to link to! So each permalink actually needs to hold enough information to actually recreate that. Luckily this can be done using npm package versions for Socket's web interface and you can see 1.2.2
in https://socket.dev/npm/package/minimist/files/1.2.2/package.json
so that jumping to the package entry point will preserve the right version from that file. For other cases like GitHub they pin to a git commit like https://github.com/SocketDev/socket-sdk-js/blob/107ff4c81316d3c9dba960c1cb18d2aab7d9c4aa/package.json (psssst, if you want to get this permalink there is a shortcut of pressing y
to make the UI add it for GitHub).Socket Security is very excited to see npm ship their explorer and are excited as things are starting to have a breakthrough in potential evolutions that we will see in the next few years about semantic understanding provided by file explorers! It goes both ways as well, lots of programmers who have already installed things don't want to have to leave their tooling to get help, and we can expect things to start to be improved directly in their programming environments to utilize file explorers whenever they can sync up.
Subscribe to our newsletter
Get notified when we publish new security blog posts!
Try it now
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.