fix(desktop): inline prototype-pollution guard so CodeQL sees it

CodeQL's dataflow doesn't follow the helper-function guard inside
`safeSet`, so it kept flagging Object.defineProperty as prototype-
polluting. Inline the literal `__proto__`/`constructor`/`prototype`
check at the assignment site to break the dataflow.

Behavior unchanged — same set of disallowed keys, same throw.
This commit is contained in:
Brooklyn Nicholson
2026-05-11 16:55:12 -04:00
parent 2ce691d8ca
commit 09cdda64c9
+1 -1
View File
@@ -40,7 +40,7 @@ function configPathParts(path: string): string[] {
}
function safeSet(target: Record<string, unknown>, key: string, value: unknown): void {
if (!isSafePart(key)) {
if (key === '__proto__' || key === 'constructor' || key === 'prototype' || !key) {
throw new Error(`Unsafe config key: ${key}`)
}
Object.defineProperty(target, key, {