Skip to content

Commit f4adb20

Browse files
bchapuisclaude
andcommitted
Fix security vulnerabilities by upgrading drizzle-orm, hono, and vite
Upgrade drizzle-orm 0.44.5→0.45.2 (SQL injection fix), hono ^4.12.2→^4.12.12 (cookie/IP/path traversal fixes), vite ^7.3.1→^7.3.2 (WebSocket file read, fs.deny bypass fixes), and drizzle-kit 0.31.1→0.31.10 for compatibility. Add non-null assertions to c.req.param() calls to satisfy drizzle-orm 0.45's stricter types. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 456fabb commit f4adb20

10 files changed

Lines changed: 89 additions & 377 deletions

File tree

apps/api/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@types/node": "^22.19.7",
3030
"@types/three": "^0.181.0",
3131
"@types/wellknown": "^0.5.8",
32-
"drizzle-kit": "0.31.1",
32+
"drizzle-kit": "0.31.10",
3333
"globals": "^15.15.0",
3434
"partyserver": "^0.3.3",
3535
"typescript": "^5.9.3",
@@ -61,10 +61,10 @@
6161
"aws4fetch": "^1.0.20",
6262
"cloudflare": "^5.2.0",
6363
"cron-parser": "^5.4.0",
64-
"drizzle-orm": "0.44.5",
64+
"drizzle-orm": "0.45.2",
6565
"exifreader": "^4.36.0",
6666
"geotiff": "^2.1.3",
67-
"hono": "^4.12.2",
67+
"hono": "^4.12.12",
6868
"jose": "^6.1.3",
6969
"jsonpath-plus": "^10.3.0",
7070
"mailparser": "^3.9.1",

