JamesApplication · Apache

CVE-2021-40525

CRITICAL · 9.1 CVSS v3.1 Published 2022-01-04
Fix available
A fix is available. Upgrade to 3.6.2 or later.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Apache James ManagedSieve implementation alongside with the file storage for sieve scripts is vulnerable to path traversal, allowing reading and writing any file. This vulnerability had been patched in Apache James 3.6.1 and higher. We recommend the upgrade. Distributed and Cassandra based products are also not impacted.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Apache James ManagedSieve implementation is vulnerable to path traversal when handling sieve script file storage, allowing authenticated or potentially unauthenticated attackers to read and write arbitrary files on the server filesystem. This is a critical server-side file inclusion vulnerability.

MitigationUpgrade to Apache James 3.6.1 or later. Verify the deployment uses the file-based storage variant (not Distributed or Cassandra-based which are unaffected).

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
JamesApplication
Affected:< 3.6.2

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify Apache James installation and version
    Check the installed Apache James version by examining the James startup logs, running 'java -jar apache-james-*.jar --version' if available, or checking the distribution directory name. Compare the version number against the affected range (anything below 3.6.2).
    Affected if The installed version is Apache James and the version is less than 3.6.2
  2. Confirm ManagedSieve protocol is enabled
    Review the James configuration files (typically spring.xml or bean definition files in the conf/ directory) and look for the ManagedSieve bean or protocol configuration. Also check if port 4190 (default ManagedSieve port) is listening.
    Affected if ManagedSieve is enabled and listening on the server, making the vulnerable sieve script handling code active
  3. Verify file-based sieve storage is in use
    Examine the James configuration for the sieve repository configuration. Look for 'FileSieveRepository' or 'filesystem' type storage in the sieve configuration section. Check if the deployment uses file-based storage rather than 'Distributed' or 'Cassandra' implementations.
    Affected if The sieve storage is configured as file-based (FileSieveRepository or similar filesystem path configuration), meaning the vulnerable file I/O code path is active

You are affected if running Apache James version 3.6.1 or earlier with ManagedSieve enabled and using file-based sieve storage, as this combination exposes the vulnerable path traversal code in the sieve script handler.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 3.6.2 or later
Fixed in 3.6.2
Interim mitigation

Upgrade to Apache James 3.6.1 or later. Verify the deployment uses the file-based storage variant (not Distributed or Cassandra-based which are unaffected).

Recommended fix High confidence

Apache James 3.6.2 or later

  1. 1. Identify the current Apache James version running in your environment.
  2. 2. Back up all existing configuration files, sieve scripts, and data directories.
  3. 3. Download Apache James 3.6.2 (or the latest stable release) from the official Apache James distribution repository.
  4. 4. Stop the Apache James service.
  5. 5. Replace the existing Apache James installation files with the new version, preserving configuration files if upgrading within the same minor version.
  6. 6. Start the Apache James service.
  7. 7. Verify the ManagedSieve service is functioning correctly and that sieve scripts can be managed without path traversal issues.
  8. 8. Confirm the version upgrade was successful by checking the server version.

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in James Scoped from the published advisory
  • Consultation2.0 h
  • Implementation1.0 h
  • Testing4.0 h
  • Review / QA2.0 h
9.0 hours of engineering $1,540
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,464.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2021-40525 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2021-40525 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data