Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 3 min read

Building a Zero-Leakage Client Portal on monday code: Server-Side Allowlists, AES-256-GCM Vaults & SHA-256 Sign-Offs

When you build a multi-tenant B2B app that exposes internal project boards to unauthenticated external clients via magic links, a single IDOR bug or client-side column filter can leak an agency's profit margins or anothe

When you build a multi-tenant B2B app that exposes internal project boards to unauthenticated external clients via magic links, a single IDOR bug or client-side column filter can leak an agency's profit margins or another client's deliverables.

While building PortalGateβ€”a branded client portal, 2-way item updater, and 1-click external approval app hosted natively on monday codeβ€”I ran into several real-world security and infrastructure gotchas worth sharing with fellow builders.

Why teams hit walls sharing monday.com boards with clients

  1. Column permissions are Enterprise-only: On Basic, Standard, and Pro plans, hiding columns in a view is cosmetic; external guests on a board can still risk seeing sensitive fields unless you duplicate boards.
  2. Standard 4:1 guest seat pricing: Past the first 3 guests, every 4 external guests count as a billed seat (often jumping into the next 5-seat block). If you want to model the math, I built a free no-signup monday.com Guest Seat & Enterprise Cost Calculator.
  3. WorkForms creates duplicate rows: Native forms insert new items instead of letting external clients edit existing deliverables or sign off on an item.

5 Engineering Lessons From Shipping on monday code

1. Default-Deny Server-Side Column Allowlist + Write Locks

Never send full board items to the frontend and hide columns with CSS. PortalGate computes an explicit server-side projection allowlist before JSON serialization so hidden columns (e.g., Internal Cost, Profit Margin) never leave the server.

Two subtle edge cases we also locked down server-side (HTTP 403 on PATCH):

  • Row-Scope Self-Ejection: If a portal filters rows by Client Email, allowing the client to edit Client Email lets them accidentally eject their own item out of scope (404). Marking row-scope columns system-managed read-only prevents this.
  • Approval Status Spoofing: Allowing clients to PATCH the Approval Status dropdown directly would let them set Approved without going through /approve (bypassing SHA-256 receipts and edit-locking). Locking the mapped approval column to the /approve workflow closes that gap.

2. Hydrating monday code Secrets & Non-Blocking Firestore-MongoDB Indexes

Two real production surprises on monday code (Cloud Run + Google Cloud Firestore in MongoDB-compatible mode):

  • code:secret values are mounted under /secrets-v2 rather than process.env. Hydrate them once at boot using EnvironmentVariablesManager({ updateProcessEnv: true }) and SecretsManager().get(key).
  • Calling await Promise.all([...18 createIndex()...]) synchronously before app.listen(8080) can stall Cloud Run's startup probe because Firestore index operations are long-running/IAM-scoped. Running best-effort index creation asynchronously in the background and keeping per-tenant queries single-field indexed ({ accountId }) dropped boot time to under 1 second.

3. Passing create_labels_if_missing: true & Normalizing Status Snapshots

When updating a Status column via change_multiple_column_values, boards with default labels (Working on it / Done / Stuck) reject "Approved" unless you pass create_labels_if_missing: true.

For tamper-evident approval receipts, monday.com stores dynamic metadata (changed_at, index, post_id) inside the raw Status value JSON. Normalizing status/color columns to { label: text } inside the canonical SHA-256 snapshot prevents false-positive tamper alerts while still catching any real status or field modification.

4. Claim-Isolated JWTs & AES-256-GCM OAuth Vault

  • Separate signing keys and strict claim/audience validation across iframe sessionTokens, lifecycle webhooks, OAuth CSRF state tokens (with single-use replay nonces), and PIN session cookies.
  • OAuth access tokens are encrypted at rest with AES-256-GCM using a random 12-byte IV and tenant-bound AAD (portalgate:oauth:v1:<accountId>:<userId>).
  • 256-bit magic link tokens are stored only as SHA-256 hashes; optional 6-digit PINs use scrypt with a 5-attempt lockout (HTTP 429).

5. Sandboxed File Proxy & Zero Automation Burn

Transient monday.com S3 public_urls are never persisted to the database. Client downloads stream through an SSRF-validated allowlist proxy with Content-Security-Policy: sandbox and Content-Disposition: attachment. All edits, comments, file uploads, and approvals sync via direct GraphQL mutationsβ€”consuming 0 monday.com automation actions.

Live Links

If you're building on monday code or wrestling with client-facing permissions in SaaS tools, happy to discuss the architecture in the comments!

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.