-
Notifications
You must be signed in to change notification settings - Fork 492
Open
Labels
bugSomething isn't workingSomething isn't workingfrontendFrontend development (HTML, CSS, JavaScript)Frontend development (HTML, CSS, JavaScript)securityImproves securityImproves securityuiUser InterfaceUser Interface
Milestone
Description
π 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
- Log into the Admin UI (browser saves email/password)
- Navigate to MCP Servers tab or any section with API key fields
- Click on an API key input field
- 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 inadmin.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.htmlmodal 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
- [REFACTOR][UI]: Consolidate innerHTML patterns with auto-escaping helpersΒ #2568 - Consolidate innerHTML patterns with auto-escaping helpers
- [EPIC][SECURITY][UI]: Click-to-Reveal UI Components (UX Improvements)Β #2564 - Click-to-Reveal UI Components
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfrontendFrontend development (HTML, CSS, JavaScript)Frontend development (HTML, CSS, JavaScript)securityImproves securityImproves securityuiUser InterfaceUser Interface