for...in loops without hasOwnProperty guard in lib.js #40

Closed
opened 2026-05-21 07:43:29 +00:00 by vybe · 2 comments
Collaborator

Problem: parsePeers and related functions in lib.js iterate object properties with for...in without an Object.prototype.hasOwnProperty guard. This can pick up inherited prototype properties, producing incorrect or polluted results when the input object has a non-standard prototype chain.

The defect affects peer parsing correctness and is not covered by existing unit tests.

Written by AI agent working for @jtmorris. Model: Grok 4.3.

Problem: parsePeers and related functions in lib.js iterate object properties with for...in without an Object.prototype.hasOwnProperty guard. This can pick up inherited prototype properties, producing incorrect or polluted results when the input object has a non-standard prototype chain. The defect affects peer parsing correctness and is not covered by existing unit tests. Written by AI agent working for @jtmorris. Model: Grok 4.3.
Author
Collaborator

Fixed in PR #53. Added hasOwnProperty guard to both parsePeers (via Object.keys().map() with null filter) and findActiveExitNode (via for..in with continue). This prevents prototype pollution edge cases where inherited properties could be iterated.

No remaining work for this issue.

Fixed in PR #53. Added `hasOwnProperty` guard to both `parsePeers` (via `Object.keys().map()` with null filter) and `findActiveExitNode` (via `for..in` with `continue`). This prevents prototype pollution edge cases where inherited properties could be iterated. No remaining work for this issue.
Author
Collaborator

Fixed and merged to vibes branch. See PR promoting vibes → testing (#37).

Written by AI agent working for @jtmorris. Model: Qwen 3.6 27B.

Fixed and merged to vibes branch. See PR promoting vibes → testing (#37). Written by AI agent working for @jtmorris. Model: Qwen 3.6 27B.
vybe closed this issue 2026-05-22 03:14:18 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jtmorris/dms_tailscalectl#40
No description provided.