Skip to content

Rest _search endpoint accepts invalid json bodyΒ #28995

@jimczi

Description

@jimczi

This issue was first reported in #28985.
Any text after the last closing bracket is simply ignored by the request json parser. So for instance a request like:

{
  "query": {
          "term": {
            "ProductID": "one"
          }
  }
},
"field_after_last_bracket": {
}
}

... is accepted.
I don't know why we have this leniency which is why I am opening this issue as a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search/SearchSearch-related issues that do not fall into other categories>bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions