Repository navigation
Description
Describe the bug
Reflex 0.9.2 announced that the JSON5 frontend dependency was removed in #6339. That change removed json5 from the installer dependencies and replaced JSON5.parse in the socket parser, but the upload helper still imports and calls JSON5:
import JSON5 from "json5";
// ...
const chunk = JSON5.parse(chunk_json);This remains present in v0.9.10.post1 and on current main:
- https://github.com/reflex-dev/reflex/blob/v0.9.10.post1/packages/reflex-base/src/reflex_base/.templates/web/utils/helpers/upload.js#L1
- https://github.com/reflex-dev/reflex/blob/main/packages/reflex-base/src/reflex_base/.templates/web/utils/helpers/upload.js#L1
Although JSON5 is no longer declared directly by Reflex, [email protected] can still resolve transitively (for example through Babel). Its package metadata selects dist/index.js for browser builds. That legacy browser distribution embeds core-js 2.6.5, so production Reflex bundles can execute and expose it through globalThis['__core-js_shared__']?.versions.
This is being reported by security assessment tooling as an outdated software supply-chain component. I have not found a reviewed GHSA specific to core-js 2.6.5, so this issue is not claiming an unverified CVE; the concrete security concern is that Reflex unintentionally ships an obsolete embedded runtime after the dependency was documented as removed.
To Reproduce
-
Build/export a Reflex 0.9.10.post1 app that includes the normal frontend runtime.
-
Search the emitted JavaScript assets for
version:"2.6.5"or__core-js_shared__. -
Load the app and run:
globalThis['__core-js_shared__']?.versions
-
Observe a core-js 2.6.5 entry. In the tested production build, the code is inside the bundle containing Reflex state/upload helpers and can be traced to JSON5's UMD browser distribution.
The installed Reflex template also demonstrates the remaining ownership directly:
reflex_base/.templates/web/utils/helpers/upload.js:1: import JSON5 from "json5";
reflex_base/.templates/web/utils/helpers/upload.js:50: const chunk = JSON5.parse(chunk_json);
- Code/Link to Repo: refactor: drop json5 dep, handle non-finite floats in socket parse fallback #6339 and the upload-helper links above.
Expected behavior
The upload helper should not import JSON5 after Reflex's JSON5 dependency removal. Upload-response parsing should use the framework's maintained native JSON parsing path, including whatever handling is required for Python non-finite float values, and exported browser assets should no longer contain JSON5's embedded core-js 2.6.5 implementation.
Ideally, CI should also build the frontend and assert that the removed dependency is absent from emitted browser assets, since checking only the direct dependency manifest does not catch prebundled or transitively resolved code.
Screenshots
Not applicable. The console output and emitted bundle are sufficient to reproduce it.
Specifics (please complete the following information):
- Python Version: 3.13
- Reflex Version: 0.9.10.post1
- OS: Reproduced in a Linux production build; source inspection also performed on Windows
- Browser (Optional): Chromium
Additional context
- The v0.9.2 release notes state “Drop JSON5 frontend dependency”: https://github.com/reflex-dev/reflex/releases/tag/v0.9.2
- PR refactor: drop json5 dep, handle non-finite floats in socket parse fallback #6339 changed
state.jsand the installer dependency list, but notutils/helpers/upload.js: https://github.com/reflex-dev/reflex/pull/6339/files - JSON5 2.2.3 is currently the latest published JSON5 release. Its
browserentry isdist/index.js, whose generated UMD bundle includes core-js 2.6.5; its ESM distribution does not include that polyfill payload.
The durable fix appears to be completing the removal in Reflex rather than adding a downstream core-js override: an override cannot replace core-js code already embedded inside JSON5's published browser bundle.
Activity
linear-code commentedon Sep 16, 2026
ENG-12479
Extract JSON parsing helper to eliminate json5 dependency (reflex-dev…