Skip to content

Add nesting depth limit to msgpack and CSEXP parsers#377

Merged
vstakhov merged 1 commit intovstakhov:masterfrom
MarkLee131:fix/msgpack-csexp-depth-limit
Apr 8, 2026
Merged

Add nesting depth limit to msgpack and CSEXP parsers#377
vstakhov merged 1 commit intovstakhov:masterfrom
MarkLee131:fix/msgpack-csexp-depth-limit

Conversation

@MarkLee131
Copy link
Copy Markdown
Contributor

Fix #376: The UCL text parser enforces a nesting depth limit, but the msgpack and CSEXP parsers had none. Deeply nested input could allocate heap memory without bound.

Add a UCL_MAX_NESTING limit (1024) to both parsers, matching the pattern used by the UCL text parser. Also count depth in the CSEXP parser's read_obrace/read_ebrace states.

The UCL text parser enforces a nesting depth limit, but the msgpack
and CSEXP parsers had none. Deeply nested input could allocate heap
memory without bound.

Add a UCL_MAX_NESTING limit (1024) to both parsers, matching the
pattern used by the UCL text parser. Also count depth in the CSEXP
parser's read_obrace/read_ebrace states.
@vstakhov vstakhov merged commit 318574a into vstakhov:master Apr 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Msgpack and CSEXP parsers lack nesting depth limit

2 participants