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,4 +26,11 @@ describe("monitor config API", () => {
|
||||
expect(body["monitor.pollIntervalHours"]).toBe("12");
|
||||
expect(await prisma.config.findUnique({ where: { key: "nope" } })).toBeNull();
|
||||
});
|
||||
|
||||
it("ignores prototype-chain keys (__proto__, constructor) and writes no Config row", async () => {
|
||||
const before = await prisma.config.count();
|
||||
const res = await patch({ __proto__: "x", constructor: "y" });
|
||||
expect((await res.json()).updated).toBe(0);
|
||||
expect(await prisma.config.count()).toBe(before);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user