Skip to content

fix(Network): guard reserved request IDs against prototype pollution - #739

Open
dvd233 wants to merge 1 commit into
Tencent:devfrom
dvd233:codex/fix-network-prototype-pollution-734
Open

dvd233 wants to merge 1 commit into
Tencent:devfrom
dvd233:codex/fix-network-prototype-pollution-734

Conversation

@dvd233

@dvd233 dvd233 commented Sep 13, 2026

Copy link
Copy Markdown

Summary

Fixes #734 by hardening VConsoleNetworkModel.updateRequest() against reserved and
inherited request IDs.

  • Reject __proto__, constructor, and prototype before any request data is merged.
  • Use an own-property check when deciding whether an existing request can be updated,
    so inherited names such as toString are not treated as stored requests.
  • Add a browser demo control that exercises both public network.update() and
    network.add() entry points and reports whether global prototypes remain unchanged.

Validation

  • npm run build (web bundle)
  • npm run build:wx (WeChat bundle)
  • npm run build:typings
  • npm pack --dry-run --json
  • Browser regression probe: reserved IDs are ignored, inherited IDs remain usable, and
    no marker is added to Object.prototype or Object.
  • git diff --check

No public API shape changes; ordinary request IDs and updates retain their existing
behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prototype Pollution in network.model.ts

1 participant