fix(conformance): reject excessive JSON nesting before decoder - #1330
Merged
Conversation
Contributor
|
Warning Review limit reachedNext included review available in 44 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
seonghobae
marked this pull request as ready for review
August 24, 2026 21:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1329.
Defect
ConformanceInventory.from_json()enforces UTF-8 and byte-size admission and validates parsed-container nesting afterjson.loads(...), but a deeply nested syntactically valid manifest could enter Python's recursive decoder before the package-ownedMAX_MANIFEST_NESTINGcontract was applied.The prior attempt in #1319 was not reused as a branch: its live head had been incompatibly reconstructed to revert protected-main functionality and had lost its focused regression/changelog. #1319 was closed unmerged. This PR replays only the validated JSON-depth intent from a clean protected-main lineage.
RED → GREEN lineage
c773c2f6f96e630f3dd49a5ac66d466fef3f4b76: monkeypatchjson.loadsand prove over-budget structural nesting fails before the decoder; pin the exact depth boundary and quoted-string/escape behavior.3c383b889bf58a10efa3435e1264bc2a0fa60f6b: add raw structural-depth scanning after exact text/UTF-8/byte admission and beforejson.loads.4fa1288d48dbec52ab361744585366e8f5085345.The existing duplicate-member rejection, non-finite constant rejection, iterative post-parse depth validation, strict manifest replay, canonicality, and inventory-fingerprint checks remain unchanged.
Concurrent lineage reconciliation
The branch later advanced compatibly to exact head
961e416fc0f0550665c017a30edf0e3b866c7c1cby incorporating unrelated statistical-study/recovery/CI-contract changes. Comparing that live head against current protectedmain@66bec7e551eb82dd41338deb5c8374ff4557ceefleaves the effective conformance delta exactly three files:python/fast_mlsirm/cross_engine_conformance.py,tests/test_cross_engine_conformance_json_depth.py, anddocs/changelog.d/1329-conformance-json-depth.md(8 commits ahead / 2 behind, merge basec26dac4bcdb7d600a2688c3e74eb4a68c0b45620). The later main release-cut/accessibility commits do not overlap this conformance surface.Scope / scientific ownership
Python security/replay validation only. No likelihood, estimator, scoring, uncertainty, recovery, cross-engine discrepancy arithmetic, or other production psychometric/statistical calculation changes. Rust-first numerical ownership is unaffected.
Current integration boundary
This PR is now Ready for review, open and mergeable at exact head
961e416fc0f0550665c017a30edf0e3b866c7c1c. Exact-head repository-local CI, Security Scan, CodeQL, and SAST Semgrep are all terminalsuccess; formal reviews and review threads were empty immediately before the Ready transition.Ready is not merge authority. The branch is two unrelated protected-main commits behind, so base-sensitive/merge-result evidence must be refreshed before landing. Require every applicable protected central coverage/review/package/SBOM/provenance/dependency context and effective independent approval before merge. No force update, gate weakening, review dismissal, or self-approval is used.