Skip to content

fix(docs): validate reference and redirect scope - #15

Merged
matcra587 merged 1 commit into
mainfrom
mc/docs-reference-scope
Sep 22, 2026
Merged

matcra587 merged 1 commit into
mainfrom
mc/docs-reference-scope

Conversation

@matcra587

@matcra587 matcra587 commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Description

A foreign URL with a known documentation path could be silently interpreted as a local page, and redirects could leave the configured documentation scope. Validate origin, base path, encoding and version scope before lookup or fetch, while preserving supported slugs and Markdown URLs.

Test Procedure

  • mise run ci: formatting, lint, offline race tests, vulnerability checks, release checks and all five compilation targets.
  • TestReferenceScope, TestLookupRejectsForeignAuthority and TestLookupRedirectScope cover deceptive authorities, malformed encoding and redirects; rejected destinations receive zero requests.
  • Race-enabled live stdio MCP canary across all nine languages; 30-second FuzzReference run.

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore
  • Tests pass and code is formatted/linted
  • Docs updated (if needed)

Additional Notes

Full URLs must match the configured origin and base path. Query strings, protocol-relative URLs and enterprise/version paths now return explicit errors instead of being reinterpreted as current GitHub.com documentation.

@matcra587
matcra587 added this pull request to stack #18 September 21, 2026 23:55
@matcra587 matcra587 added the bug Something isn't working label Sep 21, 2026
@matcra587 matcra587 self-assigned this Sep 21, 2026
@matcra587
matcra587 marked this pull request as ready for review September 22, 2026 00:00
@matcra587
matcra587 merged commit 8bb905b into main Sep 22, 2026
13 checks passed
@matcra587
matcra587 deleted the mc/docs-reference-scope branch September 22, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant