Skip to content
Snippets Groups Projects
Commit e5bd455d authored by Mateusz Tyszczak's avatar Mateusz Tyszczak :scroll: Committed by Bartek Wrona
Browse files

Prevent prototype pollution in iterate utility function

parent c9bbc27d
No related branches found
No related tags found
1 merge request!292Add other signature providers
......@@ -5,6 +5,9 @@ export const iterate = <T extends Record<string, any>>(source: DeepPartial<T>, t
return source;
for(const itKey in (target as DeepPartial<T>)) {
// Prevent prototype pollution
if (itKey === "__proto__" || itKey === "constructor") continue;
if(typeof target[itKey] !== "object") {
source[itKey] = target[itKey] as any;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment