Skip to content

[wasm] Html Encode incoming parameters to debug page - #67875

Merged
maraf merged 1 commit into
mainfrom
maraf/WasmDebugTargetUrl
Jul 17, 2026
Merged

maraf merged 1 commit into
mainfrom
maraf/WasmDebugTargetUrl

Conversation

@maraf

@maraf maraf commented Jul 17, 2026

Copy link
Copy Markdown
Member

Encode query parameters incoming to WebAssembly debugging help page.

@maraf maraf added this to the 11.0-preview7 milestone Jul 17, 2026
@maraf maraf self-assigned this Jul 17, 2026
Copilot AI review requested due to automatic review settings July 17, 2026 09:53
@maraf
maraf requested a review from a team as a code owner July 17, 2026 09:53
@maraf maraf added the area-blazor Includes: Blazor, Razor Components label Jul 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Encodes user-supplied query parameter values before rendering them into the WebAssembly debugging target picker UI HTML, reducing the risk of HTML/script injection on the debug help page.

Changes:

  • Introduced pre-encoded HTML-safe strings for url query parameter and the debugger tabs endpoint URL.
  • Updated multiple HTML responses to use the encoded values when rendering instructions and diagnostics.
Comments suppressed due to low confidence (1)

src/Components/WebAssembly/Server/src/TargetPickerUi.cs:301

  • The exception is written to the HTML response without encoding. If an exception message/stack contains angle brackets (or other HTML), this can result in HTML/script injection in the debug page. Encode the exception before embedding it in the
     block.
<h2>Underlying exception:</h2>
<pre>{ex}</pre>
                ");

@maraf
maraf enabled auto-merge (squash) July 17, 2026 11:48
@maraf
maraf merged commit b309e35 into main Jul 17, 2026
36 checks passed
@maraf
maraf deleted the maraf/WasmDebugTargetUrl branch July 17, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants