Vulnerabilities in pkg:maven/org.eclipse.leshan/leshan-core
PACKAGECVE-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.
pkg:maven/org.eclipse.leshan/leshan-core
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
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).
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.
<dependency>
<groupId>org.eclipse.leshan</groupId>
<artifactId>leshan-core</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.leshan</groupId>
<artifactId>leshan-core</artifactId>
<version>2.0.0-M13</version>
</dependency>
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
CVE-2023-41034 Affected Leshan core Versions
2 component(s)| 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?
Which Leshan core versions are affected?
What version fixes CVE-2023-41034?
Is leshan-core affected?
What is the CVSS score of CVE-2023-41034?
What CWE is associated with CVE-2023-41034?
How can I check Maven dependencies for CVE-2023-41034?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}