for...in without hasOwnProperty/Object.keys guard in lib.js (prototype-chain risk) #20
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
findActiveExitNode(lib.js:20) iterates a peer map with:This traverses the prototype chain. While currently safe for plain objects returned by
JSON.parse, it is fragile against any futureObject.prototypepollution, polyfills, or unexpected enumerable properties. The recommended pattern isObject.keys(peerMap).forEach(...)orfor...of Object.keys(...).Impact
The code is not robust against prototype-chain pollution. A single bad polyfill or future change could cause
findActiveExitNodeto process inherited properties as if they were peers.Added hasOwnProperty/Object.keys guard in lib.js for-in loops. Merged to vibes.
Resolved via merge
2cee873. The plugin is confirmed working by @jtmorris. Human code review required before merging to testing.