mcp-context-forge icon indicating copy to clipboard operation
mcp-context-forge copied to clipboard

[BUG][UI]: Remove non-functional "Show" button for auth tokens after security hardening

Open IuliaGaitan opened this issue 9 months ago • 2 comments

🐞 Bug Summary

The Admin can no longer see the token


🧩 Affected Component

Select the area of the project impacted:

  • [ ] mcpgateway - API
  • [x] mcpgateway - UI (admin panel)
  • [ ] mcpgateway.wrapper - stdio wrapper
  • [ ] Federation or Transports
  • [ ] CLI, Makefiles, or shell scripts
  • [ ] Container setup (Docker/Podman/Compose)
  • [ ] Other (explain below)

🔁 Steps to Reproduce

  1. Go to https://ocp2.cloud.boomerangplatform.net/qa/mcp-gateway/service/gateway/admin/#gateways
  2. Click Edit on mcp-grid-qa
  3. Click Shown on Token field

🤔 Results

The token is not decrypted and no longer shown

Image

🤔 Expected Behavior

The UI should decrypt and show the token for the Admin role.

📓 Logs / Error Output

Paste any relevant stack traces or logs here. ⚠️ Do not paste secrets, credentials, or tokens.


🧠 Environment Info

You can retrieve most of this from the /version endpoint.

Key Value
Version or commit 1.0.0-BETA-2 0.128.5
Runtime Python 3.12.12
Platform / OS Linux 4.18.0-372.64.1.el8_6.x86_64 (x86_64)
Container none

🧩 Additional Context (optional)

Add any configuration details, flags, or related issues.

IuliaGaitan avatar Feb 16 '26 10:02 IuliaGaitan

Fix submitted in #2980. Root cause was masked() unconditionally nulling the _unmasked fields, the admin endpoint now opts in to preserving them.

omorros avatar Feb 16 '26 19:02 omorros

Thanks @IuliaGaitan. This is expected behaviour — PR #2664 intentionally set all _unmasked credential fields to None in GatewayRead.masked() (schemas.py:3395-3398) with the comment # SECURITY: Never expose unmasked credentials in API responses.

The bug here is that the UI still has a "Show" toggle button (admin.html:5435-5443 and the edit form at line 9923) that calls toggleInputMask() but the unmasked value is always null now. The fix is to remove or hide the "Show/Hide" toggle buttons for credential fields since the server no longer returns decrypted values.

crivetimihai avatar Feb 19 '26 03:02 crivetimihai