Skip to content

Commit

Permalink
fix: security patches (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt authored Jan 6, 2025
1 parent cb1a4de commit fa0fd77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/backend/src/api/v1/auth/saml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { randomBytes } from "crypto";
import { SignJWT } from "jose";
import z from "zod";
import { aggressiveRatelimit } from "@/src/utils/ratelimit";
import { checkAccess } from "@/src/utils/authorization";
import { hasAccess } from "shared";

// Required for SAMLify to work
samlify.setSchemaValidator(validator);
Expand Down Expand Up @@ -149,7 +151,8 @@ route.post("/download-idp-xml", aggressiveRatelimit, async (ctx: Context) => {
}
}

await sql`
if (hasAccess(user?.role, "settings", "create")) {
await sql`
update
org
set
Expand All @@ -158,6 +161,7 @@ route.post("/download-idp-xml", aggressiveRatelimit, async (ctx: Context) => {
where
id = ${orgId}
`;
}

ctx.body = { success: true };
ctx.status = 201;
Expand Down

0 comments on commit fa0fd77

Please sign in to comment.