-
-
Notifications
You must be signed in to change notification settings - Fork 598
fix: GHSA-9g8m-v378-pcg3 #2745
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
base: alpha
Are you sure you want to change the base?
fix: GHSA-9g8m-v378-pcg3 #2745
Conversation
🚀 Thanks for opening this pull request! |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
📝 WalkthroughWalkthroughPrototype-safe state storage was introduced by replacing {} with Object.create(null) in SingleInstanceStateController and adding a new exported removeState(obj) API. Related tests for prototype pollution scenarios were added. Two other files received quote/style-only changes without behavior modifications. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant StateCtrl as SingleInstanceStateController
participant Store as objectState (prototype-free)
rect rgb(235, 245, 255)
note right of Store: All maps use Object.create(null)
Caller->>StateCtrl: getState(obj)
StateCtrl->>Store: ensure className/id containers
Store-->>StateCtrl: State (created if missing)
StateCtrl-->>Caller: State
end
rect rgb(240, 250, 240)
Caller->>StateCtrl: removeState(obj)
StateCtrl->>Store: delete state for className/id
Store-->>StateCtrl: Removed State or null
StateCtrl-->>Caller: State \| null
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used🧬 Code graph analysis (2)src/ObjectStateMutations.ts (3)
src/SingleInstanceStateController.ts (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #2745 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 63 63
Lines 6185 6185
Branches 1456 1456
=========================================
Hits 6185 6185 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8cbe1fb
to
ee630ff
Compare
@mtrezza ready to review |
Pull Request
Issue
Closes: GHSA-9g8m-v378-pcg3
Approach
Use Object create null
Tasks
Summary by CodeRabbit