Skip to content

Remote code execution in Apache Jackrabbit

Critical severity GitHub Reviewed Published Jul 25, 2023 to the GitHub Advisory Database • Updated Nov 5, 2023

Package

maven org.apache.jackrabbit:jackrabbit-standalone (Maven)

Affected versions

>= 2.21.0, < 2.21.18
>= 1.0.0, < 2.20.11

Patched versions

2.21.18
2.20.11
maven org.apache.jackrabbit:jackrabbit-standalone-components (Maven)
>= 2.21.0, < 2.21.18
>= 1.0.0, < 2.20.11
2.21.18
2.20.11
maven org.apache.jackrabbit:jackrabbit-webapp (Maven)
>= 2.21.0, < 2.21.18
>= 1.0.0, < 2.20.11
2.21.18
2.20.11

Description

Java object deserialization issue in Jackrabbit webapp/standalone on all platforms allows attacker to remotely execute code via RMIVersions up to (including) 2.20.10 (stable branch) and 2.21.17 (unstable branch) use the component "commons-beanutils", which contains a class that can be used for remote code execution over RMI.

Users are advised to immediately update to versions 2.20.11 or 2.21.18. Note that earlier stable branches (1.0.x .. 2.18.x) have been EOLd already and do not receive updates anymore.

In general, RMI support can expose vulnerabilities by the mere presence of an exploitable class on the classpath. Even if Jackrabbit itself does not contain any code known to be exploitable anymore, adding other components to your server can expose the same type of problem. We therefore recommend to disable RMI access altogether (see further below), and will discuss deprecating RMI support in future Jackrabbit releases.

How to check whether RMI support is enabledRMI support can be over an RMI-specific TCP port, and over an HTTP binding. Both are by default enabled in Jackrabbit webapp/standalone.

The native RMI protocol by default uses port 1099. To check whether it is enabled, tools like "netstat" can be used to check.

RMI-over-HTTP in Jackrabbit by default uses the path "/rmi". So when running standalone on port 8080, check whether an HTTP GET request on localhost:8080/rmi returns 404 (not enabled) or 200 (enabled). Note that the HTTP path may be different when the webapp is deployed in a container as non-root context, in which case the prefix is under the user's control.

Turning off RMIFind web.xml (either in JAR/WAR file or in unpacked web application folder), and remove the declaration and the mapping definition for the RemoteBindingServlet:

       
            RMI
            org.apache.jackrabbit.servlet.remote.RemoteBindingServlet
       

       
            RMI
            /rmi
       

Find the bootstrap.properties file (in $REPOSITORY_HOME), and set

        rmi.enabled=false

    and also remove

        rmi.host
        rmi.port
        rmi.url-pattern

 If there is no file named bootstrap.properties in $REPOSITORY_HOME, it is located somewhere in the classpath. In this case, place a copy in $REPOSITORY_HOME and modify it as explained.

 

References

Published by the National Vulnerability Database Jul 25, 2023
Published to the GitHub Advisory Database Jul 25, 2023
Reviewed Jul 25, 2023
Last updated Nov 5, 2023

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS score

2.797%
(91st percentile)

Weaknesses

CVE ID

CVE-2023-37895

GHSA ID

GHSA-q8cm-3v62-jj79

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.