You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Schema JSON guard accepts non-JSON NaN and Infinity constants #1865
Schema(json_mode=True) allows unquoted NaN, Infinity, and -Infinity, including inside objects and arrays. A postflight pipeline consequently marks these invalid JSON outputs as allowed. The schema-number mode has the same parsing behavior.
Steps to reproduce
With the Python SDK from main at 1ed8bb7 (Python 3.13.7):
Configured deny/warn action with invalid_json, matching other invalid JSON syntax. Quoted strings such as "NaN" should still be allowed.
Cause and scope
Python's json.loads accepts these non-standard constants by default. Rejecting them through parse_constant keeps JSON parsing local to the Schema guard, without changing unrelated JSON consumers or adding a dependency.
Discovered through code inspection, then reproduced offline: 12 regression cases fail on current main and 6 valid-JSON controls pass. This is not a production incident report. Searched existing NaN/Infinity/parse_constant and Schema guard PRs. #1696 addresses Python booleans matching integer/number schemas, a separate type-checking issue.
Prepared with Codex assistance; reproduction executed locally.
Environment
OpenLIT Python SDK 1.45.0, source main at 1ed8bb7; Python 3.13.7 on macOS.
Pre-submission checklist
I searched existing issues and did not find a duplicate.
changed the title [-]Schema JSON guard accepts non-JSON NaN and Infinity constants[/-][+]Bug: Schema JSON guard accepts non-JSON NaN and Infinity constants[/+]on Oct 28, 2026
Activity
[-]Schema JSON guard accepts non-JSON NaN and Infinity constants[/-][+]Bug: Schema JSON guard accepts non-JSON NaN and Infinity constants[/+]