# CVE-2023-41034: DDFFileParser in eclipse leshan is vulnerable to XXE Attacks

> Attackers can exploit XML External Entity vulnerabilities in Eclipse Leshan by providing malicious DDF files, potentially leading to data exposure or service disruption.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 Aug 2023
- **Updated:** 27 Sep 2024
- **Also known as:** GHSA-wc9j-gc65-3cm7

## What is CVE-2023-41034?

CVE-2023-41034 is a medium-severity vulnerability in eclipse-leshan leshan, published on 31 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Eclipse Leshan is a device management server and client Java implementation. In affected versions DDFFileParser` and `DefaultDDFFileValidator` (and so `ObjectLoader`) are vulnerable to `XXE Attacks`. A DDF file 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.  This issue has been fixed in versions 1.5.0 and 2.0.0-M13. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-611 (Improper Restriction of XML External Entity Reference)

## Which versions are affected by CVE-2023-41034?

4 open source packages ship an affected version, including org.eclipse.leshan:leshan-core. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.eclipse.leshan:leshan-core` | Maven | All versions | 1.5.0 |
| `org.eclipse.leshan:leshan-core` | Maven | All versions | 1.5.0 |
| `org.eclipse.leshan:leshan-core` | Maven | From 2.0.0-M1 | 2.0.0-M13 |
| `org.eclipse.leshan:leshan-core` | Maven | From 2.0.0-M1 | 2.0.0-M13 |

Products: Eclipse Leshan.

## How do I fix CVE-2023-41034?

Upgrade org.eclipse.leshan:leshan-core to a fixed version for your release line: 1.5.0 or 2.0.0-M13.

## Is CVE-2023-41034 being exploited?

There is no known exploitation of CVE-2023-41034 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-41034 and fix it if it is affected.

What it is: CVE-2023-41034 is a medium-severity vulnerability in eclipse-leshan leshan, published on 31 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-41034 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.eclipse.leshan:leshan-core (Maven): affected all versions; fixed in 1.5.0
- org.eclipse.leshan:leshan-core (Maven): affected all versions; fixed in 1.5.0
- org.eclipse.leshan:leshan-core (Maven): affected from 2.0.0-M1; fixed in 2.0.0-M13
- org.eclipse.leshan:leshan-core (Maven): affected from 2.0.0-M1; fixed in 2.0.0-M13

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-41034/ (Markdown: https://insights.sbomify.com/CVE-2023-41034/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-41034
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-41034
- OSV: https://osv.dev/vulnerability/CVE-2023-41034

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-41034/
Summaries are generated and may contain mistakes; the official description above is the record.
