Repository navigation
fix: reject nonstandard JSON when wrapping evidence - #260
Merged
bruceweygandt merged 3 commits intoNov 10, 2026
Merged
Conversation
Resolve the CHANGELOG conflict by keeping both sides' Fixed entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bruceweygandt
approved these changes
Nov 10, 2026
bruceweygandt
left a comment
Contributor
There was a problem hiding this comment.
Thank you for this fix. I merged main into the branch to resolve the CHANGELOG conflict and kept both entries. The envelope tests (26), ruff and mypy on framework/, and the full suite all pass on the merge, and CI is green. Approved.
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.
Python's default JSON decoder accepts NaN/Infinity, so envelope wrapping can make invalid JSON look like normal collected evidence. Reject those constants before wrapping, and serialize new envelopes with allow_nan=False so metadata or numeric overflow cannot introduce non-finite output.
Preserve the original file and log the failure through the existing per-file skip behavior. Valid payloads and YAML date metadata retain their existing behavior. Includes regression coverage, a changelog entry and operator troubleshooting guidance.
Adapted from JSON qualification hardening by Cody Mitchell (@cmitchell-du) at Defense Unicorns. This contribution reuses the native envelope path. Timestamp ordering needs a separate shared contract and is proposed in #259.
Validation:
Scope: envelope wrapping only. This does not replace consumer qualification or add a universal timestamp/freshness rule, and it does not harden every separate uploader or legacy-artifact read path. Originals remain preserved rather than silently repaired.