And so, what has happened in the in like what are having the bad news in the JavaScript world or in the NPM environment or ecosystem in the last years? Well, we all remember in March 2016, a package called LeftBatch which was very popular with a lot of JavaScript libraries. After a naming dispute, it was unpublished. And it caused so there's so much disruption that NPM had to republish again three hours later. And they now change or after this event, they change their unpublishing policies.
The next one that made the news was in February 2018, there was an issue with the NPM version 570. And it turns out that in Linux systems, it changed the ownership of the file system. So, they actually broke the machine, the Linux machines. In July 2018, the NPM credentials of one of the maintainers of ESLint scope were compromised. So, there was a release on version 372 and where in this particular release, what happens is the NPM credentials of the machine running ESLint scope were stolen and uploaded. In November 2018, it was discovered that there was a new version 336 of event stream. This particular package included a flat map strip that contained encrypted payload that stole bitcoins from some applications. And this is already the two more recent ones and I had to add a new one but we will see that slide in April 2020. A small package called ISPROMIS resulted in an outage in several list applications. In January 2022, and probably this you heard about it, the maintainer of colors pushed changes printing garbage text in an infinite loop. And this was what really happened to Aron Schwartz. And most recently, this was, let me see, this was at the beginning of each year, there was some malicious NPM packages that stole the scoring tokens. And the most recent one, this was last week, and the developer behind a huge popular NPM package node, IPC, released a subatomic version of the library. Actually, this particular version was not so downloaded until the Rhea evangelist added the modulus to the dependency. Well, actually the dependency to node, it was the malicious package was not node IPC. So, it was a dependency that was added by Rhea evangelist to node PC that make it for example, there was Vue JS dependent on it. So, that caused the problem. So, there are some issues here. There are some security and trust issues in the community. There are some security and trust issues with the code that we consume. And there are tools to help us. And of course, one of it and we are going to test it right now, well, in a few minutes, is JFocusray, an application security SEA tool attached to Artifactory, and it does full binary analysis. And not only binary analysis, that also checks deeply into all the layers of all the dependencies, for example, if you have Docker images, zip files or packages. The other one that I recommend you is to the OWAS dependency check. This is something maintained by this foundation, and it will tell you which of your dependencies have any issue. The third one, but this is most if you are an open source developer, or maintainer or project lead. Scorecards is a project that runs different heuristics associated with software security and assigns a score. So, from zero to ten. And it provides a report, this report is sent to the Linux Foundation and they get more information about what is the state of open source and the security in open source projects. So, that helps them. And it also helps the potential users of consumers of the different libraries. So, totally suggest you to use those. And finally, this is more for for starting the discussions with your managers or take it upstream. There is an article in the ACMQ. And it's about surviving software dependencies. And he is one of the things that he talks about is that the expected cost is all of having a failure in your application. It depends on all the sums of all the cost but the probability of something happened in or something happening as a risk. So, he says, to prevent that or to reduce this, we should make some questions about how or what is the status or the state of our dependencies. Actually, some of these questions actually inspire the scorecards project, or they at least intersect. So, first of all, you have to check is there a documentation? That is usually a good sign, even though some developers hate to do documentation. Others love it, but documentation is important. Are the APIs well designed? Is there a clear design, a consistent design? Do we call the parameter the same way in different versions? Well, not in this version, because there can be a breakage, but at least in similar APIs in the same version, can you see that there is a clear design in the set of APIs or the documentation? Code quality, we have to double check on that. I'm not saying that we run a static code analysis in the source code of all our dependencies that we are introducing, because clearly we have direct dependencies and transient dependencies, but again, in the ones that you depend a lot, this is important, because it's going to hurt more. Well, we can go into that discussion. So the code quality, is the code well written? Is this something that you would like to debug in case something goes wrong? Testing, are there tests for this particular library? Can you run them? Do they pass? Do they specify the basic functionality? Bug fixing, do they track bugs, or the project is like, oops, I did it again, and you'll figure it out? How many bug reports are open? How often do they close it? Do they answer? Maintenance, how often is it maintained? How frequent? How many people are working on the package? If it is used by a large community, chances are if the project leads are having to step down, somebody else will take the lead. So that's good.
Comments