Skip to content

Fixed possible stack overflow in parser#6433

Merged
alexey-milovidov merged 7 commits intomasterfrom
prevent-stack-overflow-in-parser
Aug 10, 2019
Merged

Fixed possible stack overflow in parser#6433
alexey-milovidov merged 7 commits intomasterfrom
prevent-stack-overflow-in-parser

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

@alexey-milovidov alexey-milovidov commented Aug 10, 2019

For changelog. Remove if this is non-significant change.

Category (leave one):

  • Bug Fix

Short description (up to few sentences):
Fixed the possibility of a fabricated query to cause server crash due to stack overflow in SQL parser. Fixed the possibility of stack overflow in Merge and Distributed tables, materialized views and conditions for row-level security that involve subqueries.

@alexey-milovidov alexey-milovidov added security pr-bugfix Pull request with bugfix, not backported by default labels Aug 10, 2019
@alexey-milovidov
Copy link
Copy Markdown
Member Author

TODO:

perl -e 'print "SELECT 1" . ("+1" x 10000) ' | curl 'http://localhost:8123/' -d @-

@alexey-milovidov
Copy link
Copy Markdown
Member Author

We also have known stack overflows in:

  • condition for row-level security involving a subquery on the same table;
  • Merge table over another Merge tables that will make a loop;
  • Distributed table with local shard that points to the same Distributed table;
  • hierarchical dictionaries with a loop.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Everything is solved except:

hierarchical dictionaries with a loop.

@alexey-milovidov alexey-milovidov merged commit 838c5e5 into master Aug 10, 2019
tavplubix pushed a commit that referenced this pull request Aug 13, 2019
tavplubix pushed a commit that referenced this pull request Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants