Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix(labels): enforce task workspace boundary (#1380)

Tin Sever4f6ea91d8603
diff --git a/apps/api/src/label/controllers/create-label.ts b/apps/api/src/label/controllers/create-label.ts
index a5a1ba2e9..33dcce2e6 100644
--- a/apps/api/src/label/controllers/create-label.ts
+++ b/apps/api/src/label/controllers/create-label.ts
@@ -31,6 +31,12 @@ async function createLabel(
});
}
+ if (task.workspaceId !== workspaceId) {
+ throw new HTTPException(404, {
+ message: "Task not found",
+ });
+ }
+
const [inserted] = await db
.insert(labelTable)
.values({ name, color, taskId, workspaceId: task.workspaceId })