diff --git a/ts/wasm/lib/detailed/util/iterate.ts b/ts/wasm/lib/detailed/util/iterate.ts
index 3e0061557205b7101b5aab403b0b5753ad3078a3..f7cd6c35de19c2b3b9ce3f79ff065888a6fa1d1e 100644
--- a/ts/wasm/lib/detailed/util/iterate.ts
+++ b/ts/wasm/lib/detailed/util/iterate.ts
@@ -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;