Skip to content

Fix HTML injection in hwqueue comparison report generator#121

Draft
Copilot wants to merge 2 commits intoprosenj_cli_hq_eval_report_phase_8from
copilot/sub-pr-105
Draft

Fix HTML injection in hwqueue comparison report generator#121
Copilot wants to merge 2 commits intoprosenj_cli_hq_eval_report_phase_8from
copilot/sub-pr-105

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

Dynamic values (baseline_label, test_label, workload names, verdict strings) were interpolated directly into HTML without escaping, enabling HTML injection via user-provided labels or filenames containing <, &, or quotes.

Changes

  • import html added to hwqueue_html.py
  • _generate_comparison_verdict_html: escape baseline_label, test_label, summary.verdict, summary.verdict_class, summary.top_improvement[0], and summary.top_regression[0] before HTML interpolation
  • generate_comparison_html: escape baseline_label and test_label used in the report body <strong> tags
# Before
<h2>📊 Comparison Summary: {baseline_label} → {test_label}</h2>
<td>{summary.top_improvement[0]}</td>

# After
safe_baseline = html.escape(baseline_label)
safe_test = html.escape(test_label)
safe_top_improvement = html.escape(summary.top_improvement[0])

<h2>📊 Comparison Summary: {safe_baseline} → {safe_test}</h2>
<td>{safe_top_improvement}</td>

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…html.py

Co-authored-by: prosenjitdhole <239307697+prosenjitdhole@users.noreply.github.com>
Copilot AI changed the title [WIP] Update summary addition in generated HTML for AORTA-23 Fix HTML injection in hwqueue comparison report generator Mar 6, 2026
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