Isolate demo dependencies and pin orjson for CVE-2025-67221 mitigation#1173
Merged
jlarson4 merged 8 commits intoTransformerLensOrg:devfrom Feb 17, 2026
Merged
Conversation
Release v2.16.2
New Release – v2.17.0
304c804 to
1b64776
Compare
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.
Description
Fixes #1161 which identified CVE-2025-67221 affecting orjson versions reported as vulnerable in the advisory range (<=3.11.4), where deeply nested structures may trigger problematic recursion/resource behavior during orjson.dumps() and lead to process instability/DoS-style failures.
The risk path is transitive, not from direct
orjsonuse in core package code:gradio (dev dependency) -> orjsonGradio was previously in the shared dev dependency group, meaning many development environments pulled inorjsoneven when demo/web UI workflows were not being used.This repo supports Python >=3.8, but the safe orjson pin for this CVE is in newer versions (3.11.6+). Rather than raising the project-wide Python minimum, we split dependencies by use case:
orjsonChanges
pyproject.tomlgradiofrom the general dev dependency group.gradio(Python >=3.10)orjsonpin >=3.11.7,<4.0 (Python >=3.10)docs/source/content/contributing.md--with demoPros: We improve security without dropping broad runtime compatibility, and lower the risk footprint in default environments. We separate into groups of clearer dependency intent (core vs demo).
Cons: It adds one more dependency group (demo), and demo users have to opt in explicitly (--with demo).
Testing
Test 1: Install succeeds,
gradiois not installed andNoneis printedTest 2: Install succeeds,
orjsonresolves to >=3.11.7Type of change
Checklist: