Skip to content

enforce recursion depth limit on map values in types.Skip - #727

Open
itecz26 wants to merge 1 commit into
meta:mainfrom
itecz26:go-skip-map-value-depth
Open

itecz26 wants to merge 1 commit into
meta:mainfrom
itecz26:go-skip-map-value-depth

Conversation

@itecz26

@itecz26 itecz26 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

in types.Skip the MAP branch skips the value with self.Skip(valueType), which re-enters through SkipDefaultDepth at DEFAULT_RECURSION_DEPTH instead of maxDepth-1, so the depth guard resets on every map value and never trips for map-value nesting (the key/set/list/struct branches all decrement via Skip(self, ..., maxDepth-1)); a ~60MB frame of nested map<byte, map<...>>, well under MaxFrameSize, then recurses until the goroutine stack overflows and the process dies with fatal error: stack overflow, reachable pre-auth from the unknown-method skip path in process(). decrement depth on the value like the key already does, matching the java/rust skip helpers, so deep nesting hits DEPTH_LIMIT at 64 across all four formats.

@meta-cla meta-cla Bot added the CLA Signed label Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant