Skip to content

Handle HTML text including greater and less than symbols#2475

Merged
dpaulson45 merged 1 commit into
mainfrom
dpaul-HcDevHtml
Nov 24, 2025
Merged

Handle HTML text including greater and less than symbols#2475
dpaulson45 merged 1 commit into
mainfrom
dpaul-HcDevHtml

Conversation

@dpaulson45
Copy link
Copy Markdown
Member

@dpaulson45 dpaulson45 commented Nov 6, 2025

Issue:
When <I> or <S> tags are within the TlsCertificateName, html table builds it with italics and strikethrough.

Reason:
We should properly handle this to avoid HTML to use those as HTML tags.

Fix:
Change the text from < and > to &lt; and &gt; for HTML text tags only.

Validation:
Lab tested

lusassl-msft
lusassl-msft previously approved these changes Nov 6, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds HTML character escaping to prevent rendering issues when displaying text containing angle brackets (< and >) in HTML output. The changes introduce a new helper function GetHtmlTextValue that converts these special characters to their HTML entity equivalents before assigning values to DetailValue properties.

Key Changes:

  • Added GetHtmlTextValue helper function to escape HTML special characters
  • Applied HTML escaping to all DetailValue assignments in both ServerDetails and OverviewValues sections

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Diagnostics/HealthChecker/Analyzer/Add-AnalyzedResultInformation.ps1 Outdated
Comment thread Diagnostics/HealthChecker/Analyzer/Add-AnalyzedResultInformation.ps1 Outdated
Comment thread Diagnostics/HealthChecker/Analyzer/Add-AnalyzedResultInformation.ps1 Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Diagnostics/HealthChecker/Analyzer/Add-AnalyzedResultInformation.ps1 Outdated
@dpaulson45
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dpaulson45
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dpaulson45
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@lusassl-msft
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dpaulson45
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dpaulson45
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dpaulson45 dpaulson45 merged commit d7d7508 into main Nov 24, 2025
6 checks passed
@dpaulson45 dpaulson45 deleted the dpaul-HcDevHtml branch November 24, 2025 22:02
pull Bot pushed a commit to f0r3ns1cat0r/CSS-Exchange that referenced this pull request Jun 5, 2026
…CVE detail row leaks

- Convert plain-text URLs to clickable hyperlinks in HTML report (fixes #532)
- Preserve <br> tags after HTML encoding in GetHtmlTextValue (PR microsoft#2475 regression)
- Add AddHtmlDetailRow = $false to 9 Security Vulnerability entries that were
  leaking individual CVE rows into the HTML detail table instead of only appearing
  in the rolled-up Security Vulnerabilities summary row
- Add Extract for Pester Testing markers to GetHtmlTextValue for testability
- Add GetHtmlServerDetail and GetHtmlOverviewValue test helpers
- Add 15 Pester tests: 11 unit tests for GetHtmlTextValue encoding/URL/br behavior
  and 4 integration tests for HTML report structure and CVE rendering

Files fixed for missing AddHtmlDetailRow:
  - Invoke-AnalyzerSecurityADV24199947.ps1
  - Invoke-AnalyzerSecurityCve-2022-21978.ps1
  - Invoke-AnalyzerSecurityCve-2022-41040.NotPublished.ps1
  - Invoke-AnalyzerSecurityCveAddressedBySerializedDataSigning.ps1
  - Invoke-AnalyzerSecurityCveAndOverrideCheck.ps1
  - Invoke-AnalyzerSecurityExtendedProtectionConfigState.ps1 (4 locations)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants