CVE-2017-9801: Improper Input Validation in Apache Commons Email

Summary

17/05/2022
Yes i
High
7.5

CVE-2017-9801: Improper Input Validation in Apache Commons Email. Affects org.apache.commons:commons-email versions >= 1.0, < 1.5. Fixed in 1.5. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Apache Commons Email is a library that provides a simple API for sending email messages. It is commonly used in Java applications to handle email functionality. This vulnerability affects versions 1.0 through 1.4 of the Apache Commons Email library. The library allows users to specify the subject of an email, but when line-breaks are included in the subject, it fails to properly validate the input. This can lead to the addition of arbitrary SMTP headers by an attacker.

Vulnerability Detail

The vulnerability arises from the improper input validation in the Apache Commons Email library. When a subject with line-breaks is passed to the library, it does not correctly validate the input. As a result, an attacker can exploit this vulnerability to add arbitrary SMTP headers to an email. This could potentially lead to various security issues, such as spoofing, phishing, or injection attacks.

How To Fix

Minimum fixed version

1.5

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 a fixed version is not immediately feasible, a temporary workaround is to sanitize the subject input before passing it to the Apache Commons Email library. This can be done by removing any line-break characters from the subject string. Here is an example in Java:

String sanitizedSubject = subject.replace("\n", "").replace("\r", "");

Conclusion

The vulnerability in Apache Commons Email 1.0 through 1.4 allows for improper input validation, enabling the addition of arbitrary SMTP headers. To mitigate this vulnerability, it is crucial to upgrade to version 1.5 or later of the Apache Commons Email library. If immediate upgrading is not possible, a temporary workaround is available by sanitizing the subject input. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.apache.commons:commons-email →

Share this vulnerability

FAQ

Apache Commons Email is a Java library that provides an API for sending email messages. It is widely used in Java applications for email functionality.

Versions 1.0 through 1.4 of the Apache Commons Email library are affected by this vulnerability.

This vulnerability allows an attacker to add arbitrary SMTP headers to an email, potentially leading to security issues such as spoofing, phishing, or injection attacks.

To fix this vulnerability, it is recommended to upgrade to version 1.5 or later of the Apache Commons Email library.

A temporary workaround is to sanitize the subject input by removing any line-break characters before passing it to the Apache Commons Email library.

Related vulnerabilities

Recent vulnerabilities recorded for org.apache.commons:commons-email.

How To Fix

Minimum fixed version

1.5

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