fix(web): harden config PATCH allowlists against prototype-chain keys
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,7 @@ export async function PATCH(request: Request) {
|
||||
return Response.json({ error: "invalid JSON" }, { status: 400 });
|
||||
}
|
||||
const entries = Object.entries((body ?? {}) as Record<string, unknown>).filter(
|
||||
([k]) => k in DEFAULTS,
|
||||
([k]) => Object.prototype.hasOwnProperty.call(DEFAULTS, k),
|
||||
);
|
||||
for (const [key, value] of entries) {
|
||||
await prisma.config.upsert({
|
||||
|
||||
Reference in New Issue
Block a user