Skip to content

JSON5 still bundled through upload helper after #6339, exposing embedded core-js 2.6.5 #7163

Closed

Description

@PJ-Snap

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:

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

  1. Build/export a Reflex 0.9.10.post1 app that includes the normal frontend runtime.

  2. Search the emitted JavaScript assets for version:"2.6.5" or __core-js_shared__.

  3. Load the app and run:

    globalThis['__core-js_shared__']?.versions
  4. 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);

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 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

  1. linear-code commented on Sep 16, 2026

    @linear-code
  2. self-assigned this
    on Sep 16, 2026
  3. added a commit that references this issue on Sep 16, 2026
    11628ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions