CVE-2021-44549: Improper Certificate Validation and Improper Validation of Certificate with Host Mismatch in Apache Sling Commons Messaging Mail

Summary

16/12/2021
Yes i
High
7.4

CVE-2021-44549: Apache Sling Commons Messaging Mail provides a simple layer on top of JavaMail/Jakarta Mail for OSGi to send mails via SMTPS. Affects org.apache.sling:org.apache.sling.commons.messaging.mail versions < 2.0. Fixed in 2.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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Apache Sling Commons Messaging Mail is a library that provides a simple layer on top of JavaMail/Jakarta Mail for OSGi to send mails via SMTPS. It is commonly used in Java applications for email functionality. However, this library is vulnerable to improper certificate validation and improper validation of certificates with host mismatch.

Vulnerability Detail

The vulnerability arises from the fact that additional server identity checks are disabled by default in JavaMail/Jakarta Mail for compatibility reasons. The SimpleMailService in Apache Sling Commons Messaging Mail 1.0 lacks an option to enable these checks for the shared mail session. This allows an attacker to perform a "man in the middle" attack by intercepting and modifying the communication between the mail server and the application. Apache Sling Commons Messaging Mail 2.0 adds support for enabling server identity checks, which are enabled by default.

How To Fix

Minimum fixed version

2.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 version 2.0 is not feasible, users can manually enable server identity checks by accessing the session via the message created by SimpleMessageBuilder and setting the property 'mail.smtps.ssl.checkserveridentity' to true. However, this workaround is not recommended as it may introduce other security risks.

Conclusion

In conclusion, the Apache Sling Commons Messaging Mail library is vulnerable to improper certificate validation and improper validation of certificates with host mismatch. Users should upgrade to version 2.0 or later to fix this vulnerability. If upgrading is not feasible, users can manually enable server identity checks, but this is not recommended. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.apache.sling:org.apache.sling.commons.messaging.mail →

Share this vulnerability

FAQ

Apache Sling Commons Messaging Mail is a library that provides a simple layer on top of JavaMail/Jakarta Mail for OSGi to send mails via SMTPS.

This vulnerability allows an attacker to perform a "man in the middle" attack by intercepting and modifying the communication between the mail server and the application.

To fix this vulnerability, users should upgrade to Apache Sling Commons Messaging Mail 2.0 or later, where server identity checks are enabled by default.

A workaround is to manually enable server identity checks by setting the property 'mail.smtps.ssl.checkserveridentity' to true. However, this workaround is not recommended.

More information about this vulnerability can be found in the Apache Sling Commons Messaging Mail documentation and the JavaMail/Jakarta Mail documentation.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.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