Skip to content

Restrict Mermaid diagram template interpolation - #4333

Open
siegfriedpammer wants to merge 1 commit into
masterfrom
fix/html-diagrammer-xss
Open

siegfriedpammer wants to merge 1 commit into
masterfrom
fix/html-diagrammer-xss

Conversation

@siegfriedpammer

Copy link
Copy Markdown
Member

A crafted assembly can inject HTML and script content into the generated Mermaid diagram page through assembly metadata. Encode HTML-valued fields while preserving the serialized model JSON and trusted repository URL.

Finding: ANT-2026-7PFYC9E7

Verification: the branch formats cleanly. The full build was attempted, but the local reference-assembly annotator cache is missing Microsoft.Build.BackEnd.TaskParameter+TaskParameterTaskItem, so tests could not run locally.

Assisted-by: OpenCode:gpt-5.6-luna:OpenCode

Assisted-by: OpenCode:gpt-5.6-luna:OpenCode
"{{SourceAssemblyVersion}}" => WebUtility.HtmlEncode(model.SourceAssemblyVersion),
"{{BuilderVersion}}" => DecompilerVersionInfo.FullVersionWithCommitHash,
"{{RepoUrl}}" => RepoUrl,
"{{Model}}" => modelJson,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Explain why these other fields don't also need to be encoded.

This branch has not been deployed

No deployments
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