GHSA-qgvm-j2hm-6m38: Infoleak
Summary
The OAuth2 token refresh endpoint (POST /api/v1/oauth2-credential/refresh/:credentialId) is in WHITELISTURLS, meaning it requires no authentication. It decrypts the stored credential (containing clientId, clientSecret, refreshtoken), sends a refresh request to the configured OAuth provider, and returns the new accesstoken directly in the response body.
Root Cause
typescript // packages/server/src/routes/oauth2/index.ts:393-402 res.json({ success: true, message: 'OAuth2 token refreshed successfully', credentialId: credential.id, tokenInfo: { ...tokenData, // ← includes accesstoken! hasnewrefreshtoken: !!tokenData.refreshtoken, expiresat: updatedCredentialData.expiresat } })
Whitelist entry at packages/server/src/utils/constants.ts:40.
Attack Chain
1. Attacker obtains a credential ID (via Finding 2 / public chatflow leak, or enumeration) 2. Attacker calls POST /api/v1/oauth2-credential/refresh/:credentialId (no auth required) 3. Server decrypts credential, sends refresh request to OAuth provider with user's clientsecret 4. Server returns the new accesstoken in the response to the attacker 5. Attacker uses the token to access the victim's connected service (Google, Microsoft, etc.)
Docker Validation
POST /api/v1/oauth2-credential/refresh/fake-uuid returns {"message":"Credential not found"} (not 401 Unauthorized), proving the endpoint processes the request without authentication.
Impact
- OAuth2 access token theft for any connected service - Full access to the victim's third-party accounts (Google, Microsoft, GitHub, etc.) - Client secret transmitted to OAuth provider during refresh - Can also be used for DoS by exhausting refresh token quota
Suggested Fix
Remove the refresh endpoint from WHITELISTURLS and require authentication:
typescript // Remove from WHITELISTURLS in constants.ts // Add authentication check in the route handler
---
Credits
- Shinobi Security - https://github.com/shinobisecurity
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/flowiseto a version that resolves this vulnerability.Fixed in 3.1.3 - Configuration
Remove the refresh endpoint `POST /api/v1/oauth2-credential/refresh/:credentialId` from `WHITELIST_URLS` in `packages/server/src/utils/constants.ts` (currently whitelisted), and add an authentication check in the route handler `packages/server/src/routes/oauth2/index.ts:393-402`.
Shinobi Security (packages/server/src/routes/oauth2/index.ts) refresh endpoint Authentication requirement for POST /api/v1/oauth2-credential/refresh/:credentialId (remove from WHITELIST_URLS) = Require authentication (remove endpoint from whitelist)