Miggo Logo

CVE-2025-53621: DSpace is vulnerable to XML External Entity injection during archive imports

6.9

CVSS Score
3.1

Basic Information

EPSS Score
-
Published
7/15/2025
Updated
7/15/2025
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:N/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.dspace:dspace-apimaven< 7.6.47.6.4
org.dspace:dspace-apimaven>= 8.0, < 8.28.2
org.dspace:dspace-apimaven>= 9.0, < 9.19.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability advisory describes two primary XXE attack vectors: one through the Simple Archive Format (SAF) import feature and another through parsing XML from external data sources. The analysis of the provided patches confirms this and reveals the widespread nature of insecure XML parser instantiation across the DSpace codebase.

The core of the fix is the introduction of a centralized org.dspace.app.util.XMLUtils class. This class provides factory methods (getDocumentBuilder, getSAXBuilder, etc.) that return XML parsers configured with secure defaults, specifically disabling external entity resolution features that lead to XXE vulnerabilities (e.g., disallow-doctype-decl, external-general-entities).

The investigation of the commits shows numerous files where default, insecure DocumentBuilderFactory, DocumentBuilder, and SAXBuilder instances were being created. These insecure instances were then replaced with calls to the new secure methods in XMLUtils.

The identified vulnerable functions are key points where the application processes XML that could be controlled by an attacker, either directly (by an administrator uploading a malicious archive) or indirectly (if a trusted external service was compromised).

  • org.dspace.app.itemimport.ItemImportServiceImpl.loadXML is the primary function for handling metadata XML in SAF archives, making it a direct target for the first attack vector.
  • org.dspace.importer.external.* services, such as those for ArXiv and CrossRef, and the CCLicenseConnectorServiceImpl, directly correspond to the second attack vector, where XML is fetched from an external API and parsed insecurely.
  • org.dspace.content.packager.METSManifest.create represents another archive-based vector, as METS is a common packaging format for digital objects.

By replacing the insecure parser initializations in these functions, the patch effectively mitigates the XXE risk.

Vulnerable functions

org.dspace.app.itemimport.ItemImportServiceImpl.loadXML
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
The function `loadXML` within `ItemImportServiceImpl` is used to parse XML metadata files during a Simple Archive Format (SAF) import. Prior to the patch, it used a default `DocumentBuilder` created via `DocumentBuilderFactory.newInstance()`, which does not disable external entity processing by default. This makes the application vulnerable to XML External Entity (XXE) injection if an attacker can supply a malicious metadata XML file within an archive.
org.dspace.importer.external.arxiv.service.ArXivImportMetadataSourceServiceImpl$1.call
dspace-api/src/main/java/org/dspace/importer/external/arxiv/service/ArXivImportMetadataSourceServiceImpl.java
This function, located in an anonymous inner class within `ArXivImportMetadataSourceServiceImpl`, processes XML responses from the ArXiv external import source. It used a default `SAXBuilder`, which is vulnerable to XXE. If the ArXiv service were compromised to return a malicious XML payload, it could be exploited.
org.dspace.importer.external.crossref.CrossRefAbstractProcessor.prettifyAbstract
dspace-api/src/main/java/org/dspace/importer/external/crossref/CrossRefAbstractProcessor.java
This function parses an XML string derived from a CrossRef API response. It used a default `DocumentBuilder`, making it vulnerable to XXE if a malicious payload is present in the 'abstractValue' from the CrossRef response.
org.dspace.license.CCLicenseConnectorServiceImpl.<init>
dspace-api/src/main/java/org/dspace/license/CCLicenseConnectorServiceImpl.java
The `CCLicenseConnectorServiceImpl` class, which handles interactions with the Creative Commons API, initialized a `SAXBuilder` instance variable with default settings, making it vulnerable to XXE. This parser is then used to process XML responses from the Creative Commons service. The vulnerability lies in the initialization of the parser used by the class methods.
org.dspace.content.packager.METSManifest.create
dspace-api/src/main/java/org/dspace/content/packager/METSManifest.java
This function is responsible for creating a METS (Metadata Encoding and Transmission Standard) package manifest from an InputStream. It used a `SAXBuilder` that was not securely configured to prevent XXE attacks, especially when validation was turned off. This is another entry point for archive-based XXE attacks.

WAF Protection Rules

WAF Rule

### Imp**t Two r*l*t** XX* inj**tion possi*iliti*s **v* ***n *is*ov*r**, **imp**tin* *ll v*rsions o* *Sp*** prior to *.*.*, *.* *n* *.***. *. *xt*rn*l *ntiti*s *r* not *is**l** w**n p*rsin* XML *il*s *urin* import o* *n *r**iv* (in [Simpl* *r**iv*

Reasoning

T** vuln*r**ility **visory **s*ri**s two prim*ry XX* *tt**k v**tors: on* t*rou** t** Simpl* *r**iv* *orm*t (S**) import ***tur* *n* *not**r t*rou** p*rsin* XML *rom *xt*rn*l **t* sour**s. T** *n*lysis o* t** provi*** p*t***s *on*irms t*is *n* r*v**ls