fix: upgrade kysely to 0.28.14 to fix SQL injection vulnerability#28601
fix: upgrade kysely to 0.28.14 to fix SQL injection vulnerability#28601sean-brydon wants to merge 1 commit intomainfrom
Conversation
Co-Authored-By: sean@cal.com <Sean@brydon.io>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
mahdirajaee
left a comment
There was a problem hiding this comment.
The kysely version bump from 0.28.2 to 0.28.14 is a patch-level upgrade within the same minor, so the API surface should be stable and breaking changes are unlikely. The security fix is the primary motivation and the version bump itself looks straightforward.
However, the yarn.lock diff has a concerning artifact: @calcom/lyra's dependency specifiers changed from workspace:* to npm:* for @calcom/lib, @calcom/prisma, and @calcom/types. The PR description flags this too. While these still resolve to 0.0.0-use.local currently, npm:* specifiers in a monorepo are semantically different from workspace:* — they could resolve to a published registry version instead of the local workspace package if the resolution context changes (e.g., during a publish or in a different package manager version). This looks like it was introduced accidentally, possibly by running yarn install with a slightly different Yarn version or config. I'd recommend reverting those three lines in the lockfile to keep workspace:*.
The createdAt test change from Date to .toISOString() is correct if the upstream type now expects a string, but as the PR description itself notes, updatedAt: now on the very next line was left as a Date object. If the type contract changed for createdAt, it likely changed for updatedAt too — this should be verified to avoid a latent type error that might only surface when stricter checks are enabled.
What does this PR do?
Upgrades
kyselyfrom0.28.2to0.28.14to address a direct SQL injection vulnerability. The new version includes security patches for unsafe query construction.Changes
packages/kysely/package.json: Bumpedkyselyfrom0.28.2→0.28.14apps/web/components/booking/BookingListItem.tsx: Replaced directAssignmentReasonPrisma type import with a locally-derivedBookingAssignmentReasontype from./types, decoupling this component from@calcom/prisma/clientapps/web/components/booking/types.ts: AddedBookingAssignmentReasontype derived from the tRPC router output (BookingItem["assignmentReasonSortedByCreatedAt"][number])apps/web/components/booking/actions/bookingActions.test.ts: UpdatedcreatedAtmock value fromnew Date()tonew Date().toISOString()to match the updated type expectations from the kysely upgradeyarn.lock: Updated lockfile for kysely version changeyarn.lockartifact: The lockfile diff shows@calcom/lyra's dependency specifiers changed fromworkspace:*tonpm:*for@calcom/lib,@calcom/prisma, and@calcom/types. These still resolve to0.0.0-use.local(local workspace), but please verify this doesn't affect monorepo package resolution.Type equivalence:
BookingAssignmentReason(derived from tRPC output) replacesAssignmentReason(from Prisma client). Verify these are structurally compatible.Partial test update: Only
createdAtwas changed to.toISOString()in the test mock, butupdatedAt: nowon the next line was left as aDateobject. Confirm whetherupdatedAtalso needs the same treatment.Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
yarn installand verify it completes without errorsyarn type-check:ci --force— no new type errors should be introducedyarn test— all unit tests should pass (particularlybookingActions.test.ts)kyselyresolves to0.28.14:yarn why kyselyBookingListItemrenders assignment reason badges correctly (if accessible in local dev)Link to Devin session: https://app.devin.ai/sessions/e3558211aacf45a793fc2d60428fb42e
Requested by: @sean-brydon