Damn-vulnerable-sca

SCA Goat
SCA Goat
Navigating SCA Vulnerabilities, Empowering Mastery

What is SCA-Goat?

SCAGoat is an application for Software Composition Analysis (SCA) that focuses on vulnerable and compromised JAR dependencies used in development code, providing users with hands-on learning opportunities to understand potential attack scenarios. It is designed to identify vulnerabilities that may arise from using vulnerable JAR files.

⚠️ WARNING: Educational Purpose Only ⚠️

This project contains deliberately vulnerable and malicious code for educational purposes. The xz-java-malicious package included in this project simulates a compromised library and should NEVER be used in production environments. This package is designed solely for training security professionals and for evaluating SCA tools.

Presented at:

What All CVE Covered?

The CVEs covered under SCAGoat are primarily critical and high severity, which have a CVSS score of 9. This aid in understanding the vulnerable package being used and its potential for exploitation.

In addition, there is one compromised package, that lacks a CVE, but is malicious by nature and cannot be detected with traditional SCA scanners.

CVE Package Name Link
CVE-2023-42282 IP https://nvd.nist.gov/vuln/detail/CVE-2023-42282
CVE-2017-1000427 Marked https://nvd.nist.gov/vuln/detail/CVE-2017-1000427
CVE-2017-16114 Marked https://github.com/markedjs/marked/issues/926
CVE-2021-44228 log4j https://nvd.nist.gov/vuln/detail/CVE-2021-44228
CVE-2020-9547 jackson-databind https://nvd.nist.gov/vuln/detail/CVE-2020-9547
CVE-2021-33623 trim-newlines https://nvd.nist.gov/vuln/detail/CVE-2021-33623
CVE-2020-13935 spring-websocket https://nvd.nist.gov/vuln/detail/CVE-2020-13935
CVE-2019-10744 lodash https://nvd.nist.gov/vuln/detail/CVE-2019-10744
CVE-2019-8331 pug https://nvd.nist.gov/vuln/detail/CVE-2019-8331
CVE-2020-8116 dot-prop https://nvd.nist.gov/vuln/detail/CVE-2020-8116
Malicious Package (No CVE) xz-java https://central.sonatype.com/artifact/io.github.xz-java/xz-java

Steps to run SCAGoat

Step 1. Clone the application

git clone https://github.com/harekrishnarai/Damn-vulnerable-sca.git

Step 2. Go to the Directory

cd Damn-vulnerable-sca

Step 3. Use the following docker commands to build the image for the dockerfile and run the image to access the application:

docker compose up

Step 4. Visit http://localhost:3000/ to access the nodejs application and http://localhost:8080 for Springboot for log4j

Compiling and Installing the Malicious XZ-Java Package Locally

To ensure SCAGoat functions correctly for training and SCA tool evaluations, you’ll need to compile and install the xz-java-malicious package locally:

  1. Navigate to the xz-java-malicious directory:
    cd xz-java-malicious
    
  2. Compile and install the package to your local Maven repository:
    mvn clean install
    
  3. Verify the installation:
    mvn dependency:tree
    
  4. After successful installation, add the malicious package to your .m2 repo by running following command
    mvn install:install-file \
      -Dfile=target/xz-java-1.9.2.jar \
      -DgroupId=org.tukaani \
      -DartifactId=xz \
      -Dversion=1.9.2-malicious \
      -Dpackaging=jar
    
  5. Return to the main project directory:
    cd ..
    
  6. Now you can run the full application with docker compose as mentioned above.

Important Notes:

SCA Goat HomePage

SCAGoat HomePage

Vulnerability Dashboard

SCAGoat features an interactive vulnerability dashboard that allows users to explore and understand different types of vulnerabilities:

Each vulnerability includes an interactive demo to help security professionals, developers, and students understand how these vulnerabilities work and how they can be exploited.

What’s Coming?

Our aim is to provide you with a better understanding of vulnerable packages and JAR dependencies so that you can gain hands-on experience. We will keep you updated with the latest CVEs. Stay tuned!

Tutorials to exploit the vulnerability:

Demo Videos CVE Exploited
Demo 1 CVE-2023-42282
Demo 2 CVE-2017-16114
Demo 3 CVE-2021-44228
Demo 4 CVE-2020-9547
Demo 5 XZ-JAVA compromised
Demo 6 CVE-2019-10744 (Lodash)
Demo 8 CVE-2019-8331 (Pug)
Demo 9 CVE-2020-8116 (Dot-Prop)

SCA Scan Reports

UI Enhancements

The SCAGoat application features a modern, responsive UI with the following features:

Want to contribute?

Fork this project Start contributing
Awesome! The most basic way to show your support is to star the project or raise issues.

Contributors

Thanks to all the people who already contributed!
Prashant Venkatesh
Nandan Gupta
Hare Krishna Rai
Henrik Plate
Gaurav Joshi
Yoad Fekete