mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-24 07:15:23 +02:00
fix(security): stop user-supplied certificatePath in create schema
Same drizzle-zod $defaultFn-as-optional leak as schedule appName: certificatePath (notNull + $defaultFn) was overridable, enabling path traversal out of the certs dir even with the escaped shell paths. Omit it from apiCreateCertificate so it is always server-generated (completes GHSA-q9qw).
This commit is contained in:
@@ -45,7 +45,7 @@ export const apiCreateCertificate = createInsertSchema(certificates, {
|
|||||||
privateKey: z.string().min(1),
|
privateKey: z.string().min(1),
|
||||||
autoRenew: z.boolean().optional(),
|
autoRenew: z.boolean().optional(),
|
||||||
serverId: z.string().optional(),
|
serverId: z.string().optional(),
|
||||||
});
|
}).omit({ certificatePath: true });
|
||||||
|
|
||||||
export const apiFindCertificate = z.object({
|
export const apiFindCertificate = z.object({
|
||||||
certificateId: z.string().min(1),
|
certificateId: z.string().min(1),
|
||||||
|
|||||||
Reference in New Issue
Block a user