Skip to content

Commit 0c4fc3c

Browse files
committed
feat: introduce maximum parser recursion depth
Add a recursion depth limit to prevent stack overflow vulnerabilities when parsing deeply nested Jsonnet expressions. This addresses potential denial-of-service attacks where malicious inputs with excessive nesting could crash the parser. Key changes: - Introduce MAX_PARSER_DEPTH constant (1000) to limit parser recursion - Add depth parameter to all parsing functions - Check depth limit before parsing recursively nested structures - Throw clear error message when maximum depth is exceeded - Improve documentation for parsing functions - Add test case to verify limit enforcement Signed-off-by: Ville Vesilehto <[email protected]>
1 parent 5b50746 commit 0c4fc3c

File tree

3 files changed

+151
-65
lines changed

3 files changed

+151
-65
lines changed

0 commit comments

Comments
 (0)