fix: prototype pollution and shallow freeze in SkillFollowups.get()#558
fix: prototype pollution and shallow freeze in SkillFollowups.get()#558anandgupta42 merged 1 commit intomainfrom
SkillFollowups.get()#558Conversation
Adversarial testing for v0.5.14 release found 2 bugs:
1. **Prototype pollution:** `FOLLOWUPS["__proto__"]` traversed
`Object.prototype` instead of returning `[]`. Fixed with
`Object.hasOwn()` guard.
2. **Shallow freeze:** `Object.freeze()` on the array didn't freeze
nested suggestion objects, allowing shared state mutation across
callers. Fixed with deep copy via `Object.freeze({ ...s })`.
Includes 52 adversarial tests covering injection attacks, boundary
values, immutability, concurrency, and data integrity for
`SkillFollowups`, `Locale.duration`, and `Dispatcher.reset`.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 14 minutes and 54 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
What does this PR do?
Fixes 2 bugs found during v0.5.14 release adversarial testing in
SkillFollowups.get():FOLLOWUPS["__proto__"]traversedObject.prototypeinstead of returning[]. Fixed withObject.hasOwn()guard.Object.freeze()on the array didn't freeze nested suggestion objects, allowing shared state mutation across callers. Fixed with deep copy viaObject.freeze({ ...s }).Adds 52 adversarial tests covering:
__proto__,constructor, SQL, XSS, path traversal, null bytes), boundary values (100K char names, 1000 rapid calls, unicode), immutability (frozen array, frozen objects, mutation isolation), data integrity (no cycles, valid skill names, non-empty fields)Type of change
Issue for this PR
Closes #557
How did you verify your code works?
All 52 new adversarial tests pass:
Existing skill tests (97 total) still pass:
Broader regression (altimate + util suites):
Checklist
mock.module, no timing deps, no shared state)bun run script/upstream/analyze.ts --markers --strict)