Skip to content

Conversation

@longbinlai
Copy link
Collaborator

No description provided.

pomelo-nwu and others added 27 commits November 25, 2024 16:26
fix bug of maintaining duplicate edges
feat: Supports drag-and-drop combos for layout adjustment
chore: Update kuzu_wasm to v0.7.0
fix bug when chroma db is empty and prepare workflow for extraction
fix: remove GloveEmbedding implementation in clustering
console.log('SLOTS', SLOTS);
};
export const unInstallSlot = (slotType: SlotType, appId: string) => {
delete SLOTS[slotType][appId];

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
library input
.

Copilot Autofix

AI about 1 year ago

To fix the problem, we need to ensure that appId cannot be used to modify Object.prototype. We can achieve this by checking if appId is one of the special property names (__proto__, constructor, prototype) and rejecting it if it is. This will prevent prototype pollution while maintaining the existing functionality.

Suggested changeset 1
packages/studio-website/src/slots/index.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/studio-website/src/slots/index.tsx b/packages/studio-website/src/slots/index.tsx
--- a/packages/studio-website/src/slots/index.tsx
+++ b/packages/studio-website/src/slots/index.tsx
@@ -22,2 +22,5 @@
 export const installSlot = (slotType: SlotType, appId: string, slot: any) => {
+  if (appId === '__proto__' || appId === 'constructor' || appId === 'prototype') {
+    throw new Error('Invalid appId');
+  }
   SLOTS[slotType] = {
@@ -29,2 +32,5 @@
 export const unInstallSlot = (slotType: SlotType, appId: string) => {
+  if (appId === '__proto__' || appId === 'constructor' || appId === 'prototype') {
+    throw new Error('Invalid appId');
+  }
   delete SLOTS[slotType][appId];
@@ -41,2 +47,5 @@
 export const registerSideMenuSlot = (appId: string, slot: MenuProps['items']) => {
+  if (appId === '__proto__' || appId === 'constructor' || appId === 'prototype') {
+    throw new Error('Invalid appId');
+  }
   SLOTS['SIDE_MEU'] = {
@@ -48,2 +57,5 @@
 export const registerRoutesSlot = (appId: string, slot: any) => {
+  if (appId === '__proto__' || appId === 'constructor' || appId === 'prototype') {
+    throw new Error('Invalid appId');
+  }
   SLOTS['ROUTES'] = {
EOF
@@ -22,2 +22,5 @@
export const installSlot = (slotType: SlotType, appId: string, slot: any) => {
if (appId === '__proto__' || appId === 'constructor' || appId === 'prototype') {
throw new Error('Invalid appId');
}
SLOTS[slotType] = {
@@ -29,2 +32,5 @@
export const unInstallSlot = (slotType: SlotType, appId: string) => {
if (appId === '__proto__' || appId === 'constructor' || appId === 'prototype') {
throw new Error('Invalid appId');
}
delete SLOTS[slotType][appId];
@@ -41,2 +47,5 @@
export const registerSideMenuSlot = (appId: string, slot: MenuProps['items']) => {
if (appId === '__proto__' || appId === 'constructor' || appId === 'prototype') {
throw new Error('Invalid appId');
}
SLOTS['SIDE_MEU'] = {
@@ -48,2 +57,5 @@
export const registerRoutesSlot = (appId: string, slot: any) => {
if (appId === '__proto__' || appId === 'constructor' || appId === 'prototype') {
throw new Error('Invalid appId');
}
SLOTS['ROUTES'] = {
Copilot is powered by AI and may make mistakes. Always verify output.
@vercel
Copy link

vercel bot commented Nov 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gsp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 29, 2024 8:20am

@longbinlai longbinlai merged commit 33e2f30 into refactor_workflow Nov 29, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants