CVE-2021-31409: Regular expression Denial of Service (ReDoS) in Vaadin 8 EmailValidator

Summary

04/05/2021
Yes i
High
7.5

CVE-2021-31409: Unsafe validation RegEx in EmailValidator component in com.vaadin:vaadin-compatibility-server versions 8.0.0 through 8.12.4 (Vaadin versions 8.0.0 through 8.12.4) allows attackers to cause uncontrolled resource consumpti... Affects com.vaadin:vaadin-compatibility-server versions >= 8.0.0, < 8.13.0. Fixed in 8.13.0. 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

Vaadin is an open-source Java framework used for building modern web applications. The com.vaadin:vaadin-compatibility-server package is a compatibility module in Vaadin 8 that provides support for older versions. The EmailValidator class in this module is responsible for validating email addresses. However, versions 8.0.0 through 8.12.4 of this package contain an unsafe validation regular expression (RegEx) that can be exploited by attackers to cause uncontrolled resource consumption by submitting malicious email addresses.

Vulnerability Detail

The vulnerability in the EmailValidator class allows for a Regular expression Denial of Service (ReDoS) attack. By submitting specially crafted email addresses, an attacker can trigger a ReDoS scenario where the regular expression used for validation takes an excessive amount of time to process. This can lead to a denial of service condition, causing high CPU usage and potentially impacting the availability of the application. The severity of this vulnerability is rated as HIGH with a CVSS score of 7.5.

How To Fix

Minimum fixed version

8.13.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the fixed version is not immediately possible, a temporary workaround can be implemented by manually validating email addresses using a different, safe regular expression or a dedicated email validation library. Here is an example of how to use the Apache Commons Validator library for email validation:

import org.apache.commons.validator.routines.EmailValidator;

public class EmailValidationExample {

    public static void main(String[] args) {
        String email = "test@example.com";
        boolean isValid = EmailValidator.getInstance().isValid(email);
        System.out.println("Is email valid? " + isValid);
    }
}

Conclusion

The com.vaadin:vaadin-compatibility-server package in Vaadin 8 is vulnerable to a Regular expression Denial of Service (ReDoS) attack in the EmailValidator class. Upgrading to version 8.13.0 or later is recommended to fix this vulnerability. If immediate upgrade is not possible, implementing a temporary workaround by using a different email validation approach can help mitigate the risk. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for com.vaadin:vaadin-compatibility-server →

Share this vulnerability

FAQ

The vulnerability allows attackers to cause uncontrolled resource consumption by submitting malicious email addresses. This can lead to a denial of service condition, impacting the availability of the application.

Versions 8.0.0 through 8.12.4 of the com.vaadin:vaadin-compatibility-server package are affected.

Yes, upgrading to version 8.13.0 or later of the com.vaadin:vaadin-compatibility-server package includes a fix for this vulnerability.

Yes, a temporary workaround can be implemented by manually validating email addresses using a different, safe regular expression or a dedicated email validation library.

The severity of this vulnerability is rated as HIGH with a CVSS score of 7.5.

How To Fix

Minimum fixed version

8.13.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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