Skip to content

Return FieldDoesNotExist for query JSON paths containing a nul byte - #3243

Open
G26karthik wants to merge 1 commit into
quickwit-oss:mainfrom
G26karthik:fix/json-path-nul-query-panic
Open

G26karthik wants to merge 1 commit into
quickwit-oss:mainfrom
G26karthik:fix/json-path-nul-query-panic

Conversation

@G26karthik

Copy link
Copy Markdown
Contributor

QueryParser panics when a JSON path in a query contains a nul byte, for example json.a\0b:hello. A nul byte marks the end of the path in a JSON term, so the term is malformed and convert_to_fast_value_and_append_to_json_term hits its assert_eq.

The indexer already skips paths with a nul byte, so no such path exists in an index. I return QueryParserError::FieldDoesNotExist in compute_boundary_term and generate_literals_for_json_object.

The new test covers a term, a number, a phrase, a range and an IN set. It fails on main with the panic and passes now. cargo test --lib query::query_parser: 64 passed.

The indexer ignores JSON paths containing a nul byte, so no such path can
match. The query parser built a term from them anyway, and the stray
nul was read as the end of the path, which tripped an assert in
convert_to_fast_value_and_append_to_json_term.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T19:55:18.850082Z 672c3bd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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