-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Add support for parse stack limiting #1788
Copy link
Copy link
Closed
Labels
kind: enhancement/improvementstate: help neededthe issue needs help to proceedthe issue needs help to proceedstate: please discussplease discuss the issue or vote for your favorite optionplease discuss the issue or vote for your favorite optionstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated
Metadata
Metadata
Assignees
Labels
kind: enhancement/improvementstate: help neededthe issue needs help to proceedthe issue needs help to proceedstate: please discussplease discuss the issue or vote for your favorite optionplease discuss the issue or vote for your favorite optionstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated
Currently. jsonhpp doesn't support stack limiting for parsing. If you try to parse a string that starts with 100 000 '[' characters, it will most likely overflow stack and crash the whole thread. That makes it unsuitable for parsing untrusted json inputs without separating parser to separate binary, potentially with sandboxing.
Jsonhpp should keep track of the parse stack level, allow for configurable maximum level, and return runtime parsing error whenever stack limit io reached.