An issue was discovered in Elasticsearch where a specially crafted search query can drive uncontrolled recursion in a specific internal component. An authenticated user with read access can submit a query that exhausts the available thread stack memory. This results in a fatal error that abruptly terminates the node process, leading to a denial of service.
Upgrade Elasticsearch versions 9.5.0 through 9.5.4 to 9.5.5.