Vulnerabilities in pkg:maven/org.apache.jena/jena-core

PACKAGE
Advisory Identifier: GHSA-7rp6-w7mg-h8rw
Advisory Summary

CVE-2021-39239 is a HIGH xml external entity reference vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Jena core libraries in the Maven ecosystem. The issue involves xml external entity reference in apache jena. Remediation is available by upgrading affected packages to version 4.2.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.apache.jena/jena-core

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.apache.jena/jena-core. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7rp6-w7mg-h8rw CVE-2021-39239 HIGH XML External Entity Reference in Apache Jena

CVE-2021-39239 at a Glance

CVE Identifier CVE-2021-39239
GHSA Identifier GHSA-7rp6-w7mg-h8rw
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Jena core
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2021-39239

To remediate this vulnerability, upgrade all affected Jena core 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.jena:jena-core fixed: 4.2.0
<dependency>
    <groupId>org.apache.jena</groupId>
    <artifactId>jena-core</artifactId>
    <version>4.2.0</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.jena

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.apache.jena 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-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Jena core, 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

A vulnerability in XML processing in Apache Jena, in versions up to 4.1.0, may allow an attacker to execute XML External Entities (XXE), including exposing the contents of local files to a remote server.

CVE-2021-39239 Affected Jena core Versions

1 component(s)
Fixed Versions:
4.2.0
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.jena:jena-core
Maven
< 4.2.0
4.2.0

References

Frequently Asked Questions

What is CVE-2021-39239?
CVE-2021-39239 is a security vulnerability in Jena core involving XML External Entity Reference in Apache Jena under CWE-611: Improper Restriction of XML External Entity Reference.
Which Jena core versions are affected?
Affected versions include releases prior to 4.2.0 across affected packages: org.apache.jena:jena-core.
What version fixes CVE-2021-39239?
Upgrading to 4.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jena-core affected?
Yes, org.apache.jena:jena-core is affected in releases prior to 4.2.0. Upgrade your dependency to 4.2.0 or later.
What CWE is associated with CVE-2021-39239?
CVE-2021-39239 is classified under CWE-611: Improper Restriction of XML External Entity Reference (The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.).
How can I check Maven dependencies for CVE-2021-39239?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.jena'. 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-7rp6-w7mg-h8rw",
  "modified" : "2021-09-17T18:29:23Z",
  "published" : "2021-09-20T20:22:05Z",
  "aliases" : [ "CVE-2021-39239" ],
  "summary" : "XML External Entity Reference in Apache Jena",
  "details" : "A vulnerability in XML processing in Apache Jena, in versions up to 4.1.0, may allow an attacker to execute XML External Entities (XXE), including exposing the contents of local files to a remote server.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.jena:jena-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-39239"
  }, {
    "type" : "PACKAGE",
    "url" : "https://gitbox.apache.org/repos/asf?p=jena.git"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r0f03ae7e102c3e8587fdd36531fc167309335738156dfbd7d9c1bf45@%3Cdev.jena.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rce5241b228a1f0e5880f6b2bfdb7ae9ee420e94cb692738a0bbfed9d@%3Cdev.jena.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rf44d529c54ef1d0097e813f576a0823a727e1669a9f610d3221d493d%40%3Cusers.jena.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rf44d529c54ef1d0097e813f576a0823a727e1669a9f610d3221d493d@%3Cannounce.apache.org%3E"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-09-17T18:29:23Z",
    "nvd_published_at" : "2021-09-16T15:15:00Z"
  }
}