From 68c87f7e7aca14e382d8d7976154629a3f007908 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 2 Oct 2024 01:53:03 +0300 Subject: [PATCH] Fix code scanning alert no. 231: Prototype-polluting function Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- public/scripts/tool-calling.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/scripts/tool-calling.js b/public/scripts/tool-calling.js index c88528dd7..c19d1ac7a 100644 --- a/public/scripts/tool-calling.js +++ b/public/scripts/tool-calling.js @@ -213,6 +213,7 @@ export class ToolManager { static #applyToolCallDelta(target, delta) { for (const key in delta) { if (!delta.hasOwnProperty(key)) continue; + if (key === "__proto__" || key === "constructor") continue; const deltaValue = delta[key]; const targetValue = target[key];