Skip to content

Potential fix for code scanning alert no. 4: Prototype-polluting function - #3

Merged
ShadowDara merged 1 commit into
mainfrom
alert-autofix-4-prototype-pollution
Sep 9, 2026
Merged

ShadowDara merged 1 commit into
mainfrom
alert-autofix-4-prototype-pollution

Conversation

@ShadowDara

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/ShadowDara/finder/security/code-scanning/4

The best fix is to harden setPath by rejecting dangerous path segments before any recursive assignment.
In this file, update setPath (around lines 118–127) to:

  • Define blocked keys: __proto__, constructor, prototype.
  • Abort assignment if any segment in parts is blocked.
  • Keep existing behavior for valid paths unchanged.

This preserves functionality for normal config keys while preventing prototype chain mutation through malicious paths.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…tion

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@ShadowDara
ShadowDara marked this pull request as ready for review September 9, 2026 14:27
@ShadowDara
ShadowDara merged commit 00cb5ff into main Sep 9, 2026
8 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