Vulnerabilities in pkg:maven/org.apache.sling/org.apache.sling.jcr.base

PACKAGE
Advisory Identifier: GHSA-gvg3-83q4-rfhq
Advisory Summary

CVE-2023-25141 is a HIGH (CVSS 7.5) command injection vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Org.apache.sling.jcr.base libraries in the Maven ecosystem. The issue involves command injection in apache sling. Remediation is available by upgrading affected packages to version 3.1.12.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.apache.sling/org.apache.sling.jcr.base

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.apache.sling/org.apache.sling.jcr.base. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-gvg3-83q4-rfhq CVE-2023-25141 HIGH Command injection in Apache Sling

CVE-2023-25141 at a Glance

CVE Identifier CVE-2023-25141
GHSA Identifier GHSA-gvg3-83q4-rfhq
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Org.apache.sling.jcr.base
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N/A:N).

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 None (I:N)
Availability None (A:N)

How to Fix CVE-2023-25141

To remediate this vulnerability, upgrade all affected Org.apache.sling.jcr.base 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.sling:org.apache.sling.jcr.base fixed: 3.1.12
<dependency>
    <groupId>org.apache.sling</groupId>
    <artifactId>org.apache.sling.jcr.base</artifactId>
    <version>3.1.12</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.sling

How to Check if You Are Affected

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

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

Analyze the terminal output to locate any version of Org.apache.sling.jcr.base in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.12), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.sling 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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Org.apache.sling.jcr.base, 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 Sling JCR Base < 3.1.12 has a critical injection vulnerability when running on old JDK versions (JDK 1.8.191 or earlier) through utility functions in RepositoryAccessor. The functions getRepository and getRepositoryFromURL allow an application to access data stored in a remote location via JDNI and RMI. Users of Apache Sling JCR Base are recommended to upgrade to Apache Sling JCR Base 3.1.12 or later, or to run on a more recent JDK.

CVE-2023-25141 Affected Org.apache.sling.jcr.base Versions

1 component(s)
Fixed Versions:
3.1.12
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.sling:org.apache.sling.jcr.base
Maven
< 3.1.12
3.1.12

References

Frequently Asked Questions

What is CVE-2023-25141?
CVE-2023-25141 is a security vulnerability in Org.apache.sling.jcr.base involving Command injection in Apache Sling under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Org.apache.sling.jcr.base versions are affected?
Affected versions include releases prior to 3.1.12 across affected packages: org.apache.sling:org.apache.sling.jcr.base.
What version fixes CVE-2023-25141?
Upgrading to 3.1.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is org.apache.sling.jcr.base affected?
Yes, org.apache.sling:org.apache.sling.jcr.base is affected in releases prior to 3.1.12. Upgrade your dependency to 3.1.12 or later.
What is the CVSS score of CVE-2023-25141?
CVE-2023-25141 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2023-25141?
CVE-2023-25141 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check Maven dependencies for CVE-2023-25141?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.sling'. 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-gvg3-83q4-rfhq",
  "modified" : "2023-02-22T22:17:59Z",
  "published" : "2023-02-14T15:30:28Z",
  "aliases" : [ "CVE-2023-25141" ],
  "summary" : "Command injection in Apache Sling",
  "details" : "Apache Sling JCR Base < 3.1.12 has a critical injection vulnerability when running on old JDK versions (JDK 1.8.191 or earlier) through utility functions in RepositoryAccessor. The functions getRepository and getRepositoryFromURL allow an application to access data stored in a remote location via JDNI and RMI. Users of Apache Sling JCR Base are recommended to upgrade to Apache Sling JCR Base 3.1.12 or later, or to run on a more recent JDK.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.sling:org.apache.sling.jcr.base"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.12"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-25141"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/sling-org-apache-sling-jcr-base/commit/6ed0a030fd5f13774aff0073c55cbe3ace0153cb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/sling-org-apache-sling-jcr-base/commit/779d8a7dd0437a4f31de02c0d995afcf83b9904b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/sling-org-apache-sling-jcr-base"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/SLING-11770"
  }, {
    "type" : "WEB",
    "url" : "https://sling.apache.org/news.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-14T21:24:47Z",
    "nvd_published_at" : "2023-02-14T13:15:00Z"
  }
}