Repository navigation
Commit daa2126
authored
feat(webui): deep-scan master control on the Security page, with truth badges (#952)
* fix(security): shadowing check needs clone evidence, not a name coincidence
Owner report against v0.53.0-rc.7: the TPA scanner raised a dangerous
finding because ElevenLabs and kaggle both expose list_models. A name
collision alone is the proxy's normal operating condition — mcpproxy
unifies many servers, every tool is namespaced server:tool, and
retrieve_tools' BM25 ranking is what disambiguates shared compound
names. No fixed "distinctive name" heuristic separates those from
attacks.
- Collision branch now requires impersonation-clone evidence: the same
name on another server AND a near-duplicate description (token-set
containment; cosmetic case/punctuation/whitespace edits do not
launder a copy). Bare coincidences are silent from both sides.
- Reference branch no longer fires when the tool's OWN server also
exposes the referenced name — "call list_models first" is ordinary
self-documentation, whoever else exposes that name.
- Corpus: the two shadowing entries now model the real clone attack
(they were bare collisions with honestly different descriptions —
the exact FP class); new hard-negative hn_name_coincidence encodes
the ElevenLabs/kaggle case as benign. Unicode escapes preserved.
- Docs updated (tool-scanner.md, security-quarantine.md).
* fix(security): codex round 1 — fixture consistency and clone-evidence robustness
- cmd/scan-eval gateFixture and the sh_collide_transfer corpus entry
modelled bare collisions (or byte-identical dups); both now model the
cosmetic-variant clone the check actually detects, so the gate
measures the real attack shape.
- hn_name_coincidence renamed hn_shadowing_name_coincidence per the
corpus id-prefix convention (detect_corpus_test hardNegPrefix).
- descTokens is unicode-aware: a Cyrillic/CJK description tokenizes to
real words instead of an empty set that could never evidence a clone.
- cloneDescriptions requires >=3 tokens per side: "Create" == "Create"
carries no information, and sub-minimal identical descriptions no
longer hard-flag a shared name.
- The two accepted trade-offs codex argued (different-description
collisions out of scope; own-server decoy silencing the reference
branch) are now documented at the decision sites: both reduce to the
name-coincidence policy the owner set (MCP-3520), whose defenses are
admission quarantine, server:tool namespacing, and retrieve_tools
provenance — not a collision alarm.
* fix(security): bigram-tokenize spaceless scripts for clone evidence (codex round 2)
FieldsFunc finds no word boundaries in unspaced Han/kana/Hangul/Thai
text, so an informative CJK description collapsed to ONE token and
ducked under the three-token evidence floor — a cloned unspaced
description could never be detected, and the round-1 test had cheated
with artificial spaces. Runs in spaceless scripts now emit character
bigrams (the standard segmentation-free indexing unit), which restores
both the floor and the containment thresholds for those scripts. The
boundary itself is now pinned: two identical tokens carry no clone
evidence, three do.
* feat(webui): deep-scan master control on the Security page, with truth badges
Owner report: five scanners toggled "enabled" in the Web UI, every scan
report tpa-only — the deep-scan master gate (Spec 077) was invisible on
the one page where its effect shows. The page pointed at Settings in a
paragraph (spec 088 FR-018); a paragraph is not a control.
- A "Deep scan" card now heads the scanners page: live on/off state, a
toggle wired to the same config field Settings writes (PATCH
/api/v1/config, hot-reloaded), a one-line statement of what a scan
will actually run right now, and a Docker warning when the layer is
on but Docker is not.
- The truth badge: an enabled Docker scanner under a disabled deep-scan
layer shows an amber "won't run" instead of a green "enabled" — the
row-level lie is the thing this page existed to prevent. The built-in
baseline (no docker_image) is exempt: it always runs, and calling it
"won't run" would be the same lie in the other direction. `null`
config state never accuses (no flicker on load).
- Logic lives in views/security/deepScanState.ts, pure and unit-tested
(13 cases incl. the baseline exemption and the not-yet-loaded state).
Verified end-to-end in Chrome against an isolated instance: toggle
flips the badge and persists to the config file; Settings reflects the
shared state; per-server trust_mode (auto/scan/manual, spec 086/088)
confirmed already configurable on the server Configuration tab.
* fix(webui): codex round 1 — PATCH serialization, rollback, focus refresh, copy
- handlePatchConfig now serializes its read-merge-apply under a mutex:
two concurrent config PATCHes (Security page + Settings in another
tab) both merged from the same snapshot and the later full-config
apply silently dropped the earlier change. Pre-existing hazard for
every PATCH caller, closed for all of them.
- A rejected PATCH now snaps the deep-scan checkbox back explicitly:
the browser flips the DOM before the request fails, and Vue sees an
unchanged :checked prop, so toggle/badge/summary could disagree.
- The card refreshes on window focus, so a Settings change in another
tab cannot leave the truth badges stale beyond a glance away.
- Copy: pass-1 Docker scanners run alongside the baseline, not after
it ("after" described pass 2).
* fix(webui): register page listeners before the first await (codex round 2)
An unmount during the startup awaits ran onUnmounted first and the
focus/scanner listeners were added afterward — leaked with nothing left
to remove them. Listeners now register synchronously at mount.1 parent c2f2285 commit daa2126
4 files changed
Lines changed: 281 additions & 21 deletions
File tree
- frontend
- src/views
- security
- tests/unit
- internal/httpapi
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
44 | 67 | | |
45 | 68 | | |
46 | 69 | | |
| |||
246 | 269 | | |
247 | 270 | | |
248 | 271 | | |
249 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
250 | 284 | | |
251 | 285 | | |
252 | 286 | | |
| |||
479 | 513 | | |
480 | 514 | | |
481 | 515 | | |
| 516 | + | |
482 | 517 | | |
483 | 518 | | |
484 | 519 | | |
| |||
506 | 541 | | |
507 | 542 | | |
508 | 543 | | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
509 | 550 | | |
510 | 551 | | |
511 | 552 | | |
| |||
713 | 754 | | |
714 | 755 | | |
715 | 756 | | |
716 | | - | |
| 757 | + | |
717 | 758 | | |
718 | 759 | | |
| 760 | + | |
719 | 761 | | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
720 | 765 | | |
721 | 766 | | |
722 | 767 | | |
| |||
737 | 782 | | |
738 | 783 | | |
739 | 784 | | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
740 | 830 | | |
741 | 831 | | |
742 | 832 | | |
| |||
971 | 1061 | | |
972 | 1062 | | |
973 | 1063 | | |
974 | | - | |
975 | | - | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
976 | 1067 | | |
| 1068 | + | |
| 1069 | + | |
977 | 1070 | | |
978 | 1071 | | |
979 | 1072 | | |
| |||
991 | 1084 | | |
992 | 1085 | | |
993 | 1086 | | |
| 1087 | + | |
994 | 1088 | | |
995 | 1089 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
207 | 215 | | |
208 | 216 | | |
209 | 217 | | |
| |||
4227 | 4235 | | |
4228 | 4236 | | |
4229 | 4237 | | |
| 4238 | + | |
| 4239 | + | |
| 4240 | + | |
| 4241 | + | |
| 4242 | + | |
4230 | 4243 | | |
4231 | 4244 | | |
4232 | 4245 | | |
| |||
0 commit comments