CVE-2023-4759: Org.eclipse.jgit Arbitrary File Overwrite Vulnerability

HIGH
Advisory Identifier: GHSA-3p86-9955-h393
CVSS 8.8
CWE-178
Published
Advisory Summary

CVE-2023-4759 is a HIGH (CVSS 8.8) arbitrary file overwrite vulnerability (CWE-178: Improper Handling of Case Sensitivity) affecting Org.eclipse.jgit libraries in the Maven ecosystem. The issue involves arbitrary file overwrite in eclipse jgit. Remediation is available by upgrading affected packages to version 6.6.1.202309021850-r, 5.13.3.202401111512-r.

CVE-2023-4759 at a Glance

CVE Identifier CVE-2023-4759
GHSA Identifier GHSA-3p86-9955-h393
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-178: Improper Handling of Case Sensitivity
Affected Product Org.eclipse.jgit
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.8

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
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-4759

To remediate this vulnerability, upgrade all affected Org.eclipse.jgit 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.eclipse.jgit:org.eclipse.jgit fixed: 6.6.1.202309021850-r
<dependency>
    <groupId>org.eclipse.jgit</groupId>
    <artifactId>org.eclipse.jgit</artifactId>
    <version>6.6.1.202309021850-r</version>
</dependency>
org.eclipse.jgit:org.eclipse.jgit fixed: 5.13.3.202401111512-r
<dependency>
    <groupId>org.eclipse.jgit</groupId>
    <artifactId>org.eclipse.jgit</artifactId>
    <version>5.13.3.202401111512-r</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.eclipse.jgit

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.eclipse.jgit

Analyze the terminal output to locate any version of Org.eclipse.jgit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.6.1.202309021850-r), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.eclipse.jgit 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-178: Improper Handling of Case Sensitivity, where the product does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results. In Org.eclipse.jgit, 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

Arbitrary File Overwrite in Eclipse JGit <= 6.6.0 In Eclipse JGit, all versions <= 6.6.0.202305301015-r, a symbolic link present in a specially crafted git repository can be used to write a file to locations outside the working tree when this repository is cloned with JGit to a case-insensitive filesystem, or when a checkout from a clone of such a repository is performed on a case-insensitive filesystem. This can happen on checkout (DirCacheCheckout), merge (ResolveMerger via its WorkingTreeUpdater), pull (PullCommand using merge), and when applying a patch (PatchApplier). This can be exploited for remote code execution (RCE), for instance if the file written outside the working tree is a git filter that gets executed on a subsequent git command. The issue occurs only on case-insensitive filesystems, like the default filesystems on Windows and macOS. The user performing the clone or checkout must have the rights to create symbolic links for the problem to occur, and symbolic links must be enabled in the git configuration. Setting git configuration option core.symlinks = false before checking out avoids the problem. The issue was fixed in Eclipse JGit version 6.6.1.202309021850-r and 6.7.0.202309050840-r, available via Maven Central https://repo1.maven.org/maven2/org/eclipse/jgit/  and repo.eclipse.org https://repo.eclipse.org/content/repositories/jgit-releases/ . A backport is available in 5.13.3 starting from 5.13.3.202401111512-r. The JGit maintainers would like to thank RyotaK for finding and reporting this issue.

CVE-2023-4759 Affected Org.eclipse.jgit Versions

2 component(s)
Fixed Versions:
6.6.1.202309021850-r5.13.3.202401111512-r
Product / Package Ecosystem Affected Versions Fixed Version
org.eclipse.jgit:org.eclipse.jgit
Maven
≥ 6.0.0.202111291000-r
< 6.6.1.202309021850-r
6.6.1.202309021850-r
org.eclipse.jgit:org.eclipse.jgit
Maven
< 5.13.3.202401111512-r
5.13.3.202401111512-r

References

Frequently Asked Questions

