Skip to content

5081 Harden Condition task dispatcher SpEL evaluation against injection RCE#5083

Open
ivicac wants to merge 2 commits into
masterfrom
5081
Open

5081 Harden Condition task dispatcher SpEL evaluation against injection RCE#5083
ivicac wants to merge 2 commits into
masterfrom
5081

Conversation

@ivicac
Copy link
Copy Markdown
Contributor

@ivicac ivicac commented May 24, 2026

  • 5081 Harden Condition task dispatcher SpEL evaluation against injection RCE
  • 5081 Reorganize

ivicac and others added 2 commits May 24, 2026 12:40
…on RCE

The condition dispatcher evaluated the raw `expression` parameter with a
bare SpelExpressionParser and the default StandardEvaluationContext,
permitting `T(...)` type references, constructors, bean references, and
reflective navigation via `getClass()` — a sink separate from the
SpelEvaluator hardening in #5035. Switch both the raw and templated paths
to SimpleEvaluationContext.forReadOnlyDataBinding().withInstanceMethods(),
which forbids those constructs by API contract and blocks methods declared
on Object/Class/ClassLoader via DataBindingMethodResolver. The DATE_TIME
templates relied on `T(java.time.LocalDateTime).parse(...)`; pre-parse
dates in Java and bind them as `#dt<n>` variables so the locked-down
context can be applied uniformly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hardens the Condition task dispatcher’s SpEL evaluation to mitigate SpEL injection/RCE (issue #5081) by switching evaluation to a restricted SpEL context, and adds regression/unit tests to validate blocked attack primitives and preserve expected condition behavior.

Changes:

  • Replace default SpEL evaluation with SimpleEvaluationContext + instance-method-only resolution and remove T(...)-based date-time parsing by binding parsed LocalDateTime values as variables.
  • Reorganize condition template constants and expression-building to support variable injection (#dt*) for date-time comparisons.
  • Add ConditionTaskUtilsTest covering both valid expressions/conditions and common SpEL injection payloads.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
server/libs/modules/task-dispatchers/condition/src/main/java/com/bytechef/task/dispatcher/condition/util/ConditionTaskUtils.java Switches SpEL evaluation to a restricted context and refactors date-time templates to use pre-parsed variables.
server/libs/modules/task-dispatchers/condition/src/test/java/com/bytechef/task/dispatcher/condition/util/ConditionTaskUtilsTest.java Adds regression and behavior tests for hardened raw-expression evaluation and condition evaluation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ivicac ivicac changed the title 5081 5081 Harden Condition task dispatcher SpEL evaluation against injection RCE May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: SpEL injection RCE in Condition dispatcher (condition/v1 rawExpression) — separate sink not covered by #5035

2 participants