Skip to content
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

fix(aws-serverless): Remove possible prototype pollution source #14110

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

AbhiPrasad
Copy link
Member

Fixes https://github.com/getsentry/sentry-javascript/security/code-scanning/307

To fix the prototype pollution issue, we need to ensure that the handlerName does not include any special properties like __proto__, constructor, or prototype. We can achieve this by adding a check to filter out these properties before performing the assignment.

  1. Add a check to ensure handlerName does not include __proto__, constructor, or prototype.
  2. If handlerName includes any of these properties, log an error and return without making the assignment.

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

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@AbhiPrasad AbhiPrasad changed the title Fix code scanning alert no. 307: Prototype-polluting assignment fix(aws-serverless): Remove possible prototype pollution source Oct 29, 2024
@AbhiPrasad AbhiPrasad marked this pull request as ready for review October 29, 2024 02:44
@AbhiPrasad AbhiPrasad requested review from a team, stephanie-anderson and chargome and removed request for a team October 29, 2024 02:44
Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

seems reasonable to me!

@AbhiPrasad AbhiPrasad merged commit c98377b into develop Oct 29, 2024
130 checks passed
@AbhiPrasad AbhiPrasad deleted the alert-autofix-307 branch October 29, 2024 15:21
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.

None yet

3 participants