Skip to content

Potential fix for code scanning alert no. 92: Prototype-polluting assignment #1018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

thisismayuresh
Copy link
Collaborator

Potential fix for https://github.com/implerhq/impler.io/security/code-scanning/92

To fix the issue, we need to prevent the use of special keys like __proto__, constructor, and prototype in the path array. This can be achieved by validating each key in the path array before using it to navigate or modify the obj object. If any key matches one of these special values, the function should throw an error or ignore the operation.

The best way to fix this is to add a validation step for path at the beginning of the setValue function. This ensures that no special keys are used, preventing prototype pollution.

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

…ignment

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Mayur Kaikadi <[email protected]>
Copy link

nx-cloud bot commented Jul 1, 2025

View your CI Pipeline Execution ↗ for commit 31e42db.

Command Status Duration Result
nx run-many --target=build --all ✅ Succeeded 20s View ↗

☁️ Nx Cloud last updated this comment at 2025-07-01 10:42:06 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant