Skip to content

Potential fix for code scanning alert no. 3: Prototype-polluting assignment - #26

Closed
BilgeGates wants to merge 1 commit into
mainfrom
prototype-polluting-assignment
Closed

Potential fix for code scanning alert no. 3: Prototype-polluting assignment#26
BilgeGates wants to merge 1 commit into
mainfrom
prototype-polluting-assignment

Conversation

@BilgeGates

@BilgeGates BilgeGates commented Jul 15, 2026

Copy link
Copy Markdown
Member

General fix: enforce strict runtime validation of computed indices before any property access/assignment, so only safe integer indices 0..7 are ever used. This prevents special keys (__proto__, constructor, prototype) and other non-integer/coerced values from reaching assignment sinks.

Best fix here (without changing functionality): strengthen resolve in src/board.ts to reject non-integer numeric tuple values using Number.isInteger before range checks. This keeps existing API/behavior for valid inputs (strings resolved by squareToIndices, or numeric tuples) while closing prototype-pollution-style dynamic key abuse paths. No new imports or dependencies are required.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions github-actions Bot added needs-triage area: board-utils Board manipulation helpers (move, flip, material) and removed needs-triage labels Jul 15, 2026
@BilgeGates
BilgeGates marked this pull request as ready for review July 15, 2026 18:57
Copilot AI review requested due to automatic review settings July 15, 2026 18:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@BilgeGates BilgeGates closed this Jul 15, 2026
@BilgeGates
BilgeGates deleted the prototype-polluting-assignment branch July 15, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: board-utils Board manipulation helpers (move, flip, material)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants