Skip to content

fix: move prototype pollution guards inline for CodeQL taint analysis#3

Merged
anshultibby-at merged 2 commits intomainfrom
fix/prototype-pollution-codeql
Mar 26, 2026
Merged

fix: move prototype pollution guards inline for CodeQL taint analysis#3
anshultibby-at merged 2 commits intomainfrom
fix/prototype-pollution-codeql

Conversation

@anshultibby-at
Copy link
Copy Markdown
Collaborator

CodeQL's taint tracking does not recognise the batch Array.some() guard as protecting the downstream assignments. Moving the DANGEROUS_KEYS check immediately before each key-based write (inside the loop and before the final assignment) makes the guard visible to CodeQL's per-usage analysis, resolving alerts #2 and #3.

CodeQL's taint tracking does not recognise the batch Array.some() guard
as protecting the downstream assignments. Moving the DANGEROUS_KEYS
check immediately before each key-based write (inside the loop and
before the final assignment) makes the guard visible to CodeQL's
per-usage analysis, resolving alerts #2 and #3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CodeQL's sanitizer recognition for js/prototype-polluting-assignment
requires direct equality checks (=== '__proto__', etc.) immediately
before the computed property assignment. It does not recognise
Set.has() as an equivalent sanitizer, so the alerts remained open.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@anshultibby-at anshultibby-at merged commit 2f0d62b into main Mar 26, 2026
6 checks passed
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.

1 participant