mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-14 23:31:13 -07:00
Add extra safety checks for proto pollution (#20396)
Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
This commit is contained in:
@@ -30,7 +30,7 @@ function mergeRecursively(
|
||||
for (const key of Object.keys(source)) {
|
||||
// JSON.parse can create objects with __proto__ as an own property.
|
||||
// We must skip it to prevent prototype pollution.
|
||||
if (key === '__proto__') {
|
||||
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
||||
continue;
|
||||
}
|
||||
const srcValue = source[key];
|
||||
|
||||
Reference in New Issue
Block a user