Kali Linux

Dependency Check : Detects Publicly Disclosed Vulnerabilities In Application Dependencies

Dependency-Check is a Software Composition Analysis (SCA) tool that attempts to detect publicly disclosed vulnerabilities contained within a project’s dependencies. It does this by determining if there is a Common Platform Enumeration (CPE) identifier for a given dependency. If found, it will generate a report linking to the associated CVE entries.

Documentation and links to production binary releases can be found on the github pages. Additionally, more information about the architecture and ways to extend dependency-check can be found on the wiki.

7.0.0 Upgrade Notice

If upgrading to 7.0.0 or higher, there were breaking changes. If you get an error indicating you can’t connect to the database you will need to run the purge command to remove the old database:

  • gradle: ./gradlew dependencyCheckPurge
  • maven: mvn org.owasp:dependency-check-maven:7.0.0:purge
  • cli: dependency-check.sh --purge

Homebrew users upgrading to dependency-check 7.0.0 will need to purge their old database.

Current Releases

Jenkins Plugin

For instructions on the use of the Jenkins plugin please see the OWASP Dependency-Check Plugin page.

Command Line

More detailed instructions can be found on the dependency-check github pages. The latest CLI can be downloaded from github in the releases section.

On *nix

$ ./bin/dependency-check.sh -h
$ ./bin/dependency-check.sh –out . –scan [path to jar files to be scanned]

On Windows

.\bin\dependency-check.bat -h
.\bin\dependency-check.bat –out . –scan [path to jar files to be scanned]

On Mac with Homebrew Note – homebrew users upgrading from 5.x to 6.0.0 will need to run dependency-check.sh --purge.

$ brew update && brew install dependency-check
$ dependency-check -h
$ dependency-check –out . –scan [path to jar files to be scanned]

Maven Plugin

More detailed instructions can be found on the dependency-check-maven github pages. By default, the plugin is tied to the verify phase (i.e. mvn verify). Alternatively, one can directly invoke the plugin via mvn org.owasp:dependency-check-maven:check.

The dependency-check plugin can be configured using the following:

… org.owasp dependency-check-maven check … … …

Ant Task

For instructions on the use of the Ant Task, please see the dependency-check-ant github page.

Development Prerequisites

For installation to pass, you must have the following components installed:

  • Java: java -version 1.8
  • Maven: mvn -version 3.5.0 and higher

Tests cases require:

  • dotnet core version 6.0
  • Go: go version 1.12 and higher
  • Ruby bundler-audit
  • Yarn
  • pnpm

Development Usage

The following instructions outline how to compile and use the current snapshot. While every intention is to maintain a stable snapshot it is recommended that the release versions listed above be used.

The repository has some large files due to test resources. The team has tried to clean up the history as much as possible. However, it is recommended that you perform a shallow clone to save yourself time:

git clone –depth 1 https://github.com/jeremylong/DependencyCheck.git

On *nix

$ mvn -s settings.xml install
$ ./cli/target/release/bin/dependency-check.sh -h
$ ./cli/target/release/bin/dependency-check.sh –out . –scan ./src/test/resources

On Windows

mvn -s settings.xml install
.\cli\target\release\bin\dependency-check.bat -h
.\cli\target\release\bin\dependency-check.bat –out . –scan ./src/test/resources

Then load the resulting ‘dependency-check-report.html’ into your favorite browser.

Docker

In the following example it is assumed that the source to be checked is in the current working directory and the reports will be written to $(pwd)/odc-reports. Persistent data and cache directories are used, allowing you to destroy the container after running.

For Linux:

!/bin/sh

DC_VERSION=”latest”
DC_DIRECTORY=$HOME/OWASP-Dependency-Check
DC_PROJECT=”dependency-check scan: $(pwd)”
DATA_DIRECTORY=”$DC_DIRECTORY/data”
CACHE_DIRECTORY=”$DC_DIRECTORY/data/cache”
if [ ! -d “$DATA_DIRECTORY” ]; then
echo “Initially creating persistent directory: $DATA_DIRECTORY”
mkdir -p “$DATA_DIRECTORY”
fi
if [ ! -d “$CACHE_DIRECTORY” ]; then
echo “Initially creating persistent directory: $CACHE_DIRECTORY”
mkdir -p “$CACHE_DIRECTORY”
fi

Make sure we are using the latest version

docker pull owasp/dependency-check:$DC_VERSION
docker run –rm \
-e user=$USER \
-u $(id -u ${USER}):$(id -g ${USER}) \
–volume $(pwd):/src:z \
–volume “$DATA_DIRECTORY”:/usr/share/dependency-check/data:z \
–volume $(pwd)/odc-reports:/report:z \
owasp/dependency-check:$DC_VERSION \
–scan /src \
–format “ALL” \
–project “$DC_PROJECT” \
–out /report
# Use suppression like this: (where /src == $pwd)
# –suppression “/src/security/dependency-check-suppression.xml”

R K

Recent Posts

Bomber : Navigating Security Vulnerabilities In SBOMs

bomber is an application that scans SBOMs for security vulnerabilities. So you've asked a vendor…

8 hours ago

EmbedPayloadInPng : A Guide To Embedding And Extracting Encrypted Payloads In PNG Files

Embed a payload within a PNG file by splitting the payload across multiple IDAT sections.…

9 hours ago

Exploit Street – Navigating The New Terrain Of Windows LPEs

Exploit-Street, where we dive into the ever-evolving world of cybersecurity with a focus on Local…

2 days ago

ShadowDumper – Advanced Techniques For LSASS Memory Extraction

Shadow Dumper is a powerful tool used to dump LSASS (Local Security Authority Subsystem Service)…

3 days ago

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

2 weeks ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

3 weeks ago