Skip to content

[BUG][UI]: Browser autocomplete incorrectly fills fields with saved credentials (UX issue)Β #2626

@crivetimihai

Description

@crivetimihai

🐞 Bug Summary

Browser autocomplete/autofill incorrectly offers to save and fill API key, secret, and token fields with saved email credentials. Users see their email addresses auto-populated in fields meant for API keys, OAuth secrets, and encryption keys.


🧩 Affected Component

  • mcpgateway/templates/admin.html - Admin UI
  • mcpgateway/templates/mcp_registry_partial.html - MCP Registry partial

πŸ” Steps to Reproduce

  1. Log into the Admin UI (browser saves email/password)
  2. Navigate to MCP Servers tab or any section with API key fields
  3. Click on an API key input field
  4. Observe browser offering to autofill with saved login credentials (email address)

πŸ€” Expected Behavior

  • API key, secret, and token fields should not trigger browser password/credential autofill
  • These fields should have autocomplete="off" to prevent unwanted suggestions
  • Login form fields should continue to work with proper autocomplete values

πŸ” Root Cause Analysis

Properly Configured βœ…

login.html (Lines 157-184):

  • Email field: autocomplete="email" βœ…
  • Password field: autocomplete="current-password" βœ…

change-password-required.html (Lines 144-210):

  • Current password: autocomplete="current-password" βœ…
  • New password: autocomplete="new-password" βœ…
  • Confirm password: autocomplete="new-password" βœ…

Missing Autocomplete Attributes ⚠️

admin.html has ~29 password-type input fields without autocomplete attributes:

Field Location Current Should Be
LLM Provider API Key Line ~1870 Missing autocomplete="off"
Gateway Auth Password Line ~3730 Missing autocomplete="off"
OAuth Client Secret Multiple Missing autocomplete="off"
Import Rekey Secret Line ~1243 Missing autocomplete="off"
Encryption secrets Multiple Missing autocomplete="off"

mcp_registry_partial.html:

Field Location Current Should Be
Modal API Key Line ~622-627 Missing autocomplete="off"

πŸ› οΈ Proposed Fix

Add autocomplete="off" to all password-type input fields that are used for API keys, secrets, and tokens (not actual user passwords).

Example change:

<!-- Before -->
<input type="password" id="llm-provider-api-key" name="api_key" ... />

<!-- After -->
<input type="password" id="llm-provider-api-key" name="api_key" autocomplete="off" ... />

πŸ“‹ Tasks

  • Audit all type="password" inputs in admin.html
  • Add autocomplete="off" to API key fields
  • Add autocomplete="off" to OAuth secret fields
  • Add autocomplete="off" to encryption key fields
  • Add autocomplete="off" to token fields
  • Update mcp_registry_partial.html modal API key field
  • Verify login form autocomplete still works correctly
  • Test in Chrome, Firefox, Safari

🧠 Environment Info

Key Value
Affected files admin.html, mcp_registry_partial.html
Browser behavior All major browsers (Chrome, Firefox, Safari)

πŸ”— Related Issues

Metadata

Metadata

Labels

bugSomething isn't workingfrontendFrontend development (HTML, CSS, JavaScript)securityImproves securityuiUser Interface

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions