chore: migrate to oxlint - #98
Conversation
|
Hey @copilot, please review this PR |
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ecc20354d2
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ...prevState, | ||
| [key]: clone(input[key]), | ||
| }), | ||
| (prevState, key) => Object.assign(prevState, { [key]: clone(input[key]) }), |
There was a problem hiding this comment.
Preserve
__proto__ as an own property when cloning
When input has an own enumerable __proto__ property, such as an object returned by JSON.parse, Object.assign invokes the inherited __proto__ setter instead of defining that property. Consequently, clone(input) drops the own key and gives the clone an attacker-controlled prototype (for example, a supplied polluted property becomes inherited), whereas the previous object-spread reducer preserved the data safely.
Useful? React with 馃憤聽/ 馃憥.
|
|
||
| return { | ||
| ...state, | ||
| return Object.assign(state, { |
There was a problem hiding this comment.
Preserve
__proto__ keys in merged objects
When either merged object contains an own enumerable __proto__ key, for example from untrusted JSON, this assignment invokes Object.prototype.__proto__'s setter. The merged result therefore loses the own key and acquires the supplied object as its prototype, allowing attacker-controlled inherited properties to affect consumers; the previous spread expression defined __proto__ as an ordinary own property.
Useful? React with 馃憤聽/ 馃憥.
No description provided.