What is CVE-2023-4759?
CVE-2023-4759 is a security vulnerability in Org.eclipse.jgit involving Arbitrary File Overwrite in Eclipse JGit under CWE-178: Improper Handling of Case Sensitivity.
Which Org.eclipse.jgit versions are affected?
Affected versions include releases prior to 6.6.1.202309021850-r, 5.13.3.202401111512-r across affected packages: org.eclipse.jgit:org.eclipse.jgit.
What version fixes CVE-2023-4759?
Upgrading to 6.6.1.202309021850-r, 5.13.3.202401111512-r (or the latest patched release for your respective branch) resolves the vulnerability.
Is org.eclipse.jgit affected?
Yes, org.eclipse.jgit:org.eclipse.jgit is affected in releases prior to 6.6.1.202309021850-r, 5.13.3.202401111512-r. Upgrade your dependency to 6.6.1.202309021850-r, 5.13.3.202401111512-r or later.
What is the CVSS score of CVE-2023-4759?
CVE-2023-4759 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-4759?
CVE-2023-4759 is classified under CWE-178: Improper Handling of Case Sensitivity (The product does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.).
How can I check Maven dependencies for CVE-2023-4759?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.eclipse.jgit'. 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-3p86-9955-h393",
  "modified" : "2024-04-11T19:37:35Z",
  "published" : "2023-09-18T15:30:18Z",
  "aliases" : [ "CVE-2023-4759" ],
  "summary" : "Arbitrary File Overwrite in Eclipse JGit ",
  "details" : "Arbitrary File Overwrite in Eclipse JGit <= 6.6.0\n\nIn Eclipse JGit, all versions <= 6.6.0.202305301015-r, a symbolic link present in a specially crafted git repository can be used to write a file to locations outside the working tree when this repository is cloned with JGit to a case-insensitive filesystem, or when a checkout from a clone of such a repository is performed on a case-insensitive filesystem.\n\nThis can happen on checkout (DirCacheCheckout), merge (ResolveMerger via its WorkingTreeUpdater), pull (PullCommand using merge), and when applying a patch (PatchApplier). This can be exploited for remote code execution (RCE), for instance if the file written outside the working tree is a git filter that gets executed on a subsequent git command.\n\nThe issue occurs only on case-insensitive filesystems, like the default filesystems on Windows and macOS. The user performing the clone or checkout must have the rights to create symbolic links for the problem to occur, and symbolic links must be enabled in the git configuration.\n\nSetting git configuration option core.symlinks = false before checking out avoids the problem.\n\nThe issue was fixed in Eclipse JGit version 6.6.1.202309021850-r and 6.7.0.202309050840-r, available via  Maven Central https://repo1.maven.org/maven2/org/eclipse/jgit/  and  repo.eclipse.org https://repo.eclipse.org/content/repositories/jgit-releases/ . A backport is available in 5.13.3 starting from 5.13.3.202401111512-r.\n\nThe JGit maintainers would like to thank RyotaK for finding and reporting this issue.\n\n\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jgit:org.eclipse.jgit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0.202111291000-r"
      }, {
        "fixed" : "6.6.1.202309021850-r"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.6.0.202305301015-r"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jgit:org.eclipse.jgit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.13.3.202401111512-r"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-4759"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse-jgit/jgit/issues/30"
  }, {
    "type" : "PACKAGE",
    "url" : "https://git.eclipse.org/c/jgit/jgit.git"
  }, {
    "type" : "WEB",
    "url" : "https://git.eclipse.org/c/jgit/jgit.git/commit/?id=9072103f3b3cf64dd12ad2949836ab98f62dabf1"
  }, {
    "type" : "WEB",
    "url" : "https://gitlab.eclipse.org/security/vulnerability-reports/-/issues/11"
  }, {
    "type" : "WEB",
    "url" : "https://projects.eclipse.org/projects/technology.jgit/releases/5.13.3"
  }, {
    "type" : "WEB",
    "url" : "https://projects.eclipse.org/projects/technology.jgit/releases/6.6.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-178" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-18T19:17:54Z",
    "nvd_published_at" : "2023-09-12T10:15:29Z"
  }
}