# CVE-2014-3004: Improper Restriction of XML External Entity Reference in Castor

> Attackers can exploit XML External Entity vulnerabilities in the Castor library to read sensitive files or cause denial of service via crafted XML.

- **Severity:** Medium 4.3 (`AV:N/AC:M/Au:N/C:P/I:N/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:** 11 Jun 2014
- **Updated:** 6 Aug 2024
- **Also known as:** CVE-2018-18895, GHSA-jwwr-fjgh-cv2x, MGASA-2014-0556, UBUNTU-CVE-2014-3004

## What is CVE-2014-3004?

CVE-2014-3004 is a medium-severity vulnerability in Opensuse Opensuse, published on 11 Jun 2014. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The default configuration for the Xerces SAX Parser in Castor before 1.3.3 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted XML document.

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

## Which versions are affected by CVE-2014-3004?

4 open source packages ship an affected version, including castor:castor and org.codehaus.castor:castor. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `castor:castor` | Maven | All versions to 1.0 | None |
| `castor:castor` | Maven | All versions to 1.0 | None |
| `org.codehaus.castor:castor` | Maven | All versions | 1.3.3 |
| `org.codehaus.castor:castor` | Maven | All versions | 1.3.3 |

Products: Castor Project Castor, Opensuse Opensuse, Opensuse Project Opensuse.

## How do I fix CVE-2014-3004?

Upgrade to a fixed version.

## Is CVE-2014-3004 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2014-3004 exists.

Public exploit code:

- Castor Library - XML External Entity Information Disclosure (exploitdb)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2014-3004 and fix it if it is affected.

What it is: CVE-2014-3004 is a medium-severity vulnerability in Opensuse Opensuse, published on 11 Jun 2014. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2014-3004 exists.

Affected packages and fixed versions:
- castor:castor (Maven): affected all versions up to 1.0; no fix listed
- castor:castor (Maven): affected all versions up to 1.0; no fix listed
- org.codehaus.castor:castor (Maven): affected all versions; fixed in 1.3.3
- org.codehaus.castor:castor (Maven): affected all versions; fixed in 1.3.3

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-2014-3004/ (Markdown: https://insights.sbomify.com/CVE-2014-3004/index.md)
```

## Sources

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

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