Skip to content

fix: move Gemini API key from URL query param to request header#75

Merged
iam-vipin merged 1 commit intoRocketChat:mainfrom
amitb0ra:fix/gemini-api-key-security
Mar 24, 2026
Merged

fix: move Gemini API key from URL query param to request header#75
iam-vipin merged 1 commit intoRocketChat:mainfrom
amitb0ra:fix/gemini-api-key-security

Conversation

@amitb0ra
Copy link
Contributor

Description

The Gemini API key was being passed as a URL query parameter (?key=...). This is a security vulnerability that exposes the key in:

  • Server/proxy access logs
  • Browser history and bookmarks
  • Network monitoring tools and packet traces
  • Referrer headers if the URL leaks to third-party services

This PR moves the API key to the x-goog-api-key HTTP request header, which is the recommended authentication method by Google.

References

- Move API key from URL query parameter to x-goog-api-key header to prevent
  key exposure in server logs, browser history, and network traces
@iam-vipin iam-vipin merged commit 8f42340 into RocketChat:main Mar 24, 2026
1 check passed
@amitb0ra amitb0ra deleted the fix/gemini-api-key-security branch March 24, 2026 19:05
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.

2 participants