UNOMI-945: Fix context filter list sanitization and add tests#789
Merged
Conversation
…ue() Align with unomi-3.0.x #778: the list branch must return newValues so script:: and parameter:: entries are stripped from context filter payloads.
…tion Cover list-based script filtering (UNOMI-945), sanitize helpers, and persona overrides. Split from the fix commit so both can be cherry-picked independently onto unomi-3.0.x.
sanitizeCondition() computed newParameterValues but discarded it, returning the original Condition unchanged whenever no parameter sanitized entirely to null. A list parameter mixing safe and script::/parameter:: entries kept the malicious entries intact in the condition actually evaluated downstream. Apply the sanitized values and propagate them via setParameterValues().
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.
Summary
ContextJsonEndpoint.sanitizeValue()list fix fromunomi-3.0.x(#778): returnnewValuesinstead of the original list soscript::andparameter::entries are stripped from context filter payloads.ContextJsonEndpointTest) and an integration test (ContextServletIT#testMVELVulnerabilityWithListPropertyValues) covering list-based script injection in filter conditions.Commits (intentionally split for cherry-pick):
d610b0004— fix only (matches 3.0.x [UNOMI-945] fix bug in context endpoint user entry filtering #778)a53a9cde5— tests only (portable tounomi-3.0.xviagit cherry-pick a53a9cde5)Test plan
mvn -pl rest test -Dtest=ContextJsonEndpointTesttestMVELVulnerabilityWithListPropertyValues)