Summary
Flowise through version 3.1.4 contains an authentication bypass in the OAuth2 credential refresh endpoint. An unauthenticated attacker may exploit prefix-based whitelist matching to trigger unauthorized OAuth token rotation for credentials in other workspaces, potentially disrupting dependent integrations.
Affected context
The issue occurs in Flowise authentication middleware when requests to the OAuth2 credential refresh route are checked against a prefix-based whitelist. A crafted route containing a trailing credential identifier may be treated as an allowed path, allowing the request to reach the refresh operation without the authentication and authorization checks normally expected for workspace credentials.
Exploit preconditions
- Attack surface: Network-accessible OAuth2 credential refresh endpoint
- Required access: No authenticated account is required when the vulnerable route matching behavior is reachable
- Trigger point: A POST request targeting the refresh route with an appended credential identifier
- Why exploitation is possible: Prefix-based allowlisting can classify a more specific route as trusted without validating the complete path or enforcing credential ownership
Why this happens
The underlying flaw is an authorization bypass caused by incomplete route matching in authentication middleware. When security decisions rely on whether a request path merely begins with an allowed prefix, attacker-controlled suffixes may reach protected operations without the intended authentication and authorization checks. This behavior maps to CWE-862: Missing Authorization, because access control is not reliably enforced for a sensitive credential-management action.
Potential impact
- An unauthenticated attacker may trigger OAuth token rotation
- OAuth integrations could be invalidated or disrupted
- Credentials belonging to other workspaces may be affected
- Dependent workflows may experience authentication failures or service interruption
- Security monitoring and audit assumptions may be undermined by unauthorized credential activity
General mitigation guidance
Mitigation generally focuses on making authorization decisions depend on complete, canonicalized routes and verified resource ownership.
Common defensive patterns include:
- Replacing prefix-based allowlists with exact route matching or narrowly scoped route declarations
- Applying authentication and authorization checks before credential refresh logic executes
- Validating workspace and credential ownership for every sensitive operation
- Canonicalizing and rejecting ambiguous or unexpectedly suffixed paths
- Treating OAuth refresh endpoints as protected by default rather than as public exceptions
- Limiting the privileges of service identities that can rotate or manage OAuth credentials
- Recording and alerting on unexpected unauthenticated credential-management requests
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying prefix, substring, or regular-expression route checks used for authorization
- Code review checks for public authentication exemptions that overlap with protected endpoints
- Tests that exercise trailing path segments, encoded separators, duplicate delimiters, and path normalization cases
- Integration tests confirming that every credential operation enforces authentication and resource ownership
- API gateway or policy rules requiring authentication for credential-management routes
- Logs and alerts for unauthenticated requests, unusual token rotations, or cross-workspace credential activity
Automated security review tools may help identify suspicious route-matching and authorization patterns, but endpoint-specific tests remain important.

