fix: V-002 security vulnerability

Automated security fix generated by Orbis Security AI
This commit is contained in:
orbisai0security 2026-05-05 08:01:24 +00:00
parent d1f4cb615b
commit b059abf46d
1 changed files with 6 additions and 1 deletions

View File

@ -16,7 +16,12 @@ export async function POST(request: NextRequest) {
return NextResponse.json({ error: "Too many requests" }, { status: 429 });
}
const body = await request.json();
let body: unknown;
try {
body = await request.json();
} catch {
return NextResponse.json({ error: "Invalid JSON" }, { status: 400 });
}
const result = submitSchema.safeParse(body);
if (!result.success) {