Using Software Composition Analysis to Mitigate Development Risk

February 18, 2022

WRITTEN BY THE KIUWAN TEAM
Experienced developers, cyber-security experts, ALM consultants, DevOps gurus and some other dangerous species.

As the world enters 2022, cybersecurity has become more critical than ever. The recently discovered Log4j vulnerability is one example of the potential havoc vulnerable open-source software components can wreak. But what is it that makes open source and third-party software components risky to deal with in the first place? 

Since anyone can openly view and edit open-source code, it’s not uncommon for vulnerabilities to appear in codebases and attackers to exploit them through different attack vectors. Open-source code also gets released freely through many software licenses, bringing intellectual property and legal issues for organizations that are not fully aware of the licensing terms.

Still, that’s not to claim open-source software is not to be used. There are ways for developers to deal with potential threats and assure software security. Software Composition Analysis (SCA) comes in handy for checking vulnerabilities and licensing issues line-by-line. It is an automated open-source and third-party code scanning tool you can use to save precious time and resources. 

In this brief guide, we’ll explain in detail what SCA is and how your development team can utilize it to secure your software from licensing and security risks.

6hP5SgTQePIe9zqxyLuyMDUDhXR9htcHmoaUY1FTpL8K7ec

What Is Software Composition Analysis (SCA)?

Software Composition Analysis (SCA) stands for the process of analyzing your codebase for all its components and dependencies. The goal is to assess the vulnerability and code security risk these components pose before attackers exploit them.

Besides discovering code vulnerability issues, Software Composition Analysis can also help address legal or code compliance issues in the software supply chain. For instance, software using third-party code that does not comply with industry standards or lacks an open-source license may lead to future development issues. SCA can help identify such code components in the codebase.

What Is the Software Supply Chain?

Simply put, the software supply chain is the sum of all components that go into a software’s code or other factors that determine the development operations of the code. These may include the CI/CD pipeline, APIs, and software libraries, to name a few. 

The supply chain also keeps track of where these components come from, their known vulnerabilities, and the license information. But how exactly is the software supply chain relevant to Software Composition Analysis? The answer has to do with code security.

These days, software dependencies are the norm, not the exception; it’s common for software to have multiple dependencies, including open source components. Any modern software product or service utilizes what is known as the multi-source development model. 

Under this model, an organization’s software development team does not code everything from scratch but uses a combination of the following:

  • Proprietary code that the development team writes on their own
  • Open-source code available under open source licenses
  • Third-party code from commercial software vendors

Benefits of Open Source Software

The primary advantage of the multi-source approach is that it significantly reduces development costs and is much easier to implement. Rather than reinventing the wheel every time, a development team can utilize existing solutions that have proven successful. Furthermore, by relying on multiple sources for software components, an organization can prevent vendor lock-in, reducing dependence on a single software vendor alone.

At the same time, this approach can also lead to more code vulnerabilities. This vulnerability arises because utilizing code from multiple sources significantly increases the attack surface of the codebase, which is the set of all points on the system’s perimeter where an attacker may try to penetrate the system.

Since third-party and open source components can form a good chunk of a software’s codebase, analyzing them for vulnerabilities with recommended application security testing practices is critical for ensuring code security.

The Risks of Open Source Software

Although utilizing Open Source Software (OSS) has many benefits, it does not come without its set of risks. OSS and code components can lead to two general risk categories:

Licensing Risks

Although OSS is generally free to use, that freedom often comes at a cost. As the saying goes, “there’s no such thing as a free lunch”; so too is the case with OSS. The catch is that programmers release open-source software or code components under a license.

On the one hand, we have permissive software licenses that provide developers virtually unlimited freedom with the software and code components. Developers can freely use, modify, or even sublicense the OSS and code components. Examples include Apache, MIT, and the BSD license.

