Skip to content

bug: remove refresh endpoint and require auth#6256

Closed
chloebyun-wd wants to merge 3 commits intomainfrom
bug/524/unauthenticated-oauth-refresh-token
Closed

bug: remove refresh endpoint and require auth#6256
chloebyun-wd wants to merge 3 commits intomainfrom
bug/524/unauthenticated-oauth-refresh-token

Conversation

@chloebyun-wd
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request secures the OAuth2 token refresh endpoint by adding an internal header authentication check and removing sensitive token data from the response. However, the implementation should use the getEncryptionKey utility for the authentication header to ensure compatibility with various secret storage backends. Additionally, the endpoint must remain in the whitelist to prevent global authentication middleware from blocking internal requests before the header check is performed.

Comment thread packages/components/src/utils.ts Outdated
Comment thread packages/server/src/utils/constants.ts
@chloebyun-wd
Copy link
Copy Markdown
Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the security of the OAuth2 token refresh endpoint by introducing an internal authentication mechanism using an x-flowise-internal-key header and removing sensitive token data from the response body. The internal key is propagated through various flow execution parameters. Feedback identifies a missing propagation of this key in the executeAgentFlow function, which would cause failures in Agentflows, and suggests caching the encryption key to reduce I/O overhead during frequent refresh requests.

Comment thread packages/server/src/utils/buildChatflow.ts
Comment thread packages/server/src/routes/oauth2/index.ts Outdated
…ey, use timing-safe comparison

- Pass internalRefreshKey through executeAgentFlow, executeNode, and
  recursive sub-flow calls so OAuth2 refresh works in Agentflows
- Cache getEncryptionKey() result to avoid file I/O or AWS calls per request
- Use crypto.timingSafeEqual for key comparison to prevent timing attacks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chloebyun-wd chloebyun-wd deleted the bug/524/unauthenticated-oauth-refresh-token branch April 21, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant