The average modern application contains a significant number of open-source packages; in some cases up to 90%* Despite their significance they are often left out of the threat model leaving a gap in necessary mitigations and risk analysis.
Understanding the human element
Software supply chains, certainly in the open-source community, are primarily about trust between people. How many maintainers have publishing rights to your dependencies? The principle of least privilege applies here too, each of these maintainers represent a potential compromise vector. This has been shown by “Shai-Hulud”, one of the latest supply chain attacks, targeting the NPM ecosystem and affecting many packages using self-propagation**. This attack was initiated using spoofing and phishing techniques to gain access to developers’ accounts. Once access was obtained, the attackers could distribute malicious versions of the packages.
Not only are external actors a concern, but also insider threats, although more complicated to manage, should be considered. Package maintainers can go rogue, be coerced, make mistakes, and depending on the situation, might over-rely on AI to generate code and fix bugs.
Both situations lead to packages that could compromise multiple assets in IT environments where they are used, including both pre-production and production systems. As mentioned above the Shai-Hulud attack’s intended goal was to gain access and target any asset of value. This includes data, deployment of ransomware, resource-theft for crypto mining, etc. Depending on the type of attack and its targets, developer workstations, CI/CD pipelines and application servers and -databases can be compromised. When it concerns client-side packages, this can result in JavaScript execution in the end-user’s browser where credentials and cookies can be stolen to gain access to their accounts.
Licensing and legal requirements, the hidden risk
While security vulnerability dominates the supply chain discussion, license compliance is an equally serious yet often overlooked threat. Every third-party package you use in your software carries legal obligation that, if ignored, can result in forced product recalls, financial penalties and even publicizing intellectual property. Depending on which license type is used, different requirements apply.
- Permissive licenses (MIT, Apache, BSD): These are the most flexible and generally require preservation of copyright notices and disclaimers included with the original package.
- Weak copyleft licenses (MPL, EPL): These licenses are allowed to be used and linked with commercial and closed-source software, but it does require that any modification to the licensed code remains open-source
- Copyleft licenses (GPL, AGPL, LGPL) Overall these licenses require to release your own source code if you distribute the software. AGPL also extends requirements over network use, if a user interacts with the software over a network, the users also should have access to the source code itself. Generally copyleft licenses are considered a risk for proprietary code.
These license requirements are not only a risk with direct dependencies, as these licenses place requirements on linked source code. They also pose a risk deeper in the dependency tree in the form of transitive dependencies (i.e., dependencies of dependencies). Complying with the license requirements can become an issue as automated dependency updates might obscure to what licenses you’re bound by. Consistently monitor and review the requirements because package license models may change over time.