Repository navigation
status: fix the DCR check for the allow-list, and monitor the guard - #72
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the status dashboard’s OAuth Dynamic Client Registration (DCR) probe to align with the hosted-redirect allow-list behavior, and adds a new probe that actively monitors that allow-list guard remains enforced.
Changes:
- Switch the existing DCR check to register a loopback redirect URI so it continues to validate “self-registration mints a
client_id” without depending on hosted domains. - Add a new check that verifies non-allow-listed hosted redirects are rejected with
400 invalid_redirect_uri. - Extend the test harness
stubFetchto support function-based routes and update/oauth/registermocking accordingly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| monitoring/mcp-status/checks.js | Adjusts the DCR probe to use loopback redirect URIs and introduces a new allow-list enforcement check. |
| monitoring/mcp-status/checks.test.js | Enhances the fetch stub to support function routes and adds a registration mock that mirrors allow-list behavior; asserts the new check. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aterga
force-pushed
the
claude/monitor-dcr-allowlist
branch
from
July 21, 2026 15:15
6969e59 to
57567c8
Compare
aterga
force-pushed
the
claude/monitor-dcr-allowlist
branch
from
July 21, 2026 15:40
57567c8 to
8730961
Compare
… guard The OAuth Dynamic Client Registration check registered with a hosted redirect (https://example.org/callback) and expected a client_id. Since the allow-list shipped (#69), that hosted redirect is correctly rejected with 400 invalid_redirect_uri, so the check went red for a working server. - oauth-register: register a LOOPBACK redirect instead (always permitted; the allow-list exempts loopback), which still confirms a client can self-register and get a client_id, the case DCR is for. - oauth-register-allowlist (new): register a non-allow-listed hosted redirect and assert it's rejected with 400 invalid_redirect_uri, so the dashboard positively monitors that the CWE-601 guard stays enforced. - test harness: stubFetch now accepts a function route so a single endpoint can answer by request body; the /oauth/register mock mirrors the allow-list (201 for loopback, 400 for a hosted non-allow-listed redirect). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014T9N8USDfNK5yzznPGg7Ym
aterga
force-pushed
the
claude/monitor-dcr-allowlist
branch
from
July 21, 2026 15:52
8730961 to
0a84246
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
monitoring/mcp-status/checks.test.js:73
registerRouteaims to mirror the server’sis_loopback_redirect, but the JS check can incorrectly treat URLs with explicit empty userinfo as loopback (e.g.http://@127.0.0.1/cborhttp://:@127.0.0.1/cb). The server rejects these becausepassword().is_none()must hold (seesrc/auth.rs:1428-1432), while in the WHATWGURLAPI bothusernameandpasswordcan be empty strings even when userinfo is present. Consider additionally rejecting any@in the authority to ensure the mock matches the real guard.
loopback =
u.protocol === "http:" &&
u.username === "" &&
u.password === "" &&
["localhost", "127.0.0.1", "[::1]", "::1"].includes(u.hostname);
This was referenced Aug 25, 2026
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.
Summary
The status dashboard's OAuth Dynamic Client Registration check went red once the hosted-redirect allow-list shipped (#69) and reached beta. It registered with a hosted redirect (
https://example.org/callback) and expected aclient_id; the allow-list now correctly rejects that with400 invalid_redirect_uri. The failure is expected server behavior — the check was stale.This fixes the check to reflect the new reality, and adds a check that positively monitors the guard.
Related issues
Follows #69 (hosted-redirect allow-list, CWE-601). No GitHub issue open.
Changes
oauth-register: register a loopback redirect (http://127.0.0.1:8765/callback) instead of a hosted one. Loopback is always permitted (the allow-list exempts it), so this still confirms a client can self-register and receive aclient_id— the case DCR exists for — without coupling the check to any vendor domain.oauth-register-allowlist(new check): register a non-allow-listed hosted redirect and assert it is rejected with400 invalid_redirect_uri. The dashboard now positively verifies the CWE-601 open-registration phishing guard stays enforced on the live server.stubFetchnow accepts a function route (backward-compatible) so one endpoint can answer by request body; the/oauth/registermock mirrors the allow-list (201 +client_idfor loopback, 400invalid_redirect_urifor a non-allow-listed hosted redirect). Both register checks are asserted.Testing
cargo build --locked --all-targets— not applicable (no Rust change)cargo test --locked --all-targets— not applicable (no Rust change)cargo fmt --all/cargo clippy --all-targets— not applicable (no Rust change)npm test --prefix monitoring/mcp-status— 17 passing (adds the allow-list assertion)Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_014T9N8USDfNK5yzznPGg7Ym
Generated by Claude Code