CVE-2021-38542: Command Injection in Apache James

Summary

08/01/2022
Yes i
Moderate
5.9

CVE-2021-38542: Command Injection in Apache James. Affects org.apache.james:james-server versions < 3.6.1. Fixed in 3.6.1. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Apache James is a popular open-source email server that provides a platform for sending, receiving, and managing email messages. It is widely used in various applications and environments. However, versions prior to release 3.6.1 are vulnerable to a command injection attack when using the STARTTLS command. This vulnerability can be exploited by an attacker to perform man-in-the-middle attacks and potentially leak sensitive information.

Vulnerability Detail

The vulnerability in Apache James arises from a buffering attack that takes advantage of the STARTTLS command. By manipulating the command, an attacker can inject arbitrary commands into the server, leading to various security risks. This can result in the leakage of sensitive information, potentially compromising the confidentiality and integrity of the email server. The vulnerability has a CVSS score of 5.9, indicating a moderate severity level.

How To Fix

Latest published version: 3.9.1 as of 22 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.6.1

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 latest version is not immediately feasible, a temporary workaround is to disable the STARTTLS command in the Apache James configuration. By disabling this command, the vulnerability can be mitigated until a proper upgrade can be performed. Here is an example of how to disable the STARTTLS command in the configuration file:

<smtpserver>
  <starttls>false</starttls>
</smtpserver>

Conclusion

In conclusion, Apache James prior to version 3.6.1 is vulnerable to a command injection attack when using the STARTTLS command. This can lead to man-in-the-middle attacks and potential leakage of sensitive information. It is crucial to upgrade to the latest version or apply the provided workaround to mitigate the vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.apache.james:james-server →

Share this vulnerability

FAQ

Apache James is an open-source email server that provides email functionality for various applications and environments.

This vulnerability can lead to man-in-the-middle command injection attacks, potentially resulting in the leakage of sensitive information.

The CVSS score of this vulnerability is 5.9, indicating a moderate severity level.

To fix this vulnerability, it is recommended to upgrade to Apache James version 3.6.1 or later.

Yes, a temporary workaround is to disable the STARTTLS command in the Apache James configuration.

Related vulnerabilities

Recent vulnerabilities recorded for org.apache.james:james-server.

How To Fix

Latest published version: 3.9.1 as of 22 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.6.1

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