Repository navigation
fix(report): escape the executive summary's document count - #466
Conversation
The Documents card interpolated document_count into the page unescaped. ProcessEvaluation validates the field as an int at construction, but not on assignment or through model_construct, so a caller that assigns it, or builds the model with model_construct, could put markup into the report. Document data does not reach it: the bulk evaluator sets an int, and a results dict falls back to 1. The value now goes through html.escape like the other cells, and a test assigns markup after construction and asserts it is escaped. It has the same in-process-caller reachability as awslabs#453; awslabs#456 escapes the visualization_engine.py cells, not this one.
Security Scan ResultsASH Security Scan Report
Scan Metadata
SummaryScanner ResultsThe table below shows findings by scanner, with status based on severity thresholds and dependencies:
Top 3 HotspotsFiles with the highest number of security findings:
Detailed FindingsShow 5 actionable findingsFinding 1: SECRET-HEX-HIGH-ENTROPY-STRING
Description: Code Snippet: Finding 2: B108
Description: Code Snippet: Finding 3: B307
Description: Code Snippet: Finding 4: B307
Description: Code Snippet: Finding 5: B102
Description: Code Snippet: Report generated by Automated Security Helper (ASH) at 2026-10-30T03:24:26+00:00 |
sromoam
left a comment
There was a problem hiding this comment.
Thanks @digalaviz, approving: the escape is right and the test fails without it. Two older bugs in the same function are filed as #467: the colour branch checks for viz_engine._get_performance_color, which doesn't exist, so every float card renders blue and color_thresholds is ignored; and the document count reads 1 for a results dict and "None" for a default ProcessEvaluation (Q1 on #452). Nit: the CHANGELOG entry could link #466.
Issue Reference
Related: #453
Description of Changes
The Executive Summary's
Documentscard interpolateddocument_countinto the page withoutescaping.
ProcessEvaluationvalidates the field as anintat construction, but not onassignment or through
model_construct, so a caller that sets it either way could put markup intothe report. Document data does not reach it: the bulk evaluator sets an
int, and a results dictfalls back to
1.It has the same in-process-caller reachability as #453. #456 covers the
:.3f/:.1fcells invisualization_engine.py; this card is insection_generator.pyand is not among them.Changes Made
section_generator.py: the card rendershtml.escape(str(doc_count)).None,intandfloatvalues render as before.test_section_generator.py: a realProcessEvaluationwith markup assigned after construction;the test asserts the escaped cell and the absence of the raw markup.
Testing
devand passes with the change.Checklist
CHANGELOG.mdentry added under[Unreleased]### Fixed. It is not under### Security:document data does not reach this value.
This does not touch the card's count behaviour raised as Q1 on #452.