Summary
OpenCMS versions 20 and earlier contain an XML External Entity (XXE) vulnerability in the Admin Import DB feature, where user-supplied ZIP archives with a manifest.xml are parsed insecurely.
An attacker who uploads a crafted ZIP file can abuse XML entity resolution to read internal files, access sensitive data, or interact with internal network resources during import.
Affected context
The vulnerability occurs in OpenCMS deployments that use the Admin Import DB functionality to ingest content or configuration from ZIP packages containing a manifest.xml file.
It is relevant when administrators or automated processes import archives whose origin is not fully trusted, or when upload paths can be influenced by malicious actors.
The issue is tied to XML parsers that allow external entity resolution and access to local or remote resources during the parsing of manifest.xml inside the uploaded ZIP.
Exploit preconditions
- Attack surface: Web-based Admin Import DB feature that processes user-supplied ZIP archives.
- Required access: Ability to supply or influence ZIP files imported into OpenCMS; often authenticated administrative access, but also risky in shared or multi-tenant setups.
- Trigger point: Upload and import of a ZIP containing a specially crafted manifest.xml that defines external entities.
- Why exploitation is possible: The XML parser used for manifest.xml is configured (or left default) to resolve external entities, enabling access to local files, environment metadata, or internal network endpoints.
Why this happens
This vulnerability stems from insecure XML parsing where external entities are not disabled for untrusted input.
By allowing the XML parser to resolve entities defined in manifest.xml, the system effectively grants the XML document a limited I/O capability to reach local files (file://), internal URLs (http://, https://), or other protocols.
This behavior maps to CWE-611: Improper Restriction of XML External Entity Reference, where the application accepts XML with external entities and processes them in a context that has more privileges or visibility than the attacker should receive.
Potential impact
- Disclosure of sensitive files on the OpenCMS host (e.g., configuration, credentials, logs).
- Exposure of environment details that could aid further compromise.
- Server-Side Request Forgery (SSRF) against internal services reachable from the OpenCMS server.
- Potential interaction with metadata services in cloud environments, leading to token or secret leakage.
- Increased attack surface for chaining with other vulnerabilities such as authentication bypass or privilege escalation.
General mitigation guidance
Mitigation typically focuses on hardening XML parsing and narrowing trust in imported content:
- Configure XML parsers to disable external entity resolution and DTD processing for any untrusted or semi-trusted XML, including manifest.xml.
- Prefer XML libraries or parsing modes that are secure-by-default and explicitly designed to prevent XXE.
- Introduce strict validation of import packages, ensuring they follow an expected schema without custom entity definitions.
- Restrict who can upload and import ZIP packages, applying least-privilege principles to administrative features and automated processes.
- Isolate the import process where feasible, for example via constrained execution environments with limited filesystem and network access.
How teams detect issues like this
Detection approaches often combine code-level inspection with behavioral monitoring:
- Use static analysis rules or secure coding checklists to flag XML parsing where external entities and DTDs remain enabled for user-supplied data.
- During code review, look for XML factory or builder configurations that omit secure processing flags or rely on default parser settings.
- Incorporate security tests that attempt to import crafted XML manifests and monitor for unexpected outbound requests or file reads.
- Enable logging or monitoring on the server to detect unusual file access patterns or outbound HTTP requests correlated with import operations.

