Repository navigation
fix(ui): mask flagged secrets server-side, skeleton Security tiles, fold /search into Tools - #1051
Merged
Merged
Conversation
…old /search into Tools
Web UI UX audit (docs/qa/ux-audit-webui-2026-08.md), security + routing cluster.
F13 — the activity drawer printed the credential it had just flagged, in
cleartext, next to a Copy button. Masking now happens in the REST layer, before
the record leaves the process: GET /api/v1/activity and /activity/{id} replace
every detected value inside `arguments` and `response` with a recognisable
preview (`AKIA…****`) whenever the record carries a detection, and drop the
internal `_auth_*` arguments from every record. Redacting in the browser would
have left the raw value on the wire and in the network log, which is not a fix.
Full values stay reachable through the one deliberate surface that already
gates them: `activity export --include-bodies`. The drawer says so, and badges
both payload panels Masked.
F15 — the Security page's four stat tiles sat outside the loading guard, so a
cold start rendered "0 scanners · 0 scans · 0 findings" before the overview had
been fetched. A security page asserting zero findings before it has looked is
worse than one that admits it is still looking: the tiles now skeleton until
the first response lands.
F20 — `/search` was a third search surface, routed but sidebar-less,
duplicating both the header box and the Tools page. It redirects to Tools (the
canonical one) carrying `?q=` across; Tools honours the query on mount and on
later route changes; the header box targets it, and its Search button is no
longer greyed out next to an empty box.
F31 — the header's routing-mode badge explains itself: label and description
live together in utils/routingMode.ts.
F33 — a Web UI deep link without the `/ui` prefix returned Go's plain-text
"404 page not found". Known UI paths now 302 into the SPA, keeping the escaped
path and the query string (`?apikey=` survives). Unknown paths still 404 — an
allowlist, so a mistyped API path is not answered with an HTML page.
F36 (this area) — Tools table descriptions carry a title, so the clipped half
is readable without opening the tool.
Deploying mcpproxy-docs with
|
| Latest commit: |
1dfd9fb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3954ddb1.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-ux-security-routing.mcpproxy-docs.pages.dev |
Cross-model review (opencode/gpt-sol) of the F13 masking found the API
boundary was necessary but not sufficient. Each finding verified against the
code before fixing:
* `/events` streamed the call's raw arguments, response and error to every SSE
subscriber (Web UI, tray, `activity watch`). Those events are emitted at
completion time, BEFORE the asynchronous detector has a verdict, so there is
no flag to gate on: the SSE writer masks unconditionally. Non-payload fields
pass through untouched, and an event without payload fields is not copied.
The store's `console.log(data)` of the same payloads — which printed the
secret into the DevTools console — is gone with them.
* `error_message` was served unmasked. An upstream error commonly quotes the
payload it choked on, so masking the response alone just moved the leak.
* `/api/v1/tool-calls`, `/tool-calls/{id}` and `/servers/{id}/tool-calls` are a
separate store with no detection metadata; they bypassed masking entirely.
They now mask unconditionally, arguments, response and error.
* Private-key masking replaced the `-----BEGIN …-----` line and left the key
body. `maskKeyBlocks` takes the whole block, envelope included; an
unterminated (truncated) block loses its remainder rather than serving a
partial key.
* `MaxDetectionsPerScan` was reused as a replacement cap, making it a
disclosure budget: the 51st secret in a payload was served raw, and the
entropy sweep masked at most five strings. Masking is no longer capped — work
is bounded by the fixed pattern set (each applied once over de-duplicated
matches) and by the payload sizes the activity log already caps. The entropy
sweep gets a work bound two orders of magnitude above what it reports.
* The masker was only installed when detection was enabled, so turning the
feature off started serving the credentials in records flagged while it was
on. It is installed unconditionally now, and `MaskText` no longer consults
the `enabled` flag. Per-category switches are still honoured.
* `/search` → `/tools` forwarded only a scalar `q`, dropping every other query
parameter and the hash.
Not changed, deliberately: `export?include_bodies=true` still resolves full
values AND `_auth_*`, because attributing a call to a user is the point of a
compliance export — the docs now say so instead of claiming `_auth_*` is
stripped everywhere. The sub-second window between a record being saved and the
async detector flagging it is also documented rather than closed; closing it
means scanning synchronously on the dispatch path.
The server-edition activity handlers serialize raw storage records, but their
filter is wired nil today (the endpoints return empty), so they are commented
rather than plumbed.
Removing the replacement cap made "a payload stuffed with secrets" the worst case rather than an impossible one, and per-value strings.ReplaceAll re-scanned the whole payload once per secret found — quadratic exactly where it now matters. Collect the (value, preview) pairs per pattern and hand them to a single strings.Replacer instead. A 64KB response (the activity_max_response_size cap) of nothing but distinct GitHub tokens masks in ~12ms; the new test fails above 2s.
Round 2 of the cross-model review; every finding reproduced before fixing.
* SSE masking was keyed on field NAMES and so missed `detection_text` (the raw
pre-encoding response, spec 084), `intent` (prose the calling agent wrote),
and the `response` values that are `any` rather than string on the
internal-call and prompt paths. The payload shape keeps growing, and an
allowlist leaks each new field until someone remembers to add it — so the
field list is now only the TRIGGER, and a qualifying event has every string
in it masked. The shared event map is still never edited in place.
* `POST /api/v1/tool-calls/{id}/replay` returned the new record straight from
the controller, unmasked. A replay is a tool call like any other.
* `metadata` was serialised untouched, and `metadata.intent.reason` is
agent-authored: an agent explaining "rotating AKIA…" put the value back in a
field nothing masked. Flagged records now have their metadata swept too; the
detection block is short identifiers no pattern matches, so it survives.
* `maskKeyBlocks` ended a block at the first `-----END` rather than at its own
footer, so a payload quoting an EC key inside an RSA key left the outer key's
remainder readable. It now looks for the matching `-----END <same type>-----`.
Block masking is also gated on the match being a real `-----BEGIN` header, so
a custom pattern filed under private_key can no longer eat the text after an
ordinary match.
* The entropy sweep still carried Scan's find-limit (500 masks, and only 1000
candidates examined) — a disclosure budget by another name. Masking now walks
every candidate in the payload itself instead of reusing
FindHighEntropyStrings.
The remaining round-2 finding, quadratic per-match ReplaceAll, was already
fixed in 78c8de3 (single strings.Replacer pass) — the review measured the
commit before it.
Whole-payload event masking is only safe if the ids the UI joins on survive it: a masked parent_id would silently break code_execution parent-child linking, and a masked session id would break session grouping. ULIDs, request ids, MCP session ids, work-session ids and scan ids all sit under the entropy threshold today — this pins that, so a future threshold or pattern change fails here instead of in the Activity view.
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 32845891985 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Dumbris
added a commit
that referenced
this pull request
Aug 26, 2026
The document read as an open P0-P3 backlog, but seven PRs merged on 2026-08-25 (#1044, #1048, #1049, #1051, #1052, #1053, #1054) closed it. Anyone opening this file against current main was being handed 36 stale defects. Added a status banner and a Resolution section that separates three things honestly: - Re-checked live on v0.61.0 against a running isolated core with real /mcp traffic: F1, F4, F5, F7, F8, F12, F13, F20, F24, F26, F33 confirmed fixed, each with the observed evidence rather than a PR reference. - Still open: F6 is half fixed. Focus enters the Add Server dialog and submit is in a sticky footer, but Escape still does not close it - AddServerModal.vue has no key handler and JsonViewer.vue is the only component under components/ that handles Escape at all. F28's "key called optional" half is fixed; its three-surfaces state is not. - Not re-checked: named explicitly rather than implied, so the next reader knows which closures rest on a PR body and which on an observation. Five defects found on main while re-checking are recorded separately, since they are not regressions of anything in the audit. The first is security-relevant: quarantining a server through the config file leaves its tools in the search index, so retrieve_tools still hands the agent their names and descriptions - which is exactly what quarantine exists to prevent - before the call is refused. Runtime.QuarantineServer purges the index; the reload path detects the same transition (quarantined_changed: true) and does not. Also corrects the record on #1053: its body names F1-F16, which is the tray audit's numbering mis-pasted. #1055 is the tray PR; #1053 touches no Swift file.
Dumbris
added a commit
that referenced
this pull request
Aug 26, 2026
The document read as an open P0-P3 backlog, but eight PRs merged on 2026-08-25 (#1044, #1048, #1049, #1050, #1051, #1052, #1053, #1054) closed it. Anyone opening this file against current main was being handed 36 stale defects. Added a status banner and a Resolution section that separates four things: - Re-checked live on v0.61.0 against a running isolated core with real /mcp traffic: F1, F4, F5, F6, F7, F8, F12, F13, F20, F24, F26, F33 confirmed fixed, each with the observed evidence rather than a PR reference. - Not re-checked: named explicitly rather than implied, so the next reader knows which closures rest on a PR body and which on an observation. F28 is called out as partial - its "key called optional" half is fixed, its three-surfaces-at-once state is not. - Corrections to the audit itself: F23 mis-diagnosed a per-request structural estimate as a stale aggregation, and F31's "Manual badge has no tooltip" half was wrong even at audit time (spec-088 trust-mode badge, already titled). - Five defects found on main while re-checking, recorded separately since they are not regressions of anything in the audit. The first is security-relevant: quarantining a server through the config file leaves its tools in the search index, so retrieve_tools still hands the agent their names and descriptions - which is exactly what quarantine exists to prevent - before the call is refused. Runtime.QuarantineServer purges the index; the reload path detects the same transition (quarantined_changed: true) and does not. F6 carries a methodology note. Re-checking it produced a false negative: Escape driven through the browser-automation layer never reaches the page's document keydown listener, so the dialog looked stuck open. Dispatched in-page it closes at once, and #1050's useModalA11y is wired into all five <dialog :open> modals. The sweep assertion this document proposes must dispatch in-page, or it tests the automation layer instead of the app. Also corrects the record on #1053: its body names F1-F16, which is the tray audit's numbering mis-pasted. #1055 is the tray PR; #1053 touches no Swift file.
Dumbris
added a commit
that referenced
this pull request
Aug 26, 2026
* docs(qa): Web UI UX audit — ranked findings (ux-audit epic) Heuristic + live-instance audit of every routed Web UI view in light/dark, first-run and populated states, at 1440/820/390px. 36 findings ranked P0-P3 with view, evidence, heuristic violated, suggested fix and effort. Audited against standard heuristics plus the house activity-UI rules (grouping, failure-only status, intent reason, histogram/log parity). * docs(qa): record what the Web UI audit's backlog actually resolved to The document read as an open P0-P3 backlog, but eight PRs merged on 2026-08-25 (#1044, #1048, #1049, #1050, #1051, #1052, #1053, #1054) closed it. Anyone opening this file against current main was being handed 36 stale defects. Added a status banner and a Resolution section that separates four things: - Re-checked live on v0.61.0 against a running isolated core with real /mcp traffic: F1, F4, F5, F6, F7, F8, F12, F13, F20, F24, F26, F33 confirmed fixed, each with the observed evidence rather than a PR reference. - Not re-checked: named explicitly rather than implied, so the next reader knows which closures rest on a PR body and which on an observation. F28 is called out as partial - its "key called optional" half is fixed, its three-surfaces-at-once state is not. - Corrections to the audit itself: F23 mis-diagnosed a per-request structural estimate as a stale aggregation, and F31's "Manual badge has no tooltip" half was wrong even at audit time (spec-088 trust-mode badge, already titled). - Five defects found on main while re-checking, recorded separately since they are not regressions of anything in the audit. The first is security-relevant: quarantining a server through the config file leaves its tools in the search index, so retrieve_tools still hands the agent their names and descriptions - which is exactly what quarantine exists to prevent - before the call is refused. Runtime.QuarantineServer purges the index; the reload path detects the same transition (quarantined_changed: true) and does not. F6 carries a methodology note. Re-checking it produced a false negative: Escape driven through the browser-automation layer never reaches the page's document keydown listener, so the dialog looked stuck open. Dispatched in-page it closes at once, and #1050's useModalA11y is wired into all five <dialog :open> modals. The sweep assertion this document proposes must dispatch in-page, or it tests the automation layer instead of the app. Also corrects the record on #1053: its body names F1-F16, which is the tray audit's numbering mis-pasted. #1055 is the tray PR; #1053 touches no Swift file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Web UI UX audit (
docs/qa/ux-audit-webui-2026-08.md) — the security-surfaces + routing-polish cluster: F13, F15, F20, F31, F33, plus the F36 item in this area.F13 — the drawer printed the secret it just flagged (security)
A call flagged
critical · aws_access_keyrendered, a few hundred pixels under the red detection panel,"message": "AKIAIOSFODNN7EXAMPLE aws key here"in cleartext with a Copy button — and the internal_auth_auth_type: "admin"beside it.The raw value was in the API response, so the fix is server-side:
internal/httpapi/activity.go→maskActivityPayloads, applied toGET /api/v1/activityandGET /api/v1/activity/{id}, plus the other read paths a cross-model review turned up (see below).arguments,responseanderror_messageis replaced with a recognisable preview —AKIAIOSFODNN7EXAMPLE→AKIA…****. Enough to know which credential to rotate, not enough to use. A private key goes whole, envelope and body: its pattern matches only the-----BEGIN …-----line, so masking the match alone would have replaced the label and served the key.has_sensitive_data: true), so an unflagged payload costs nothing._auth_*arguments are stripped from every browsing response — plumbing, not caller input.internal/security/mask.go:MaskValue,Detector.MaskText,MaskArguments,MaskJSON,StripInternalArgs. It honours the same per-category switches as detection. Two deliberate differences from the existingRedact: it also masks known example values (the drawer ends up in screenshots, and "it only looked like a secret" is not a judgement the rendering surface gets to make), and it ignores theenabledflag, so turning detection off later does not start serving the credentials in records flagged while it was on.Redacting in the client was rejected: the raw value would still be on the wire and in the browser's network log.
Full values stay reachable through the one deliberate surface that already gates them:
GET /api/v1/activity/export?include_bodies=true(mcpproxy activity export --include-bodies) — the compliance/incident-response path, not a browsing one. That export keeps_auth_*too: attributing a call to a user is the point of it. The drawer says where full values live, and badges both payload panels Masked.mcpproxy activity showreads the detail endpoint, so it is masked too. Documented indocs/features/sensitive-data-detection.md(which previously over-promised redaction that was not happening).The other read paths (cross-model review)
Two rounds of opencode/gpt-sol review found the API boundary necessary but not sufficient. Every finding was reproduced against the code before fixing:
/eventsstreamed the raw payload to every SSE subscriber — Web UI, tray,mcpproxy activity watch— and the frontendconsole.logged it straight into the DevTools console. Those events are emitted at completion time, before the async detector has a verdict, so there is no flag to gate on: the SSE writer masks unconditionally, and the payload logging is gone. A first attempt keyed on field names and still misseddetection_text(the raw pre-encoding response),intent(agent-authored prose) and theresponsevalues that areanyrather than string — the payload shape keeps growing, so the field list is now only the trigger and a qualifying event has every string in it masked. The shared event map is never edited in place, and the identifiers the UI joins on (request id, parent id, session ids, ULIDs) sit under the entropy threshold — pinned by a test, since a maskedparent_idwould silently break code-execution parent↔child linking.error_messagewas unmasked. An upstream error commonly quotes the payload it choked on, so masking the response alone just moved the leak.metadatawas unmasked, andmetadata.intent.reasonis prose the calling agent wrote — an agent explaining "rotating AKIA…" put the value straight back into a field nothing masked./api/v1/tool-calls,/tool-calls/{id},/servers/{id}/tool-callsare a separate store with no detection metadata and bypassed masking entirely; so did the replay endpoint's returned record. All mask unconditionally now.-----END, so a payload quoting an EC key inside an RSA key left the outer key's remainder readable. A block now ends at its own footer, and block masking is gated on the match being a real-----BEGINheader so a custom pattern filed underprivate_keycannot eat trailing text.MaxDetectionsPerScanbounds what is worth reporting; reused as a replacement cap it meant the 51st secret in a payload was served raw, and the entropy sweep masked at most five strings (and examined only the first 1,000 candidates). The caps are gone from the mask path — it walks every candidate itself — and, since "a payload stuffed with secrets" is now the worst case rather than an impossible one, per-valueReplaceAllbecame a singlestrings.Replacerpass. A 64KB response of nothing but distinct tokens masks in ~12ms (test fails above 2s)./search→/toolsforwarded only a scalarq, dropping other query params and the hash.Left as-is, deliberately: the sub-second window between a record being saved and the async detector flagging it (closing it means scanning synchronously on the dispatch path) — documented instead; and the server-edition activity handlers, whose
activityFilteris wiredniltoday (the endpoints return empty), which carry a comment pointing at the masking helper for whoever wires them.F15 — four zero tiles while loading
The stat row sat outside
v-if="loading && !initialized", sooverview = {}renderedScanners Installed 0 · Total Scans 0 · Active Scans 0 · Findings 0before the page had looked. The tiles now skeleton (titles kept, numerals withheld) until the first/security/overviewresponse lands.F20 —
/searchorphan/searchwas a third search surface: routed but sidebar-less, marketing-styled, duplicating both the header box and the Tools page. Tools is the canonical one — it is in the sidebar, it lists what it searches, and it can act on the results — so:/searchredirects to/tools, carrying the whole query and hash across so old links keep their state.Search.vuedeleted.?q=on mount and on later route changes (a second header search is a query change, not a remount).F31 — unexplained header jargon
Mode: Retrievegains a tooltip and an aria-label. Label and explanation live together infrontend/src/utils/routingMode.tsso they cannot drift. (The per-cardManualtrust badge the audit also named already carries atitlefrom spec 088 — verified, left alone.)F33 — deep links without
/uireturned a raw Go 404http://127.0.0.1:8080/activityanswered404 page not foundin plain text. Known UI paths now302into the SPA (internal/server/ui_redirect.go), preserving the escaped path (an encoded/in a server name survives) and the query string (?apikey=is how a browser authenticates on a fresh profile). An allowlist on purpose: a blanket redirect would answer a mistyped API path with an HTML page. Unknown paths still 404.F36 (this area)
Tools table descriptions carry a
title, so the clipped half is readable without opening the tool.Not attempted, and why: the collapsed sidebar's icon-only rows still rely on hover
title. An instant tooltip there is not an S-effort tweak — the nav container isoverflow-y-auto overflow-x-hidden, which clips any flyout to its right; fixing it properly means either persistent micro-labels or a portalled tooltip, and belongs with whoever owns the sidebar.Verification
Unit — 676 frontend tests (4 new specs),
vue-tscclean;go test -raceoninternal/security,internal/httpapi,internal/server(plus-tags serveroninternal/serveredition); golangci-lint v2 (.github/.golangci.yml) 0 issues; both editions build.Live, isolated instance (
127.0.0.1:18450, scratch config + data dir,everythingserver over npx):AKIAIOSFODNN7EXAMPLE, and a second with a non-exampleAKIA…/ghp_…pair:GET /api/v1/activity→"message": "AKIA…**** aws key here",_auth_auth_typeabsent.GET /api/v1/activity/{id}→ same.GET /api/v1/activity/export?include_bodies=true→ full value, as designed./AKIA[0-9A-Z]{16}/and/ghp_[A-Za-z0-9]{20,}/in the rendered page, 5 masked previews, both Masked badges, the explanation line, no_auth_keys.GET /eventswhile the call ran: zero raw keys in the stream, masked previews in both the started and completed events, and the payload otherwise intact (server_name,tool_name,status,duration_ms,request_id,session_id, byte counts)../scripts/run-web-smoke.sh,MCPPROXY_FIXTURE_PATHset so nothing skips): 5/5 — servers list, server detail + security tab, tools page and its search, activity log, settings.1 · 1 · 0 · 0 · Signatures 7./search?q=echo(no prefix) →302 /ui/search?q=echo→/ui/tools?q=echo, search box prefilled, one matching row./servers→302 /ui/servers;/settings?apikey=x→302 /ui/settings?apikey=x;/nope→ still404.Mode: Retrievetooltip reads its description; header Search buttondisabled === falsewith an empty box.No API shape change, so no
make swaggerregeneration.