/

CVE-2026-109199

Severity:

HIGH RISK

(8.8)

Code Injection (CWE-94) in LogicalDOC Email Templates

CVE-2026-109199

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Operating-System Command Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

LogicalDOC Community Edition contains a code injection vulnerability in Velocity template processing for email subject and message fields. An authenticated user may abuse template evaluation to invoke command-execution functionality, causing operating-system commands to run with the privileges of the LogicalDOC process.

LogicalDOC Community Edition contains a code injection vulnerability in Velocity template processing for email subject and message fields. An authenticated user may abuse template evaluation to invoke command-execution functionality, causing operating-system commands to run with the privileges of the LogicalDOC process.

Affected context

The issue occurs in LogicalDOC deployments where authenticated users can submit or influence values processed as Velocity templates by DocumentService.sendAsEmail. Risk is increased when template-accessible tools expose runtime or process-execution capabilities and denylist controls do not comprehensively restrict them.

The issue occurs in LogicalDOC deployments where authenticated users can submit or influence values processed as Velocity templates by DocumentService.sendAsEmail. Risk is increased when template-accessible tools expose runtime or process-execution capabilities and denylist controls do not comprehensively restrict them.

Exploit preconditions

  • Attack surface: Email-sending functionality that evaluates user-influenced subject or message templates
  • Required access: An authenticated LogicalDOC account permitted to invoke the affected document email operation
  • Trigger point: Velocity template evaluation during email preparation or sending
  • Why exploitation is possible: Template expressions can reach command-execution-related functionality that is not fully blocked by the configured runtime denylist
  • Attack surface: Email-sending functionality that evaluates user-influenced subject or message templates
  • Required access: An authenticated LogicalDOC account permitted to invoke the affected document email operation
  • Trigger point: Velocity template evaluation during email preparation or sending
  • Why exploitation is possible: Template expressions can reach command-execution-related functionality that is not fully blocked by the configured runtime denylist

Why this happens

The vulnerability results from treating user-influenced email content as executable Velocity template logic rather than as data. Template-accessible helpers such as runtime or class-related tools can expose capabilities beyond simple formatting, while denylist-based restrictions may omit alternate paths to those capabilities. This behavior maps to CWE-94: Improper Control of Generation of Code, because attacker-controlled input is interpreted in an executable context.

The vulnerability results from treating user-influenced email content as executable Velocity template logic rather than as data. Template-accessible helpers such as runtime or class-related tools can expose capabilities beyond simple formatting, while denylist-based restrictions may omit alternate paths to those capabilities. This behavior maps to CWE-94: Improper Control of Generation of Code, because attacker-controlled input is interpreted in an executable context.

Potential impact

  • An attacker may execute operating-system commands with LogicalDOC process privileges
  • The application and its accessible data may be compromised
  • Confidential documents or configuration secrets could be exposed
  • The host may be used for persistence, lateral movement, or additional attacks
  • Data integrity may be affected through unauthorized changes or deletion
  • An attacker may execute operating-system commands with LogicalDOC process privileges
  • The application and its accessible data may be compromised
  • Confidential documents or configuration secrets could be exposed
  • The host may be used for persistence, lateral movement, or additional attacks
  • Data integrity may be affected through unauthorized changes or deletion

General mitigation guidance

Mitigation generally focuses on separating email content from executable template logic and reducing the capabilities available during rendering.

Common defensive patterns include:

  • Treating subject and message values as plain text or using a narrowly constrained, non-executable templating model
  • Allowing only explicitly approved formatting operations and exposing no runtime, reflection, class-loading, or process-execution helpers
  • Replacing denylist-only controls with an allowlist-based execution policy and strong sandbox boundaries where templating is required
  • Validating and encoding user-controlled content according to the intended email format
  • Running the application with least-privilege operating-system and service-account permissions
  • Restricting access to email-sending features and monitoring changes to template-related configuration

Mitigation generally focuses on separating email content from executable template logic and reducing the capabilities available during rendering.

Common defensive patterns include:

  • Treating subject and message values as plain text or using a narrowly constrained, non-executable templating model
  • Allowing only explicitly approved formatting operations and exposing no runtime, reflection, class-loading, or process-execution helpers
  • Replacing denylist-only controls with an allowlist-based execution policy and strong sandbox boundaries where templating is required
  • Validating and encoding user-controlled content according to the intended email format
  • Running the application with least-privilege operating-system and service-account permissions
  • Restricting access to email-sending features and monitoring changes to template-related configuration

How teams detect issues like this

Detection approaches can include:

  • Static analysis rules identifying evaluation of user-controlled values through Velocity or comparable executable template engines
  • Code review checks for exposed runtime, reflection, class, process, or command-execution helpers
  • Tests that verify untrusted email fields remain data and cannot resolve arbitrary methods or classes
  • Policy enforcement that prohibits executable template processing in user-editable fields unless an explicit, constrained allowlist is present
  • Runtime monitoring for unusual child processes, command interpreters, or filesystem and network activity originating from the LogicalDOC process
  • Neutral automated security review tools that flag code-generation and template-injection patterns

Detection approaches can include:

  • Static analysis rules identifying evaluation of user-controlled values through Velocity or comparable executable template engines
  • Code review checks for exposed runtime, reflection, class, process, or command-execution helpers
  • Tests that verify untrusted email fields remain data and cannot resolve arbitrary methods or classes
  • Policy enforcement that prohibits executable template processing in user-editable fields unless an explicit, constrained allowlist is present
  • Runtime monitoring for unusual child processes, command interpreters, or filesystem and network activity originating from the LogicalDOC process
  • Neutral automated security review tools that flag code-generation and template-injection patterns

Sources

SourceLink
github.comgithub.com/logicaldoc/community
github.comgithub.com/logicaldoc/community/blob/9.3/logicaldoc-core/src/main/java/com/logicaldoc/core/automation/SystemTool.java#L59
github.comgithub.com/logicaldoc/community/blob/9.3/logicaldoc-webapp/src/main/java/com/logicaldoc/web/service/DocumentServiceImpl.java#L1543
github.comgithub.com/logicaldoc/community/commit/66c3a6b9b47f9f6c624047eea43b219851378f00
github.comgithub.com/logicaldoc/community/discussions/119
vulncheck.comvulncheck.com/advisories/logicaldoc-community-edition-through-9.3-code-injection-via-velocity-sendasemail-template

Frequently asked

questions

It may be exploitable through the LogicalDOC application interface when the affected email functionality is reachable by an authenticated user and accepts attacker-influenced template content.

An attacker generally needs valid authentication and authorization to use the document email operation or otherwise control the relevant subject or message fields.

The safest pattern is to prevent user-controlled values from being evaluated as executable templates. If templating is necessary, use a narrowly scoped engine with an explicit allowlist and no access to runtime, reflection, class-loading, or process APIs.

Treat user input as data, apply capability-based restrictions instead of relying only on denylists, review template helper exposure, enforce least privilege, and test template-rendering boundaries during code review and security testing.

It may be exploitable through the LogicalDOC application interface when the affected email functionality is reachable by an authenticated user and accepts attacker-influenced template content.

An attacker generally needs valid authentication and authorization to use the document email operation or otherwise control the relevant subject or message fields.

The safest pattern is to prevent user-controlled values from being evaluated as executable templates. If templating is necessary, use a narrowly scoped engine with an explicit allowlist and no access to runtime, reflection, class-loading, or process APIs.

Treat user input as data, apply capability-based restrictions instead of relying only on denylists, review template helper exposure, enforce least privilege, and test template-rendering boundaries during code review and security testing.

Find out what's already
exploitable in your codebase.