Repository navigation
fix: ignore team and createdBy in dashboard and saved search PATCH - #3535
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 2f59b4f The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
| // A smuggled `team`/`createdBy` here would move the document between | ||
| // tenants / forge ownership (the model marks them immutable, but the | ||
| // write below reaches Mongo directly). | ||
| const { |
There was a problem hiding this comment.
🔵 minor — Controller guard can't be reached, throws (a 500) where the PR says the fields are ignored, and uses an as cast
updates is typed Partial<DashboardWithoutId>, which has no team/createdBy. The only caller (routers/api/dashboards.ts) re-parses and strips them, and the model now marks both immutable. So this branch never runs. If it ever did, it would return a 500, which contradicts the changeset's 'ignore' wording and the silent drop in controllers/savedSearch.ts. The as Record<string, unknown> cast also erases the type of safeUpdates, which breaks the 'avoid as casts' convention. Remove the block and spread updates, or at least drop the keys silently without the cast.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
PR Review
5 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 5 minor 1 posted as inline comment(s) on the changed lines. 4 listed below. Findings outside the changed lines4 minor
Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. The change correctly closes the reported vulnerability on the primary PATCH paths. For both resources the handler now re-parses the request body against a zod schema that does not declare 🟡 P2 -- recommended
🔵 P3 nitpicks (2)
Reviewers (9): correctness, security, adversarial, testing, maintainability, api-contract, kieran-typescript, project-standards, reliability. Testing gaps: No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
E2E Test Results✅ All tests passed • 462 passed • 1 skipped • 1774s
Tests ran across 4 shards in parallel. |
Summary
Backports security fixes from EE:
createdByandteamcan no longer be updated by dashboard PATCH requests.createdBycan no longer be updated by saved search PATCH requestsScreenshots or video
How to reproduce
Send PATCH dashboard or saved search API requests that include
createdByorteamand observe that the values are ignored.How to test on Vercel preview
References