On the other hand are copyleft licenses such as the GNU General Public License (GPL). Under such licenses, any derivations to the original code must also use the same license and licensing terms as the original. An organization that uses a copyleft license may risk its intellectual property, as it is possible for the original software publisher to claim the organization’s work as a derivative of their own. Worse yet, an organization not correctly understanding a license’s terms can run into legal troubles.

Security Risks

The other major OSS risk category is security. Since OSS is freely available by nature, there are no central security and quality control measures.

In theory, open-source code should be just as secure as proprietary code. In reality, since open source code is available to the public, it is much easier to uncover vulnerabilities and potential exploits in the code. Security researchers, analysts, and hackers are always looking for these vulnerabilities. 

The Apache Struts vulnerability CVE-2017-5638, which exploited a flaw in the Jakarta Multipart parser, is one example of how attackers abuse vulnerable open source code components. It allowed attackers to execute remote command injection attacks through parsing invalid HTTP content headers.

OSS security risks are so pervasive that the Open Web Application Security Project (OWASP) listed Vulnerable and Outdated Components (A06:2021) as the sixth most severe security threat to web application security. OWASP published this ranking in 2021 as the most recent list of top ten web application security threats.

How Can Software Composition Analysis Help?

Given the risks of open-source software, developers utilizing such code components should increase their application security. They can do so by opting for Software Composition Analysis tools built to eliminate the risk of exposing vulnerable open-source software components to attackers.

SCA tools generally have a three-part framework to provide DevSecOps teams a complete picture of their codebase and its vulnerabilities. This framework is summarized as follows:

  • Inventory Scan: This SCA tool provides a complete inventory of the codebase and its software component dependencies.
  • Analysis and Detection: After the inventory scan, an SCA tool analyzes the codebase to detect known vulnerabilities that potentially pose a threat. This analysis may include CVE codes of the vulnerabilities, CVSS scores, and license compliance risks.
  • Control and Remediation: Finally, the SCA tool will provide measures to control and remediate the vulnerabilities. These measures may include suggestions on upgrading outdated and vulnerable code components or using alternatives. A software bill of materials is an essential output of this phase, which contains a list of all code components and their respective licenses.

The three-step framework of Software Composition Analysis solutions can help bridge the gap between the analysis and the remediation phase. As a result, an organization deploying the SCA saves time and resources it would otherwise spend detecting vulnerabilities and fixing them.

Do I Need SAST If I Use SCA?

A common misconception is that SCA alone will cover all vulnerabilities in a codebase and that Static Application Security Testing (SAST) is not needed. While it is true that SCA is the newer technology and has a much broader scope, it is not a replacement for static testing altogether.

SCA is better-suited for analyzing third-party and open source components as a rule of thumb. In contrast, SAST lends itself much better for testing proprietary code. As such, be wary of SCA tools that market themselves as a complete replacement for SAST.

Final Thoughts

Despite the many advantages of open source software components, developers should be aware of its security and licensing risks. The Log4j vulnerability recently demonstrated that not even the most widely used open-source software components are secure. As such, any DevSecOps team worth its weight in salt should strongly consider using better security tools to protect its software from future risks.

As the saying goes for medicine: prevention is better than cure. So too, is the case with application security tools. When attackers discover a vulnerability and exploit it, it is often too late. The better approach for DevSecOps teams is to integrate application security with the rest of the organization’s software development cycle. 

SCA is one solution for discovering future code vulnerabilities during the software design and production phase. When paired with SAST, it can deliver even better results through proprietary, open-source, and third-party code.

Kiuwan is a security solutions provider that offers both SCA and SAST tools for an all-in-one application security package. Rather than using separate code security tools for open-source and proprietary code, developers can secure all their code components using a single platform.All Kiuwan products are fully compliant with the best IT security compliance standards, including NIST, OWASP, and CERT. Contact us today to learn more about Kiuwan security solutions and services and how they can benefit your organization. 

Would you like to know more about implementing secure application development solution in your company? Get in touch with our Kiuwan team! We love to talk about security.