CVE-2023-51518: Apache James server Privilege Escalation Vulnerability

CRITICAL
Advisory Identifier: GHSA-px7w-c9gw-7gj3
CVSS 9.8
CWE-502
Published
Advisory Summary

CVE-2023-51518 is a CRITICAL (CVSS 9.8) privilege escalation vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Apache James server libraries in the Maven ecosystem. The issue involves privilege escalation via jmx pre-authentication deserialization. Remediation is available by upgrading affected packages to version 3.7.5, 3.8.1.

CVE-2023-51518 at a Glance

CVE Identifier CVE-2023-51518
GHSA Identifier GHSA-px7w-c9gw-7gj3
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Apache James server
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-51518

To remediate this vulnerability, upgrade all affected Apache James server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.james:james-server fixed: 3.7.5
<dependency>
    <groupId>org.apache.james</groupId>
    <artifactId>james-server</artifactId>
    <version>3.7.5</version>
</dependency>
org.apache.james:james-server fixed: 3.8.1
<dependency>
    <groupId>org.apache.james</groupId>
    <artifactId>james-server</artifactId>
    <version>3.8.1</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.apache.james

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-51518, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.james

Analyze the terminal output to locate any version of Apache James server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.7.5), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.james command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Apache James server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Apache James prior to version 3.7.5 and 3.8.0 exposes a JMX endpoint on localhost subject to pre-authentication deserialisation of untrusted data. Given a deserialisation gadjet, this could be leveraged as part of an exploit chain that could result in privilege escalation. Note that by default JMX endpoint is only bound locally. We recommend users to:  - Upgrade to a non-vulnerable Apache James version  - Run Apache James isolated from other processes (docker - dedicated virtual machine)  - If possible turn off JMX

CVE-2023-51518 Affected Apache James server Versions

2 component(s)
Fixed Versions:
3.7.53.8.1
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.james:james-server
Maven
< 3.7.5
3.7.5
org.apache.james:james-server
Maven
≥ 3.8.0
< 3.8.1
3.8.1

References

Frequently Asked Questions

What is CVE-2023-51518?
CVE-2023-51518 is a security vulnerability in Apache James server involving Privilege escalation via JMX pre-authentication deserialization under CWE-502: Deserialization of Untrusted Data.
Which Apache James server versions are affected?
Affected versions include releases prior to 3.7.5, 3.8.1 across affected packages: org.apache.james:james-server.
What version fixes CVE-2023-51518?
Upgrading to 3.7.5, 3.8.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is james-server affected?
Yes, org.apache.james:james-server is affected in releases prior to 3.7.5, 3.8.1. Upgrade your dependency to 3.7.5, 3.8.1 or later.
What is the CVSS score of CVE-2023-51518?
CVE-2023-51518 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-51518?
CVE-2023-51518 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check Maven dependencies for CVE-2023-51518?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.james'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-px7w-c9gw-7gj3",
  "modified" : "2024-08-23T13:43:46Z",
  "published" : "2024-02-27T09:31:16Z",
  "aliases" : [ "CVE-2023-51518" ],
  "summary" : "Apache James server: Privilege escalation via JMX pre-authentication deserialization",
  "details" : "Apache James prior to version 3.7.5 and 3.8.0 exposes a JMX endpoint on localhost subject to pre-authentication deserialisation of untrusted data.\nGiven a deserialisation gadjet, this could be leveraged as part of an exploit chain that could result in privilege escalation.\nNote that by default JMX endpoint is only bound locally.\n\nWe recommend users to:\n - Upgrade to a non-vulnerable Apache James version\n\n - Run Apache James isolated from other processes (docker - dedicated virtual machine)\n - If possible turn off JMX\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.james:james-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.7.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.7.4"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.james:james-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.8.0"
      }, {
        "fixed" : "3.8.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-51518"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/wbdm61ch6l0kzjn6nnfmyqlng82qz0or"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-27T23:00:04Z",
    "nvd_published_at" : "2024-02-27T09:15:36Z"
  }
}