Skip to content

/status: fix stale "II /mcp delegation flow enabled" check - #38

Merged
aterga merged 2 commits into
mainfrom
claude/mcp-spec-compliance-9202ka
Jul 5, 2026
Merged

aterga merged 2 commits into
mainfrom
claude/mcp-spec-compliance-9202ka

Conversation

@aterga

@aterga aterga commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

The /status dashboard's "II /mcp delegation flow enabled" check WARNs because it asserts II's /mcp CSP form-action allows https:. That was the precondition for the old delegation flow, where II form-POSTed the delegation to the server. internet-identity#4086 removed that flow, so form-action no longer allows https: (it's now 'self' http://127.0.0.1:*, tightened on purpose and locked by a regression test). The 127.0.0.1 entry is for the unrelated /cli loopback flow, not MCP.

Why it's a false positive

The current connect flow never form-POSTs:

  • the key-request and completion callbacks are fetch() calls (governed by connect-src, which allows the https origin), and
  • the hand-back to finish_url is a top-level navigation (not governed by form-action).

Nothing is blocked — the end-to-end connect works today.

Fix

Took the ticket's preferred option: drop the form-action assertion and just check GET <ii>/mcp returns 200. Per-user trust is on-chain and not globally inspectable, so a served connect page is the only meaningful instance-wide signal.

  • checks.js: ii-mcp-flow now pass on 200 / fail otherwise (no more warn); removed the form-action parse, the facts.mcpFormAction fact, and the allowsHttpsPost logic. Rewrote the description, expected, target, and detail to describe the fetch + finish_url navigation model.
  • checks.js: dropped the now-dead warn suggestion in buildSuggestions.
  • README.md: refreshed both spots that described the retired form-POST model.
  • checks.test.js: replaced the obsolete "warns when form-action forbids https posts" test with "passes on a served /mcp even with loopback-only form-action", which pins the fix.

parseCspDirective is kept (still used for the frame-ancestors check).

Tests

Full monitoring suite green: 17/17 (node --test).

🤖 Generated with Claude Code

https://claude.ai/code/session_014T9N8USDfNK5yzznPGg7Ym


Generated by Claude Code

The "II /mcp delegation flow enabled" check WARNed because it asserted the
/mcp CSP form-action allows https:. That was the precondition for the old
delegation flow, where II form-POSTed the delegation to the server. II #4086
retired that flow, so form-action no longer allows https: (it's now 'self'
http://127.0.0.1:*, tightened on purpose); the 127.0.0.1 entry is for the
unrelated /cli loopback flow, not MCP.

The current connect flow never form-POSTs: the key-request and completion
callbacks are fetch() calls (governed by connect-src, which allows the https
origin) and the hand-back to finish_url is a top-level navigation (not governed
by form-action). Nothing is blocked — the check was a false positive.

Fix (the ticket's preferred option): drop the form-action assertion and just
verify GET <ii>/mcp returns 200. Per-user trust is on-chain and not globally
inspectable, so a served connect page is the only meaningful instance-wide
signal. Updates the check description/expected/detail, drops the now-dead WARN
suggestion, and refreshes the dashboard README. Replaces the obsolete "warns on
loopback-only form-action" test with one pinning that a served /mcp now passes
regardless of form-action.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014T9N8USDfNK5yzznPGg7Ym
@aterga
aterga requested a review from Copilot July 5, 2026 20:13
@aterga
aterga marked this pull request as ready for review July 5, 2026 20:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the /status monitoring dashboard’s Internet Identity /mcp health check to align with the post-#4086 connect flow (fetch + navigation), removing the stale CSP form-action assertion that was causing false WARNs.

Changes:

  • Simplifies the ii-mcp-flow check to pass/fail based on GET <ii>/mcp returning 200.
  • Removes the form-action parsing/logic and the related WARN suggestion path.
  • Updates documentation and tests to reflect that “page served” is the meaningful instance-wide signal.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
monitoring/mcp-status/README.md Updates the documented model of the II /mcp connect flow and what the dashboard asserts.
monitoring/mcp-status/checks.test.js Replaces the obsolete CSP-based WARN test with a served-page PASS test.
monitoring/mcp-status/checks.js Removes form-action-based health logic and updates the check text/details and suggestions accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread monitoring/mcp-status/checks.js Resolved
Comment thread monitoring/mcp-status/README.md Resolved
Follow-up to the review: the check now only asserts GET <ii>/mcp returns 200,
so "delegation flow enabled" was misleading. Rename the user-facing label to
"II /mcp connect page served" (the `ii-mcp-flow` id is unchanged) and align the
remaining "delegation flow enabled" phrasings in the linkage description and
README (heading + question 2) with the connect-page terminology. The historical
reference to the old form-POST delegation flow is left intact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014T9N8USDfNK5yzznPGg7Ym
@aterga
aterga merged commit 9ccbe95 into main Jul 5, 2026
1 check passed
aterga pushed a commit that referenced this pull request Jul 5, 2026
Resolve the conflict in src/main.rs: PRs #35/#37/#38 landed on main while this
branch was open. The only content conflict was the Candid encode/decode layer —
#37 added CWE-674 hardening (guard_candid_text + MAX_CANDID_DEPTH/size caps) to
the very functions this branch had moved into the new src/calls.rs module.

Resolution: keep this branch's structure (the functions live in calls.rs) and
port #37's hardening into calls.rs:
- guard_candid_text / MAX_CANDID_TEXT_BYTES / MAX_CANDID_DEPTH / depth_err now
  live in calls.rs (pub(crate)), used by encode_args + decode_bytes_with_did.
- management.rs's install-arg guard now calls crate::calls::guard_candid_text.
- the CWE-674 guard test moved to calls::tests alongside the function.

discover.rs (SSRF #35 + discovery buffering #37), management.rs, and the
monitoring/* changes auto-merged. Build clean, all 53 tests pass, no new clippy
warnings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hv4cGJfD97SGxHM2myTAbA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants