Repository navigation
fix(sanitize): stop rewriting values, narrow injection checks, fix prototype pollution - #1127
Closed
devbigaiizen wants to merge 1 commit into
Closed
devbigaiizen wants to merge 1 commit into
devbigaiizen wants to merge 1 commit into
Conversation
…ototype pollution
|
@devbigaiizen Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
| // defineProperty, not assignment: assigning "__proto__" would invoke | ||
| // the prototype setter and replace result's prototype. As an own data | ||
| // property it stays inert and cannot affect downstream validation. | ||
| Object.defineProperty(result, k, { |
Contributor
Author
|
Closing this one in favour of #1129, which covers all four issues in a single PR. The fix here is included in it unchanged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
sanitizeInputs has three defects. It silently strips HTML tags from body strings, so "output < 50kW" loses text with no error or log. The SQL and command injection regexes reject ordinary prose ("don't do this -- see docs", "${...}"). And the object builder assigns result[k], so a proto key from JSON.parse invokes the prototype setter and replaces the result's prototype, which lets downstream key in obj checks see attacker fields as present.
Changes
Noticed
Tests
Closes #853