Repository navigation
Harden Markdown URL validation - #19698
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19698Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19698" |
Tests selector (audit mode)The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement. 8 / 102 test projects · 3 jobs, from 2 changed files. Selected test projects (8 / 102)
Selected jobs (3)
How these were chosen — grouped by what changed🔧 📦 affected project 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
Pull request overview
Hardens Dashboard Markdown rendering by prohibiting URLs that System.Uri cannot classify.
Changes:
- Treats unparseable Markdown URLs as prohibited.
- Adds regression tests for encoded-newline
vscodeand HTTP URLs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Aspire.Dashboard/Model/Markdown/MarkdownHelpers.cs |
Rejects URLs when URI parsing fails. |
tests/Aspire.Dashboard.Tests/Markdown/MarkdownProcessorTests.cs |
Verifies malformed URLs have their targets removed. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
✅ No documentation update needed. Step 5 branch taken: Triggered signals: none (signal_count = 0 in Rationale: The PR only modifies |
|
The CI build failed due to test failure(s) that appear unrelated to the PR changes. These may be flaky tests. Suspected flaky test(s): Suggested actions:
You can re-run the failed jobs from the workflow run page. |
Description
Markdown links that
System.Urican't parse were previously left unclassified. Browsers and registered protocol handlers can accept URLs thatSystem.Urirejects, so an unparseable URL could still be rendered instead of being removed.This change classifies unparseable URLs as prohibited. It adds regression coverage for encoded-newline URLs using both
vscodeand HTTP schemes.Security considerations
This tightens the trust boundary for Markdown links: URLs must be successfully classified before they can be rendered. The change has not had a formal threat model or security review.
Validation:
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?