Skip to content

variant_utils: tighten MessagePack nesting limit#94

Merged
edsiper merged 1 commit into
masterfrom
agent/cfl-variant-depth-limit
Jul 21, 2026
Merged

variant_utils: tighten MessagePack nesting limit#94
edsiper merged 1 commit into
masterfrom
agent/cfl-variant-depth-limit

Conversation

@edsiper

@edsiper edsiper commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

  • tighten the CFL variant container nesting limit from 64 to 32
  • enforce the limit when entering arrays and maps, allowing primitive leaves at
    the exact boundary
  • extend coverage to arrays and maps at the accepted boundary and one level
    beyond it

Why

CTraces already bounded recursive MessagePack attribute decoding, but the
64-level limit remains high for downstream consumers such as Fluent Bit that
decode traces on relatively small coroutine stacks. Aligning the limit at 32
reduces stack usage and matches the corresponding CMetrics mitigation.

Validation

  • scripts/agent-test.sh -R '^ctr-test-decoding$'
  • scripts/agent-verify.sh (4/4 tests passed)
  • valgrind --quiet --error-exitcode=99 --leak-check=full --show-leak-kinds=definite,indirect ../build/agent/tests/ctr-test-decoding

The serialized format and helper entry points are unchanged. Values nested
beyond the tightened safety limit are now rejected.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@edsiper
edsiper marked this pull request as ready for review July 21, 2026 19:43
@edsiper
edsiper merged commit a3e6d81 into master Jul 21, 2026
22 checks passed
@edsiper
edsiper deleted the agent/cfl-variant-depth-limit branch July 21, 2026 19:43
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.

1 participant