Skip to content

Conversation

@marrouchi
Copy link
Contributor

@marrouchi marrouchi commented Oct 13, 2025

Motivation

The following PR introduces major updates :

Todo

  • Test mail feature
  • Test Cache and Redis (for both cache and WS)
  • Test Migrations

Type of change:

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@marrouchi marrouchi marked this pull request as draft October 13, 2025 06:33
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 13, 2025

Important

Review skipped

Too many files!

149 files out of 299 files are above the max files limit of 150.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@marrouchi marrouchi changed the title Dev Experimental - major updates Oct 13, 2025
@marrouchi marrouchi changed the title Experimental - major updates Experimental - v3 Oct 15, 2025
cursor = cursor[segment] as Record<string, unknown>;
}

cursor[segments[segments.length - 1]] = value;

Check warning

Code scanning / CodeQL

Prototype-polluting function Medium

The property chain
here
is recursively assigned to
cursor
without guarding against prototype pollution.

Copilot Autofix

AI about 2 months ago

To fix the prototype pollution risk in assignNestedWhereValue, we must block unsafe key names from being set as object properties. Specifically, we should prevent assigning to property names "__proto__", "constructor", and "prototype" at any nesting level. The best place to do this is in the loop where segment is assigned as a property, and likewise when the last path segment is used for the final assignment. Add a guard to skip (or throw) if any segment equals one of these forbidden names. This ensures that even if path is attacker-controlled, these dangerous property names cannot be assigned deeply into the object, protecting against prototype pollution. All changes should be confined to the assignNestedWhereValue method in packages/api/src/utils/pipes/typeorm-search-filter.pipe.ts.


Suggested changeset 1
packages/api/src/utils/pipes/typeorm-search-filter.pipe.ts

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/api/src/utils/pipes/typeorm-search-filter.pipe.ts b/packages/api/src/utils/pipes/typeorm-search-filter.pipe.ts
--- a/packages/api/src/utils/pipes/typeorm-search-filter.pipe.ts
+++ b/packages/api/src/utils/pipes/typeorm-search-filter.pipe.ts
@@ -402,13 +402,30 @@
 
     for (let index = 0; index < segments.length - 1; index++) {
       const segment = segments[index];
+      if (
+        segment === '__proto__' ||
+        segment === 'constructor' ||
+        segment === 'prototype'
+      ) {
+        // Ignore dangerous keys to prevent prototype pollution
+        return;
+      }
       if (!this.isPlainObject(cursor[segment])) {
         cursor[segment] = {};
       }
       cursor = cursor[segment] as Record<string, unknown>;
     }
 
-    cursor[segments[segments.length - 1]] = value;
+    const lastSegment = segments[segments.length - 1];
+    if (
+      lastSegment === '__proto__' ||
+      lastSegment === 'constructor' ||
+      lastSegment === 'prototype'
+    ) {
+      // Ignore dangerous keys to prevent prototype pollution
+      return;
+    }
+    cursor[lastSegment] = value;
   }
 
   private mergeWhereObjects(
EOF
@@ -402,13 +402,30 @@

for (let index = 0; index < segments.length - 1; index++) {
const segment = segments[index];
if (
segment === '__proto__' ||
segment === 'constructor' ||
segment === 'prototype'
) {
// Ignore dangerous keys to prevent prototype pollution
return;
}
if (!this.isPlainObject(cursor[segment])) {
cursor[segment] = {};
}
cursor = cursor[segment] as Record<string, unknown>;
}

cursor[segments[segments.length - 1]] = value;
const lastSegment = segments[segments.length - 1];
if (
lastSegment === '__proto__' ||
lastSegment === 'constructor' ||
lastSegment === 'prototype'
) {
// Ignore dangerous keys to prevent prototype pollution
return;
}
cursor[lastSegment] = value;
}

private mergeWhereObjects(
Copilot is powered by AI and may make mistakes. Always verify output.
continue;
}

(left as Record<string, unknown>)[key] = value;

Check warning

Code scanning / CodeQL

Prototype-polluting function Medium

Properties are copied from
right
to
here
without guarding against prototype pollution.

Copilot Autofix

AI about 2 months ago

To fix the prototype pollution risk, we should ensure that the mergeWhereObjects method does not copy any property named '__proto__', 'constructor', or 'prototype'. Before assigning or recursing into any key/value pair, the code should check whether the key matches any of these reserved names and skip them if so. This modification should occur inside the loop in the mergeWhereObjects function, specifically before any assignment or recursion. No external dependencies are needed; this can be accomplished with a simple conditional statement.


Suggested changeset 1
packages/api/src/utils/pipes/typeorm-search-filter.pipe.ts

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/api/src/utils/pipes/typeorm-search-filter.pipe.ts b/packages/api/src/utils/pipes/typeorm-search-filter.pipe.ts
--- a/packages/api/src/utils/pipes/typeorm-search-filter.pipe.ts
+++ b/packages/api/src/utils/pipes/typeorm-search-filter.pipe.ts
@@ -416,6 +416,13 @@
     right: FindOptionsWhere<T>,
   ): FindOptionsWhere<T> {
     for (const [key, value] of Object.entries(right)) {
+      if (
+        key === '__proto__' ||
+        key === 'constructor' ||
+        key === 'prototype'
+      ) {
+        continue;
+      }
       if (value === undefined) {
         continue;
       }
EOF
@@ -416,6 +416,13 @@
right: FindOptionsWhere<T>,
): FindOptionsWhere<T> {
for (const [key, value] of Object.entries(right)) {
if (
key === '__proto__' ||
key === 'constructor' ||
key === 'prototype'
) {
continue;
}
if (value === undefined) {
continue;
}
Copilot is powered by AI and may make mistakes. Always verify output.
yassinedorbozgithub and others added 25 commits November 14, 2025 10:53
…hook

fix(frontend): Optimize useRemoteI18n hook
…ions-hook

fix(frontend): Optimize useUserPermissions hook
fix(frontend): Update TanStack Query cache values
fix(frontend): add TanStack useQuery callback functions
fix(frontend): resolve hotreload detection logic
…endering

fix(frontend): disable update settings rendering
fix(frontend): optimize updateBlock triggered by viewPort
…faultvalues

fix(api): update entities object defaultValues
fix(frontend): resolve useFind rendering bugs
marrouchi and others added 30 commits January 8, 2026 17:32
…e-query-pipe

fix(api): remove sanitizeQuery pipe
fix(api): remove unnecessary BaseOrmService repository type
…hook

feat(frontend): add useQueryChange hook
…-safe-callback-hooks

feat(frontend): add useSafeMemo and useSafeCallback hooks
refactor(frontend): enhance yaml visual editor logic
…mponent

refactor(frontend): enhance animation icons logic
…fset-zoom-direction

feat: save workflow zoom, x, y and direction
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.

3 participants