CVE-2021-38542: Command Injection in Apache James
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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 →
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.