Repository navigation
fix(dashboard): allowlist URL schemes in rendered markdown - #3637
Merged
Daniel Meppiel (danielmeppiel) merged 5 commits intoNov 12, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 5 commits into
Daniel Meppiel (danielmeppiel) merged 5 commits into
Conversation
Links render only for http, https, mailto and relative URLs, and images only for http, https and relative URLs. Anything else renders as plain text. Scheme detection ignores ASCII whitespace and control characters the same way browsers do. Links also get rel="noopener noreferrer". Rebuild the dashboard bundle and run the existing markdown tests in CI. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 12, 2026 15:31
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unicode whitespace bypasses Markdown URL validation, allowing forbidden javascript: links and data: image URLs in both the source and committed dashboard bundle.
1 open issue
What changed in this PR
This PR hardens the contributor dashboard’s Markdown renderer by restricting link and image URL schemes and shipping the updated renderer in the installed dashboard.
Changes:
- Adds URL scheme allowlists, plain-text fallbacks, and
rel="noopener noreferrer"for links. - Adds security regression tests and includes the Markdown suite in both CI test commands.
- Rebuilds the committed dashboard assets and records the change in the changelog.
| File | Description |
|---|---|
packages/apm-contributor-dashboard/tests/markdown.test.mjs |
Tests URL filtering and link attributes. |
packages/apm-contributor-dashboard/client/src/utils/markdown.js |
Adds URL validation to link and image rendering. |
packages/apm-contributor-dashboard/.apm/extensions/issue-monitor/dist/index.html |
References the rebuilt JavaScript bundle. |
packages/apm-contributor-dashboard/.apm/extensions/issue-monitor/dist/assets/index-CtQNTi1o.js |
Ships the updated dashboard renderer. |
packages/apm-contributor-dashboard/.apm/extensions/issue-monitor/dist/assets/index-CRBU6-pe.js |
Removes the previous bundle. |
CHANGELOG.md |
Documents the Markdown URL restrictions. |
.github/workflows/ci.yml |
Adds Markdown tests to both dashboard test commands. |
Review effort: Balanced
Comment on lines
+26
to
+30
| const compact = unescapeHtml(escapedUrl).replace(/[\u0000-\u0020\u007f-\u009f]/g, ""); | ||
| if (!compact) return null; | ||
| const scheme = compact.match(/^([a-zA-Z][a-zA-Z0-9+.\-]*):/); | ||
| if (scheme && !allowedSchemes.has(scheme[1].toLowerCase())) return null; | ||
| return escapedUrl.trim(); |
Fail closed on any whitespace or control character in markdown link and image URLs, and emit exactly the string whose scheme was checked. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…rd-markdown-url-hardening
…rd-markdown-url-hardening
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel/dashboard-markdown-url-hardening
branch
November 12, 2026 16:09
9 of 14 tasks
Daniel Meppiel (danielmeppiel)
added a commit
to McNultyyy/apm
that referenced
this pull request
Nov 12, 2026
Refresh microsoft#2627 against current main; CHANGELOG Fixed entries from both sides kept (microsoft#2627 entry plus main's microsoft#3637 entry and microsoft#3642 Removed section). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 19, 2026
* docs(changelog): make 0.36.0 onwards legible and concise Rewrites [Unreleased], [0.36.1] and [0.36.0] as one short line per user-visible change, with Highlights and a Breaking changes and upgrade notes list per version, grouped PRs and internal-only entries dropped (#3637, #3771, #3794, #3796, #3877). Credits, PR references, the 0.36.1 issue closures and the live Azure DevOps caveat are kept. Sections from 0.35.1 down are unchanged. The changelog instructions now describe this style. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * chore(lock): record the new changelog instructions hash Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * docs: note the shared .mcp.json and VS Code Local mode in 0.37 upgrade notes Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * docs(changelog): restore accuracy qualifiers flagged in review Restores the static env caveat for .mcp.json, the pack default-format qualifier, Copilot CLI scope for COPILOT_HOME, the 0.36.1 frozen-lockfile recovery step, and the bundle install --target qualifier. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: danielmeppiel <danielmeppiel@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

Description
Hardens markdown rendering in the contributor dashboard.
renderMarkdown()now validates link and image URLs against a scheme allowlist before emittinghref/src:http,https,mailto, or relative / fragment URLs.http,https, or relative URLs.Scheme detection removes ASCII whitespace and control characters first, as browsers do, and fails closed. Links also get
rel="noopener noreferrer".Other changes:
.apm/extensions/issue-monitor/dist) is rebuilt from source, so the change takes effect for installed dashboards.tests/markdown.test.mjssuite now runs in CI. It was not wired in before.Issue and approved scope
Issue: private security coordination. Report details are intentionally not disclosed.
Human scope-approval comment: approved by Daniel Meppiel (@danielmeppiel) through private security coordination.
Does this PR complete the issue, or what remains? It completes the fix for the dashboard markdown renderer.
Type of change
Testing
node --test packages/apm-contributor-dashboard/tests/logic.test.mjs packages/apm-contributor-dashboard/tests/markdown.test.mjs packages/apm-contributor-dashboard/tests/server.test.mjspasses 248/248.Spec conformance (OpenAPM v0.1)