Conversation
Contributor
ivicac
commented
May 24, 2026
- 5081 Harden Condition task dispatcher SpEL evaluation against injection RCE
- 5081 Reorganize
…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>
Contributor
There was a problem hiding this comment.
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 removeT(...)-based date-time parsing by binding parsedLocalDateTimevalues as variables. - Reorganize condition template constants and expression-building to support variable injection (
#dt*) for date-time comparisons. - Add
ConditionTaskUtilsTestcovering 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.