Skip to content

fix(expr): reject trailing data after boolean expressions - #1609

Open
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:fix/expr-reject-trailing-data
Open

fix(expr): reject trailing data after boolean expressions#1609
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:fix/expr-reject-trailing-data

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

What changed

Fully decode top-level boolean expressions before returning AlwaysTrue or AlwaysFalse. This rejects malformed input containing a valid boolean followed by additional JSON or other trailing data.

Why

The expression decoder previously inspected only the first token for booleans. Inputs such as true false were therefore accepted even though they are not valid JSON values. Object expressions already reject trailing data through json.Unmarshal.

Testing

  • go test ./...

Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
@fallintoplace
fallintoplace requested a review from zeroshade as a code owner July 30, 2026 19:37
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.

1 participant