Skip to content

Conversation

@mayya-sharipova
Copy link
Contributor

Parsing a hugely nested mapping can lead to stack overflow errors.
This PR introduces a protection against this by tracking the depth level
while parsing a object in the mapping, and throwing an error if the max depth
level is exceeded.

Currently we do have a protection against super deep object introduced
in #90285. But this protection is happening during dynamic mapping
update, when the mapping is already parsed. To avoid stack overflow
during parsing, we need this change as well.

Closes #52098

@mayya-sharipova mayya-sharipova added >bug :Search Foundations/Mapping Index mappings, including merging and defining field types v8.9.0 labels May 1, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label May 1, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@elasticsearchmachine
Copy link
Collaborator

Hi @mayya-sharipova, I've created a changelog YAML for you.

@mayya-sharipova mayya-sharipova marked this pull request as draft May 1, 2023 17:26
Parsing a hugely nested mapping can lead to stack overflow errors. This PR introduces a protection against this by tracking the depth level while parsing a object in the mapping, and throwing an error if the max depth level is exceeded. Currently we do have a protection against super deep object introduced in elastic#90285. But this protection is happening during dynamic mapping update, when the mapping is already parsed. To avoid stack overflow during parsing, we need this change as well. Closes elastic#52098
@mayya-sharipova mayya-sharipova marked this pull request as ready for review May 1, 2023 18:15
@mayya-sharipova mayya-sharipova force-pushed the stack-overflow-mapping branch from c16c5d9 to 91774bd Compare May 1, 2023 18:15
@elasticsearchmachine
Copy link
Collaborator

Hi @mayya-sharipova, I've created a changelog YAML for you.

@mayya-sharipova mayya-sharipova force-pushed the stack-overflow-mapping branch from f38127d to 7bf075f Compare May 2, 2023 17:53
Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Mayya! I left a couple more comments.

@mayya-sharipova
Copy link
Contributor Author

@romseygeek Thanks for the review so far, do you have further comments for this PR?

Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @mayya-sharipova

@mayya-sharipova mayya-sharipova merged commit 5bc7d26 into elastic:main May 24, 2023
@mayya-sharipova mayya-sharipova deleted the stack-overflow-mapping branch May 24, 2023 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v8.9.0

3 participants