Skip to content

v0.5.56: batch operations, access control and permission groups, billing fixes - #2759

Merged
waleedlatif1 merged 16 commits into
mainfrom
staging
Jan 10, 2026
Merged

waleedlatif1 merged 16 commits into
mainfrom
staging

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Jan 10, 2026 •

Copy link
Copy Markdown
Collaborator

waleedlatif1 and others added 12 commits January 9, 2026 09:42
Co-authored-by: icecrasher321 <icecrasher321@users.noreply.github.com>
…d, and edge operations (#2738)

* improvement(canvas): add multi-block select, add batch handle, enabled, and edge operations

* feat(i18n): update translations (#2732)

Co-authored-by: icecrasher321 <icecrasher321@users.noreply.github.com>

* don't allow flip handles for subflows

* ack PR comments

* more

* fix missing handler

* remove dead subflow-specific ops

* remove unused code

* fixed subflow ops

* keep edges on subflow actions intact

* fix subflow resizing

* fix remove from subflow bulk

* improvement(canvas): add multi-block select, add batch handle, enabled, and edge operations

* don't allow flip handles for subflows

* ack PR comments

* more

* fix missing handler

* remove dead subflow-specific ops

* remove unused code

* fixed subflow ops

* fix subflow resizing

* keep edges on subflow actions intact

* fixed copy from inside subflow

* types improvement, preview fixes

* fetch varible data in deploy modal

* moved remove from subflow one position to the right

* fix subflow issues

* address greptile comment

* fix test

* improvement(preview): ui/ux

* fix(preview): subflows

* added batch add edges

* removed recovery

* use consolidated consts for sockets operations

* more

---------

Co-authored-by: icecrasher321 <icecrasher321@users.noreply.github.com>
Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
Co-authored-by: Emir Karabeg <emirkarabeg@berkeley.edu>
* improvement(billng): team upgrade + session management

* remove comments

* session updates should be atomic

* make consistent for onSubscritionUpdate

* plan upgrade to refresh session

* fix var name

* remove dead code

* preserve params
…ecated posthog route, remove deprecated templates & console helpers (#2753)

* fix(tools): updated memory block to throw better errors, removed deprecated posthog route, remove deprecated templates & console helpers

* remove isDeployed in favor of deploymentStatus

* ack PR comments
* expanded metadata fields for google drive

* added tag dropdown support

* fixed greptile

* added utils func

* removed comments

* updated docs

* greptile comments

* fixed output schema

* reverted back to bas64 string
…rams, inject at runtime like all other tools (#2750)

* fix(tools): fixed wrokflow tool for agent to respect user provided params, inject at runtime like all other tools

* ack comments

* remove redunant if-else

* added tests
* fix(docs): new router

* update image
… added missing docs for various blocks and triggers (#2754)

* feat(sidebar): context menu for nav items in sidebar

* added toolbar context menu, fixed incorrect access pattern in old context menus and added docs for missing blocks

* fixed links
* added wand configs

* fixed greptile comments
* feat(permission-groups): integration/model access controls for enterprise

* feat: enterprise gating for BYOK, SSO, credential sets with org admin/owner checks

* execution time enforcement of mcp and custom tools

* add admin routes to cleanup permission group data

* fix not being on enterprise checks

* separate out orgs from billing system

* update the docs

* add custom tool blockers based on perm configs

* add migrations

* fix

* address greptile comments

* regen migrations

* fix default model picking based on user config

* cleaned up UI
@vercel

vercel Bot commented Jan 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 10, 2026 8:30am

@greptile-apps

greptile-apps Bot commented Jan 10, 2026 •

Copy link
Copy Markdown
Contributor

Too many files changed for review. (565 files found, 100 file limit)

* fix(sockets): broadcast handles and enabled/disabled state

* made all ops batched, removed all individual ops

* fix subflow resizing on exit

* removed unused custom event

* fix failing tests, update testing

* fix test mock
@waleedlatif1 waleedlatif1 changed the title v0.5.56: v0.5.56: batch operations, access control and permission groups, billing fixes Jan 10, 2026
* feat(deployed-form): added deployed form input

* styling consolidation, finishing touches on form

* updated docs

* remove unused files with knip

* added more form fields

* consolidated more test utils

* remove unused/unneeded zustand stores, refactored stores for consistency

* improvement(files): uncolorized plan name

* feat(emcn): button-group

* feat(emcn): tag input, tooltip shortcut

* improvement(emcn): modal padding, api, chat, form

* fix: deleted migrations

* feat(form): added migrations

* fix(emcn): tag input

* fix: failing tests on build

* add suplementary hover and fix bg color in date picker

* fix: build errors

---------

Co-authored-by: Emir Karabeg <emirkarabeg@berkeley.edu>
*/

function hashPassword(encryptedPassword: string): string {
return createHash('sha256').update(encryptedPassword).digest('hex').substring(0, 8)

Check failure

Code scanning / CodeQL

Use of password hash with insufficient computational effort

Password from [an access to password](1) is hashed insecurely. Password from [an access to password](2) is hashed insecurely. Password from [an access to password](3) is hashed insecurely. Password from [an access to password](4) is hashed insecurely. Password from [an access to password](5) is hashed insecurely. Password from [an access to password](6) is hashed insecurely. Password from [an access to password](7) is hashed insecurely.

Copilot Autofix

AI 11 months ago

General approach: Replace the current fast, truncated SHA-256 hash used in hashPassword with a password hashing scheme that has configurable computational effort (e.g., PBKDF2). Because this hash is only used to bind the auth cookie/token to the current deployment password (and not to store passwords in a database), we can keep the same interface by deterministically deriving a fixed-length string from the encryptedPassword using PBKDF2 with a constant salt and a high iteration count. This preserves behavior (token is invalidated when the stored password value changes) while making brute-force and offline attacks much harder.

Best concrete fix with minimal functional change:

  • In apps/sim/lib/core/security/deployment.ts:
    • Change hashPassword to use Node’s crypto.pbkdf2Sync with a strong iteration count instead of createHash('sha256').
    • Keep the function synchronous and returning a short hex string to avoid changing callers. We can still truncate if desired; from a compatibility perspective, matching the length (8 hex chars) ensures cookie payload size stays very similar and avoids needing to touch any parsing logic.
    • We need access to pbkdf2Sync. Since the file currently imports only createHash from crypto, we will replace that import with one that includes pbkdf2Sync (we do not otherwise use createHash in the shown snippet).

Implementation details:

  • Update the import at the top of deployment.ts:
    • From: import { createHash } from 'crypto'
    • To: import { pbkdf2Sync } from 'crypto'
  • Update hashPassword implementation:
    • From using: createHash('sha256').update(encryptedPassword).digest('hex').substring(0, 8)
    • To something like:
      const salt = 'deployment-auth-token-salt'
      const iterations = 100_000
      const keylen = 32
      const digest = 'sha256'
      const derived = pbkdf2Sync(encryptedPassword, salt, iterations, keylen, digest).toString('hex')
      return derived.substring(0, 8)
    • This keeps the return type and length unchanged, but substantially increases the computational cost of deriving the hash from the underlying password value.
  • All other files (chat and form routes/utils) call setDeploymentAuthCookie and validateAuthToken but need no changes: they will automatically use the stronger hashing when creating and validating cookies. The token format (deploymentId:type:timestamp:pwHash) remains identical, except that pwHash now comes from PBKDF2 instead of raw SHA-256. Existing cookies will become invalid after deployment (since their pwHash no longer matches), which is acceptable and even desirable from a security perspective.

Only apps/sim/lib/core/security/deployment.ts requires code edits.


Suggested changeset 1
apps/sim/lib/core/security/deployment.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/apps/sim/lib/core/security/deployment.ts b/apps/sim/lib/core/security/deployment.ts
--- a/apps/sim/lib/core/security/deployment.ts
+++ b/apps/sim/lib/core/security/deployment.ts
@@ -1,4 +1,4 @@
-import { createHash } from 'crypto'
+import { pbkdf2Sync } from 'crypto'
 import type { NextRequest, NextResponse } from 'next/server'
 import { isDev } from '@/lib/core/config/feature-flags'
 
@@ -8,7 +8,15 @@
  */
 
 function hashPassword(encryptedPassword: string): string {
-  return createHash('sha256').update(encryptedPassword).digest('hex').substring(0, 8)
+  // Derive a short, deterministic hash from the (encrypted) password using a
+  // computationally expensive KDF instead of a single fast hash.
+  const salt = 'deployment-auth-token-salt'
+  const iterations = 100_000
+  const keylen = 32
+  const digest = 'sha256'
+  const derived = pbkdf2Sync(encryptedPassword, salt, iterations, keylen, digest).toString('hex')
+  // Keep the length short to preserve the existing token structure.
+  return derived.substring(0, 8)
 }
 
 function encryptAuthToken(
EOF
@@ -1,4 +1,4 @@
import { createHash } from 'crypto'
import { pbkdf2Sync } from 'crypto'
import type { NextRequest, NextResponse } from 'next/server'
import { isDev } from '@/lib/core/config/feature-flags'

@@ -8,7 +8,15 @@
*/

function hashPassword(encryptedPassword: string): string {
return createHash('sha256').update(encryptedPassword).digest('hex').substring(0, 8)
// Derive a short, deterministic hash from the (encrypted) password using a
// computationally expensive KDF instead of a single fast hash.
const salt = 'deployment-auth-token-salt'
const iterations = 100_000
const keylen = 32
const digest = 'sha256'
const derived = pbkdf2Sync(encryptedPassword, salt, iterations, keylen, digest).toString('hex')
// Keep the length short to preserve the existing token structure.
return derived.substring(0, 8)
}

function encryptAuthToken(
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@waleedlatif1
waleedlatif1 merged commit be578e2 into main Jan 10, 2026

This branch was previously deployed

1 inactive deployment
Preview — baa54b4c Deployed Jan 10, 2026 by vercel[bot]
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