Vulnerabilities in pkg:maven/org.eclipse.leshan/leshan-core

PACKAGE
Advisory Identifier: GHSA-wc9j-gc65-3cm7
Advisory Summary

CVE-2023-41034 is a MODERATE (CVSS 6.5) ddffileparser is vulnerable to xxe vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Leshan core libraries in the Maven ecosystem. The issue involves ddffileparser is vulnerable to xxe attacks. Remediation is available by upgrading affected packages to version 1.5.0, 2.0.0-M13.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.eclipse.leshan/leshan-core

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-wc9j-gc65-3cm7 CVE-2023-41034 MODERATE DDFFileParser is vulnerable to XXE Attacks

CVE-2023-41034 at a Glance

CVE Identifier CVE-2023-41034
GHSA Identifier GHSA-wc9j-gc65-3cm7
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Leshan core
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2023-41034

To remediate this vulnerability, upgrade all affected Leshan 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.eclipse.leshan:leshan-core fixed: 1.5.0
<dependency>
    <groupId>org.eclipse.leshan</groupId>
    <artifactId>leshan-core</artifactId>
    <version>1.5.0</version>
</dependency>
org.eclipse.leshan:leshan-core fixed: 2.0.0-M13
<dependency>
    <groupId>org.eclipse.leshan</groupId>
    <artifactId>leshan-core</artifactId>
    <version>2.0.0-M13</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.leshan

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.eclipse.leshan 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 Leshan 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

### Impact `DDFFileParser` and `DefaultDDFFileValidator` (and so `ObjectLoader`) are vulnerable to [XXE Attacks](https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing). [DDF file](https://github.com/eclipse-leshan/leshan/wiki/Adding-new-objects#the-lwm2m-model) is a LWM2M format used to store LWM2M object description. Leshan users are impacted only if they parse untrusted DDF files (e.g. if they let external users provide their own model), in that case they MUST upgrade to fixed version. If you parse only trusted DDF file and validate only with trusted xml schema, upgrading is not mandatory. ### Patches This is fixed in **v1.5.0** and **2.0.0-M13**. ### Workarounds No easy way. Eventually writing your own `DDFFileParser`/`DefaultDDFFileValidator` (and so `ObjectLoader`) creating a `DocumentBuilderFactory` with : ```java // For DDFFileParser DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); // Disable DTDs factory.setXIncludeAware(false); // Disable XML Inclusions factory.setExpandEntityReferences(false); // disable expand entity reference nodes // For DefaultDDFFileValidator SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, ""); factory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, ""); ``` ### References - https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing - https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html - https://semgrep.dev/docs/cheat-sheets/java-xxe/ - https://community.veracode.com/s/article/Java-Remediation-Guidance-for-XXE

CVE-2023-41034 Affected Leshan core Versions

2 component(s)
Fixed Versions:
1.5.02.0.0-M13
Product / Package Ecosystem Affected Versions Fixed Version
org.eclipse.leshan:leshan-core
Maven
< 1.5.0
1.5.0
org.eclipse.leshan:leshan-core
Maven
≥ 2.0.0-M1
< 2.0.0-M13
2.0.0-M13

References

Frequently Asked Questions

What is CVE-2023-41034?
CVE-2023-41034 is a security vulnerability in Leshan core involving DDFFileParser is vulnerable to XXE Attacks under CWE-611: Improper Restriction of XML External Entity Reference.
Which Leshan core versions are affected?
Affected versions include releases prior to 1.5.0, 2.0.0-M13 across affected packages: org.eclipse.leshan:leshan-core.
What version fixes CVE-2023-41034?
Upgrading to 1.5.0, 2.0.0-M13 (or the latest patched release for your respective branch) resolves the vulnerability.
Is leshan-core affected?
Yes, org.eclipse.leshan:leshan-core is affected in releases prior to 1.5.0, 2.0.0-M13. Upgrade your dependency to 1.5.0, 2.0.0-M13 or later.
What is the CVSS score of CVE-2023-41034?
CVE-2023-41034 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2023-41034?
CVE-2023-41034 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-2023-41034?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.eclipse.leshan'. 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-wc9j-gc65-3cm7",
  "modified" : "2023-08-31T21:47:28Z",
  "published" : "2023-08-31T21:47:28Z",
  "aliases" : [ "CVE-2023-41034" ],
  "summary" : "DDFFileParser is vulnerable to XXE Attacks",
  "details" : "### Impact\n`DDFFileParser` and `DefaultDDFFileValidator` (and so `ObjectLoader`) are vulnerable to [XXE Attacks](https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing).\n\n[DDF file](https://github.com/eclipse-leshan/leshan/wiki/Adding-new-objects#the-lwm2m-model) is a LWM2M format used to store LWM2M object description.   \nLeshan users are impacted only if they parse untrusted DDF files (e.g. if they let external users provide their own model), in that case they MUST upgrade to fixed version.\nIf you parse only trusted DDF file and validate only with trusted xml schema, upgrading is not mandatory. \n\n### Patches\nThis is fixed in **v1.5.0** and **2.0.0-M13**.\n\n### Workarounds\nNo easy way. Eventually writing your own `DDFFileParser`/`DefaultDDFFileValidator` (and so `ObjectLoader`) creating a `DocumentBuilderFactory` with : \n```java\n// For DDFFileParser\nDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\nfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\nfactory.setFeature(\"http://apache.org/xml/features/disallow-doctype-decl\", true); // Disable DTDs\nfactory.setXIncludeAware(false); // Disable XML Inclusions\nfactory.setExpandEntityReferences(false); // disable expand entity reference nodes\n\n// For DefaultDDFFileValidator\nSchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\nfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\nfactory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, \"\");\nfactory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, \"\");\n``` \n\n### References\n- https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing\n- https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html\n- https://semgrep.dev/docs/cheat-sheets/java-xxe/\n- https://community.veracode.com/s/article/Java-Remediation-Guidance-for-XXE",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.leshan:leshan-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.leshan:leshan-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0-M1"
      }, {
        "fixed" : "2.0.0-M13"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/eclipse-leshan/leshan/security/advisories/GHSA-wc9j-gc65-3cm7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41034"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse-leshan/leshan/commit/29577d2879ba8e7674c3b216a7f01193fc7ae013"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse-leshan/leshan/commit/4d3e63ac271a817f81fba3e3229c519af7a3049c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/eclipse-leshan/leshan"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse-leshan/leshan/wiki/Adding-new-objects#the-lwm2m-model"
  }, {
    "type" : "WEB",
    "url" : "https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-31T21:47:28Z",
    "nvd_published_at" : "2023-08-31T18:15:09Z"
  }
}