Skip to content

fix(trace-viewer): reject unsafe snapshot attribute names - #43911

Merged
Yury Semikhatsky (yury-s) merged 5 commits into
microsoft:mainfrom
yury-s:fix-snapshot-attribute-names
Nov 5, 2026
Merged

Yury Semikhatsky (yury-s) merged 5 commits into
microsoft:mainfrom
yury-s:fix-snapshot-attribute-names

Conversation

@yury-s

@yury-s Yury Semikhatsky (yury-s) commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Attribute names were written into the snapshot HTML without escaping. A crafted trace could use a name such as " onerror" to bypass the on* filter, or smuggle extra attributes after a space.
  • Drop names that contain whitespace, =, <, >, / or quotes, the same rule that already applies to tag names since fix(trace-viewer): reject unsafe snapshot tag names #42712.

Source - ICM

Attribute names were written into the snapshot HTML without escaping.
A crafted trace could use a name such as " onerror" to bypass the
event handler filter, or smuggle extra attributes after a space.
Drop names that contain whitespace, =, <, >, / or quotes, the same
rule that already applies to tag names.
Escaping and name validation now live in one class, so no raw string
from the trace reaches the HTML without going through it.
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

5194 passed, 616 skipped


Merge workflow run.

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

23586 passed, 704 skipped


Merge workflow run.

@yury-s
Yury Semikhatsky (yury-s) merged commit 7135071 into microsoft:main Nov 5, 2026
24 checks passed
@yury-s
Yury Semikhatsky (yury-s) deleted the fix-snapshot-attribute-names branch November 5, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants