/

CVE-2026-42555

Severity:

CRITICAL RISK

(9.1)

Code Injection / Expression Language Injection

CVE-2026-42555

Deferred

Vulnerability type

Category:

Code Injection / Expression Language Injection

CWE:

CWE-94

Impact:

Remote Code Execution and Sensitive Data Exposure

Severity:

CRITICAL RISK

(9.1)

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

Valtimo's document, case, and contract modules evaluate user-supplied Spring Expression Language (SpEL) expressions using a StandardEvaluationContext that exposes unrestricted access to Java types and methods.

An authenticated user with ADMIN privileges can abuse this expression evaluation to execute arbitrary code on the server and exfiltrate credentials whenever the crafted expressions are processed.

Affected context

This vulnerability occurs in Valtimo deployments using:

  • com.ritense.valtimo:document versions 12.0.0 to before 12.32.0
  • com.ritense.valtimo:case versions 13.0.0 to before 13.23.0
  • com.ritense.valtimo:contract versions 13.4.0 to before 13.23.0

In these versions, user-supplied SpEL expressions are evaluated in a StandardEvaluationContext with access to arbitrary Java types and methods.

The risk materializes when ADMIN users can persist or trigger SpEL-based configuration, templates, or rules that are later evaluated by the application.

Exploit preconditions

  • Attack surface: Application features that accept or store SpEL expressions (e.g., dynamic configuration, document/case/contract rules, templates).
  • Required access: Valid authenticated user account with the ADMIN role in the affected Valtimo instance.
  • Trigger point: Any code path that evaluates stored or direct user-supplied SpEL expressions via StandardEvaluationContext within the vulnerable modules.
  • Why exploitation is possible: StandardEvaluationContext is configured in a way that permits direct access to Java types and static methods. When attacker-controlled values are evaluated as SpEL, the expression engine can be instructed to instantiate arbitrary classes and call methods, enabling arbitrary code execution and access to sensitive runtime data such as credentials.

Why this happens

The core issue is the evaluation of untrusted data as executable expressions, a form of code injection described by CWE-94: Improper Control of Generation of Code ('Code Injection').

In the affected Valtimo modules, Spring Expression Language is used to provide flexible, dynamic behavior. However, user-supplied values are passed directly into the SpEL engine and evaluated within a StandardEvaluationContext that exposes the full Java type system.

This combination—untrusted expression strings plus a permissive evaluation context—creates an execution environment where attackers with configuration control can construct expressions that invoke arbitrary methods, spawn processes, access environment variables, or read secrets held by the application.

Potential impact

  • Remote execution of arbitrary Java or operating system commands in the Valtimo server context
  • Exfiltration of credentials, API keys, and other sensitive configuration from environment variables or configuration stores
  • Access to or modification of documents, cases, and contracts managed by Valtimo
  • Pivoting to connected systems (databases, message brokers, third-party APIs) using retrieved credentials
  • Full compromise of the underlying application instance and potential lateral movement within the hosting environment

General mitigation guidance

Effective mitigation typically focuses on restricting expression evaluation and reducing the trust placed in user input:

  • Prefer non-executable configuration formats (e.g., plain data templates) over expression-based logic where possible.
  • When expressions are required, avoid evaluating raw user-supplied strings; instead, use whitelisted, pre-defined expression fragments or parameterized constructs.
  • Replace StandardEvaluationContext with a restricted evaluation context that does not expose arbitrary Java types or reflection, and avoid enabling features that resolve user-controlled type names.
  • Enforce strict separation between configuration and code: only trusted administrators should define expressions, and even then, the evaluation environment should be sandboxed.
  • Apply least-privilege principles to the application runtime (filesystem, network, and OS capabilities) so that any expression-level compromise has reduced impact.
  • Review administrative workflows to limit where and how executable expressions can be entered, persisted, or modified.

How teams detect issues like this

Detection can focus on both code-level patterns and runtime behavior:

  • Static analysis and code review:
  • Search for use of SpEL APIs (e.g., ExpressionParser, parseExpression, getValue) where expression strings are derived from user input or database fields.
  • Flag uses of StandardEvaluationContext (or similar) where the type resolver, method resolver, or property accessors are unrestricted.
  • Look for configuration or annotations that enable dynamic SpEL on user-controlled fields (e.g., template fields, dynamic rules).
  • Policy and configuration checks:
  • Enforce internal guidelines that prohibit evaluating untrusted expressions or require use of restricted evaluation contexts.
  • Implement CI/CD checks that scan for new uses of SpEL or other expression languages in sensitive modules.
  • Runtime monitoring:
  • Monitor application logs for SpEL evaluation errors or suspicious expression patterns.
  • Use application and host telemetry to detect unusual process execution, file access, or outbound connections originating from the Valtimo application process after expression evaluation.

Sources

SourceLink
github.comgithub.com/valtimo-platform/valtimo/security/advisories/GHSA-j7j9-5253-f7vh

Frequently asked

questions

It can be exploitable over the network, but only by users who can authenticate and hold the ADMIN role in the affected Valtimo instance. There is no anonymous or unauthenticated attack path described.

An attacker must be an authenticated ADMIN user. They need the ability to supply or modify data fields that are later evaluated as SpEL expressions by the document, case, or contract modules.

The safest pattern is to avoid evaluating user-controllable expressions entirely. Where expression support is required, use a heavily restricted evaluation context that does not expose arbitrary Java types or methods, and limit expressions to a predefined, trusted subset of operations.

Establish a rule that untrusted input must never be treated as executable code or expressions. Prefer declarative, data-only configuration; where dynamic logic is unavoidable, sandbox interpreters, restrict available APIs, and use automated reviews and static analysis to flag any new uses of dynamic evaluation engines such as SpEL.

Find out what's already
exploitable in your codebase.