apps/api/src/routes/databases.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ databaseRoutes.delete("/:id", async (c) => {
184184
* Get the schema of a database (tables, columns, foreign keys)
185185
*/
186186
databaseRoutes.get("/:databaseId/schema", apiKeyOrJwtMiddleware, async (c) => {
187-
const databaseId = c.req.param("databaseId");
187+
const databaseId = c.req.param("databaseId")!;
188188
const { organizationId } = getAuthContext(c);
189189

190190
const databaseService = new CloudflareDatabaseService(c.env);

apps/api/src/routes/endpoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ endpointRoutes.on(
201201
apiKeyOrJwtMiddleware,
202202
(c, next) => createRateLimitMiddleware(c.env.RATE_LIMIT_EXECUTE)(c, next),
203203
async (c) => {
204-
const id = c.req.param("id");
204+
const id = c.req.param("id")!;
205205
const db = createDatabase(c.env.DB);
206206
const { organizationId, userId } = getAuthContext(c);
207207

apps/api/src/routes/executions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const executionRoutes = new Hono<ApiContext>();
1919

2020
executionRoutes.get("/:id", apiKeyOrJwtMiddleware, async (c) => {
2121
const organizationId = c.get("organizationId")!;
22-
const id = c.req.param("id");
22+
const id = c.req.param("id")!;
2323

2424
if (!isUuid(id)) {
2525
return c.json({ error: "Invalid execution ID format" }, 400);

apps/api/src/routes/oauth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ oauthRoutes.get(
6161
jwtMiddleware,
6262
resolveOrgFromQuery,
6363
async (c) => {
64-
const providerName = c.req.param("provider");
64+
const providerName = c.req.param("provider")!;
6565

6666
try {
6767
const provider = getProvider(providerName);

apps/api/src/routes/workflows.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ workflowRoutes.post(
193193
* Get a specific workflow by ID
194194
*/
195195
workflowRoutes.get("/:id", jwtMiddleware, async (c) => {
196-
const id = c.req.param("id");
196+
const id = c.req.param("id")!;
197197
const organizationId = c.get("organizationId")!;
198198
const userId = c.var.jwtPayload?.sub;
199199

@@ -248,7 +248,7 @@ workflowRoutes.put(
248248
}) as z.ZodType<UpdateWorkflowRequest>
249249
),
250250
async (c) => {
251-
const id = c.req.param("id");
251+
const id = c.req.param("id")!;
252252
const workflowStore = new WorkflowStore(c.env);
253253

254254
const organizationId = c.get("organizationId")!;
@@ -357,7 +357,7 @@ workflowRoutes.put(
357357
* Delete a workflow by ID
358358
*/
359359
workflowRoutes.delete("/:id", jwtMiddleware, async (c) => {
360-
const id = c.req.param("id");
360+
const id = c.req.param("id")!;
361361
const workflowStore = new WorkflowStore(c.env);
362362

363363
const organizationId = c.get("organizationId")!;
@@ -440,7 +440,7 @@ workflowRoutes.on(
440440
jwtMiddleware,
441441
(c, next) => createRateLimitMiddleware(c.env.RATE_LIMIT_EXECUTE)(c, next),
442442
async (c) => {
443-
const workflowId = c.req.param("workflowId");
443+
const workflowId = c.req.param("workflowId")!;
444444
const { organizationId } = getAuthContext(c);
445445

446446
const workflowStore = new WorkflowStore(c.env);
@@ -490,7 +490,7 @@ workflowRoutes.on(
490490
jwtMiddleware,
491491
(c, next) => createRateLimitMiddleware(c.env.RATE_LIMIT_EXECUTE)(c, next),
492492
async (c) => {
493-
const workflowId = c.req.param("workflowId");
493+
const workflowId = c.req.param("workflowId")!;
494494
const { organizationId } = getAuthContext(c);
495495

496496
const workflowStore = new WorkflowStore(c.env);
@@ -527,7 +527,7 @@ workflowRoutes.post(
527527
jwtMiddleware,
528528
async (c) => {
529529
const organizationId = c.get("organizationId")!;
530-
const executionId = c.req.param("executionId");
530+
const executionId = c.req.param("executionId")!;
531531
const executionStore = new CloudflareExecutionStore(c.env);
532532

533533
// Get the execution to verify it exists and belongs to this organization
@@ -614,7 +614,7 @@ workflowRoutes.post(
614614
* Get queue trigger for a workflow
615615
*/
616616
workflowRoutes.get("/:workflowId/queue-trigger", jwtMiddleware, async (c) => {
617-
const workflowId = c.req.param("workflowId");
617+
const workflowId = c.req.param("workflowId")!;
618618
const organizationId = c.get("organizationId")!;
619619
const workflowStore = new WorkflowStore(c.env);
620620
const db = createDatabase(c.env.DB);
@@ -655,7 +655,7 @@ workflowRoutes.put(
655655
jwtMiddleware,
656656
zValidator("json", UpsertQueueTriggerRequestSchema),
657657
async (c) => {
658-
const workflowId = c.req.param("workflowId");
658+
const workflowId = c.req.param("workflowId")!;
659659
const organizationId = c.get("organizationId")!;
660660
const data = c.req.valid("json");
661661
const db = createDatabase(c.env.DB);
@@ -718,7 +718,7 @@ workflowRoutes.delete(
718718
"/:workflowId/queue-trigger",
719719
jwtMiddleware,
720720
async (c) => {
721-
const workflowId = c.req.param("workflowId");
721+
const workflowId = c.req.param("workflowId")!;
722722
const organizationId = c.get("organizationId")!;
723723
const workflowStore = new WorkflowStore(c.env);
724724
const db = createDatabase(c.env.DB);
@@ -752,7 +752,7 @@ workflowRoutes.delete(
752752
* Get email trigger for a workflow
753753
*/
754754
workflowRoutes.get("/:workflowId/email-trigger", jwtMiddleware, async (c) => {
755-
const workflowId = c.req.param("workflowId");
755+
const workflowId = c.req.param("workflowId")!;
756756
const organizationId = c.get("organizationId")!;
757757
const workflowStore = new WorkflowStore(c.env);
758758
const db = createDatabase(c.env.DB);
@@ -787,7 +787,7 @@ workflowRoutes.get(
787787
"/:workflowId/endpoint-trigger",
788788
jwtMiddleware,
789789
async (c) => {
790-
const workflowId = c.req.param("workflowId");
790+
const workflowId = c.req.param("workflowId")!;
791791
const organizationId = c.get("organizationId")!;
792792
const workflowStore = new WorkflowStore(c.env);
793793
const db = createDatabase(c.env.DB);
@@ -831,7 +831,7 @@ workflowRoutes.put(
831831
jwtMiddleware,
832832
zValidator("json", UpsertEndpointTriggerRequestSchema),
833833
async (c) => {
834-
const workflowId = c.req.param("workflowId");
834+
const workflowId = c.req.param("workflowId")!;
835835
const organizationId = c.get("organizationId")!;
836836
const data = c.req.valid("json");
837837
const db = createDatabase(c.env.DB);
@@ -898,7 +898,7 @@ workflowRoutes.delete(
898898
"/:workflowId/endpoint-trigger",
899899
jwtMiddleware,
900900
async (c) => {
901-
const workflowId = c.req.param("workflowId");
901+
const workflowId = c.req.param("workflowId")!;
902902
const organizationId = c.get("organizationId")!;
903903
const workflowStore = new WorkflowStore(c.env);
904904
const db = createDatabase(c.env.DB);
@@ -933,7 +933,7 @@ workflowRoutes.delete(
933933
* Get bot trigger for a workflow
934934
*/
935935
workflowRoutes.get("/:workflowId/bot-trigger", jwtMiddleware, async (c) => {
936-
const workflowId = c.req.param("workflowId");
936+
const workflowId = c.req.param("workflowId")!;
937937
const organizationId = c.get("organizationId")!;
938938
const workflowStore = new WorkflowStore(c.env);
939939
const db = createDatabase(c.env.DB);
@@ -968,7 +968,7 @@ workflowRoutes.post(
968968
"/:workflowId/bot-trigger/sync",
969969
jwtMiddleware,
970970
async (c) => {
971-
const workflowId = c.req.param("workflowId");
971+
const workflowId = c.req.param("workflowId")!;
972972
const organizationId = c.get("organizationId")!;
973973
const workflowStore = new WorkflowStore(c.env);
974974
const db = createDatabase(c.env.DB);
@@ -1048,7 +1048,7 @@ workflowRoutes.post(
10481048
* Delete a bot trigger for a workflow
10491049
*/
10501050
workflowRoutes.delete("/:workflowId/bot-trigger", jwtMiddleware, async (c) => {
1051-
const workflowId = c.req.param("workflowId");
1051+
const workflowId = c.req.param("workflowId")!;
10521052
const organizationId = c.get("organizationId")!;
10531053
const workflowStore = new WorkflowStore(c.env);
10541054
const db = createDatabase(c.env.DB);
@@ -1116,7 +1116,7 @@ workflowRoutes.patch(
11161116
})
11171117
),
11181118
async (c) => {
1119-
const workflowId = c.req.param("workflowId");
1119+
const workflowId = c.req.param("workflowId")!;
11201120
const organizationId = c.get("organizationId")!;
11211121
const { enabled } = c.req.valid("json");
11221122

apps/api/src/routes/ws.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ wsRoutes.get("/:workflowId", jwtMiddleware, async (c) => {
1414
return c.json({ error: "Unauthorized" }, 401);
1515
}
1616

17-
const workflowId = c.req.param("workflowId");
17+
const workflowId = c.req.param("workflowId")!;
1818

1919
// getAgentByName initializes the partyserver name before returning the stub
2020
const stub = await getAgentByName(c.env.WORKFLOW_AGENT, workflowId);

apps/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"tailwindcss-animate": "^1.0.7",
8080
"tsx": "^4.21.0",
8181
"typescript": "^5.9.3",
82-
"vite": "^7.3.1",
82+
"vite": "^7.3.2",
8383
"vitest": "^4.1.0",
8484
"wrangler": "^4.76.0"
8585
}

apps/www/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"tailwindcss": "^3.4.19",
3939
"tsx": "^4.21.0",
4040
"typescript": "^5.9.3",
41-
"vite": "^7.3.1",
41+
"vite": "^7.3.2",
4242
"wrangler": "^4.76.0"
4343
}
4444
}

0 commit comments

Comments
 (0)