Summary
DSpace contains a remote code execution vulnerability in the Velocity template processing used for COAR Notify/LDN messages. Under conditions where attacker-controlled message content reaches this template processing path, an attacker may execute code with the privileges of the DSpace service.
Affected context
The issue affects DSpace deployments that use the vulnerable Velocity template handling path for COAR Notify or Linked Data Notifications (LDN). It is relevant to affected DSpace release lines where untrusted or insufficiently constrained message data can be evaluated as a template rather than treated strictly as data.
Exploit preconditions
- Attack surface: DSpace COAR Notify/LDN message processing
- Required access: The ability to submit or influence data that reaches the affected message and template-processing workflow
- Trigger point: Evaluation of a Velocity template during message handling
- Why exploitation is possible: Template expressions may be interpreted with capabilities that permit code execution instead of being limited to data rendering
Why this happens
The underlying flaw is code injection caused by treating template content influenced by an external party as executable template logic. Velocity evaluation can provide access to operations beyond simple substitution when its context and execution features are not sufficiently restricted. This behavior maps to CWE-94, Improper Control of Generation of Code, because attacker-influenced input can affect code-like instructions executed by the application.
Potential impact
- An attacker may execute arbitrary code in the DSpace service process.
- The attacker could access or modify repository-managed content and metadata.
- The application may be used to access connected services or stored secrets.
- The compromise could support data tampering, persistence, or further lateral movement.
General mitigation guidance
Mitigation generally focuses on removing executable template behavior from
untrusted message-processing paths.
Common defensive patterns include:
- Treating notification content as data and using non-evaluating rendering mechanisms.
- Restricting template contexts to an explicit allowlist of inert values and operations.
- Disabling dangerous reflection, object access, method invocation, and other execution-capable template features.
- Applying strict validation and canonicalization before message content reaches rendering logic.
- Isolating the DSpace service with least-privilege accounts, limited filesystem access, and restricted network permissions.
- Using maintained releases that contain the vendor's security correction and applying the organization's standard patch governance.
How teams detect issues like this
Detection approaches may include:
- Static analysis rules identifying Velocity evaluation of externally influenced input.
- Code review checks for dynamic template construction, unrestricted template contexts, and method or object access from templates.
- Runtime monitoring for unexpected process creation, shell invocation, filesystem changes, or outbound connections from DSpace.
- Logging and alerting on unusual COAR Notify/LDN message sources, template errors, and administrative changes following message processing.
- Policy enforcement that requires approved templates and blocks executable constructs in externally supplied content.
Automated security review tools can help identify unsafe template evaluation patterns during development and CI.

