# CVE-2013-4002: Missing XML Validation in Apache Xerces2

> Remote attackers can cause a denial of service in applications using the Apache Xerces2 Java Parser via crafted XML attribute names.

- **Severity:** High 7.1 (`AV:N/AC:M/Au:N/C:N/I:N/A:C`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Jul 2013
- **Updated:** 6 Aug 2024
- **Also known as:** CLEANSTART-2026-UI56103, GHSA-7j4h-8wpf-rqfh, MGASA-2014-0398, RHSA-2014:1319, RHSA-2014:1818, RHSA-2014:1821, RHSA-2014:1822

## What is CVE-2013-4002?

CVE-2013-4002 is a high-severity denial of service vulnerability in Canonical Ubuntu Linux, published on 23 Jul 2013. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

XMLscanner.java in Apache Xerces2 Java Parser before 2.12.0, as used in the Java Runtime Environment (JRE) in IBM Java 5.0 before 5.0 SR16-FP3, 6 before 6 SR14, 6.0.1 before 6.0.1 SR6, and 7 before 7 SR5 as well as Oracle Java SE 7u40 and earlier, Java SE 6u60 and earlier, Java SE 5.0u51 and earlier, JRockit R28.2.8 and earlier, JRockit R27.7.6 and earlier, Java SE Embedded 7u40 and earlier, and possibly other products allows remote attackers to cause a denial of service via vectors related to XML attribute names.

## Which versions are affected by CVE-2013-4002?

2 open source packages ship an affected version, including xerces:xercesImpl. It affects 15 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `xerces:xercesImpl` | Maven | All versions | 2.12.0 |
| `xerces:xercesImpl` | Maven | All versions | 2.12.0 |
| `xerces-j2` | Red Hat:enterprise_linux:6::client | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-debuginfo` | Red Hat:enterprise_linux:6::client | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-demo` | Red Hat:enterprise_linux:6::client | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-apis` | Red Hat:enterprise_linux:6::client | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-impl` | Red Hat:enterprise_linux:6::client | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-other` | Red Hat:enterprise_linux:6::client | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-xni` | Red Hat:enterprise_linux:6::client | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-scripts` | Red Hat:enterprise_linux:6::client | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-debuginfo` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-demo` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-apis` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-impl` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-other` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-xni` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-scripts` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2` | Red Hat:enterprise_linux:6::server | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-debuginfo` | Red Hat:enterprise_linux:6::server | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-demo` | Red Hat:enterprise_linux:6::server | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-apis` | Red Hat:enterprise_linux:6::server | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-impl` | Red Hat:enterprise_linux:6::server | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-other` | Red Hat:enterprise_linux:6::server | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-xni` | Red Hat:enterprise_linux:6::server | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-scripts` | Red Hat:enterprise_linux:6::server | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2` | Red Hat:enterprise_linux:6::workstation | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-debuginfo` | Red Hat:enterprise_linux:6::workstation | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-demo` | Red Hat:enterprise_linux:6::workstation | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-apis` | Red Hat:enterprise_linux:6::workstation | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-impl` | Red Hat:enterprise_linux:6::workstation | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-other` | Red Hat:enterprise_linux:6::workstation | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-javadoc-xni` | Red Hat:enterprise_linux:6::workstation | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2-scripts` | Red Hat:enterprise_linux:6::workstation | All versions | 0:2.7.1-12.7.el6_5 |
| `xerces-j2` | Red Hat:enterprise_linux:7::client | All versions | 0:2.11.0-17.el7_0 |
| `xerces-j2-demo` | Red Hat:enterprise_linux:7::client | All versions | 0:2.11.0-17.el7_0 |
| `xerces-j2-javadoc` | Red Hat:enterprise_linux:7::client | All versions | 0:2.11.0-17.el7_0 |
| `xerces-j2` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.11.0-17.el7_0 |
| `xerces-j2-demo` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.11.0-17.el7_0 |
| `xerces-j2-javadoc` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.11.0-17.el7_0 |

Products: Apache Xerces2 Java, Canonical Ubuntu Linux, Ibm Host On-Demand, Ibm Java, Ibm Sterling B2b Integrator, Ibm Sterling File Gateway, Ibm Tivoli Application Dependency Discovery Manager, Opensuse Opensuse, Oracle Jdk, Oracle Jre, Oracle Jrockit, Suse Linux Enterprise Desktop, Suse Linux Enterprise Java, Suse Linux Enterprise Sdk, Suse Linux Enterprise Server.

## How do I fix CVE-2013-4002?

Upgrade xerces:xercesImpl to 2.12.0 or later.

## Is CVE-2013-4002 being exploited?

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

Public exploit code:

- https://github.com/tafamace/CVE-2013-4002 (github_poc): https://github.com/tafamace/CVE-2013-4002

## Other vulnerabilities in Canonical Ubuntu Linux

- [CVE-2012-0881](https://insights.sbomify.com/CVE-2012-0881/): Denial of service in Apache Xerces2 (high 7.5)
- [CVE-2009-2625](https://insights.sbomify.com/CVE-2009-2625/): Denial of service in Apache Xerces2 (medium 5.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2013-4002 and fix it if it is affected.

What it is: CVE-2013-4002 is a high-severity denial of service vulnerability in Canonical Ubuntu Linux, published on 23 Jul 2013. 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-2013-4002 in the wild and no public exploit code.

Affected packages and fixed versions:
- xerces:xercesImpl (Maven): affected all versions; fixed in 2.12.0
- xerces:xercesImpl (Maven): affected all versions; fixed in 2.12.0

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

## Sources

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

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