CVE-2020-5245: Remote Code Execution (RCE) vulnerability in dropwizard-validation

Summary

24/02/2020
Yes i
High
7.9

CVE-2020-5245: Remote Code Execution (RCE) vulnerability in dropwizard-validation. Affects io.dropwizard:dropwizard-validation across 2 version ranges.

>= 1.3.0-rc1, < 1.3.19 >= 2.0.0, < 2.0.2

Fixed in 1.3.19 or 2.0.2, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The package under scrutiny is dropwizard-validation, which is a library used for validation in Dropwizard applications. It provides features for validating objects and fields based on various constraints. The vulnerability affects versions before 1.3.19 and 2.0.2 of the package. The package is vulnerable to a server-side template injection in the self-validating feature, allowing attackers to inject arbitrary Java EL expressions and potentially execute remote code.

Vulnerability Detail

A server-side template injection vulnerability was discovered in the self-validating feature of dropwizard-validation. This feature, denoted by the @SelfValidating annotation, allows the injection of arbitrary Java EL expressions. Attackers can exploit this vulnerability to execute remote code on the host system with the privileges of the Dropwizard service account. The impact of this vulnerability is significant, as it allows unauthorized execution of arbitrary code on the affected system.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 1.3.0-rc1, < 1.3.19 1.3.19
  • >= 2.0.0, < 2.0.2 2.0.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If upgrading to the fixed versions is not feasible, but the @SelfValidating feature is still required, it is crucial to properly sanitize any message added to the ViolationCollector in the method annotated with @SelfValidation. The following code snippet demonstrates an example of sanitizing the fullName variable:

@SelfValidation public void validateFullName(ViolationCollector col) {

    if (fullName.contains("_")) {
        // Sanitize fullName variable by escaping relevant characters such as "$"
        col.addViolation("Full name contains invalid characters:  " + sanitizeJavaEl(fullName));
    }
}

Conclusion

In conclusion, the dropwizard-validation package is vulnerable to a remote code execution vulnerability in the self-validating feature. Upgrading to version 1.3.19 or 2.0.2 of the package is strongly recommended to mitigate this vulnerability. If upgrading is not possible, proper sanitization of messages added to the ViolationCollector can serve as a workaround. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for io.dropwizard:dropwizard-validation →

Share this vulnerability

FAQ

dropwizard-validation is a library used for validation in Dropwizard applications. It provides features for validating objects and fields based on various constraints.

Versions before 1.3.19 and 2.0.2 of dropwizard-validation are affected by this vulnerability.

This vulnerability allows remote code execution on the host system with the privileges of the Dropwizard service account, potentially leading to unauthorized execution of arbitrary code.

To fix this vulnerability, it is recommended to upgrade to either version 1.3.19 or 2.0.2 of dropwizard-validation, as these versions contain the necessary patches to mitigate the vulnerability.

If upgrading to the fixed versions is not feasible, but the @SelfValidating feature is still required, it is important to properly sanitize any message added to the ViolationCollector in the method annotated with @SelfValidation. See the 'workaround' section for an example.

Related vulnerabilities

Recent vulnerabilities recorded for io.dropwizard:dropwizard-validation.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 1.3.0-rc1, < 1.3.19 1.3.19
  • >= 2.0.0, < 2.0.2 2.0.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback