Summary
GeoNetwork is vulnerable to XSLT-based code injection because its Saxon processor permits Java extension functions and does not enforce secure processing. A sufficiently privileged user who uploads a formatter stylesheet may execute operating-system commands with the privileges of the GeoNetwork process.
Affected context
The vulnerability occurs in GeoNetwork deployments that use Saxon to render formatters while allowing uploaded or otherwise user-controlled XSLT stylesheets to be processed. Risk is highest when a user with formatter-management privileges can submit a stylesheet and the GeoNetwork process has access to sensitive files, services, or operating-system capabilities.
Exploit preconditions
- Attack surface: GeoNetwork formatter upload and XSLT rendering functionality
- Required access: Sufficient privileges to upload or manage a formatter stylesheet
- Trigger point: Processing of the uploaded XSLT by the Saxon processor
- Why exploitation is possible: Secure processing is not enabled and Java extension functions remain available, allowing stylesheet code to invoke process-execution APIs
Why this happens
The underlying bug is an unsafe XSLT execution configuration. The Saxon processor accepts stylesheets that can call Java extension functions, including APIs capable of starting operating-system processes, rather than restricting stylesheet execution to transformation logic.
This maps primarily to CWE-94: Improper Control of Generation of Code, because attacker-controlled stylesheet content can cause executable behavior. It is also related to CWE-470: Use of Externally-Controlled Input to Select Classes or Code, since external stylesheet content can select and invoke Java classes or methods.
Potential impact
- An attacker could execute arbitrary operating-system commands
- The GeoNetwork application process could be compromised
- Sensitive catalog data or configuration could be accessed or modified
- The host or surrounding services could be affected, depending on process privileges
- Credentials, tokens, or data available to the process could be exposed
General mitigation guidance
Mitigation generally focuses on treating uploaded XSLT as untrusted code rather than ordinary presentation data.
Common defensive patterns include:
- Enable secure XML and XSLT processing features by default
- Disable Java extension functions and other external function mechanisms
- Permit only narrowly defined, trusted stylesheet capabilities
- Apply strict authorization and review controls to formatter uploads
- Validate uploaded files against an appropriate stylesheet policy before processing
- Run GeoNetwork with a dedicated least-privileged account and restricted filesystem and network access
- Isolate transformation workloads when untrusted customization is required
How teams detect issues like this
Organizations can detect similar issues through:
- Static analysis checks for Saxon configurations that omit secure processing or allow external functions
- Code review searches for XSLT extension-function support and process-execution APIs
- Policy checks that identify unrestricted formatter or stylesheet upload paths
- Runtime monitoring for unexpected child processes launched by the GeoNetwork service
- Audit logging of formatter creation, modification, and execution events
- Automated security review tools that flag dynamic stylesheet execution and dangerous Java class access

