diff --git a/compliance-agent/src/pentest/report/html/mod.rs b/compliance-agent/src/pentest/report/html/mod.rs index 4112721..ad40dea 100644 --- a/compliance-agent/src/pentest/report/html/mod.rs +++ b/compliance-agent/src/pentest/report/html/mod.rs @@ -124,9 +124,6 @@ pub(super) fn build_html_report(ctx: &ReportContext) -> String { Penetration Test Report — {target_name} - - - {styles_html} @@ -412,6 +409,29 @@ mod tests { assert!(html.contains("https://example.com")); } + #[test] + fn report_loads_nothing_from_a_third_party() { + let ctx = make_report_context( + vec![make_finding(Severity::High, "SQL Injection", true)], + vec![make_attack_node("sqlmap")], + ); + let html = build_html_report(&ctx); + for needle in [ + "googleapis", + "gstatic", + "preconnect", + " String { --sev-medium: #a16207; --sev-low: #1d4ed8; --sev-info: #4b5563; - --font-serif: 'Libre Baskerville', 'Georgia', serif; - --font-sans: 'Source Sans 3', 'Helvetica Neue', sans-serif; - --font-mono: 'JetBrains Mono', 'Consolas', monospace; + /* System fonts only: the report is a standalone file and fetches + nothing from a font CDN. The named faces apply where installed. */ + --font-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif; + --font-sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; + --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; } body { @@ -642,7 +644,7 @@ table.tools-table td:first-child { border: 1px solid #fecaca; border-left: 3px solid #dc2626; padding: 8px 10px; - font-family: 'JetBrains Mono', monospace; + font-family: var(--font-mono); font-size: 8pt; line-height: 1.5; white-space: pre-wrap; @@ -655,7 +657,7 @@ table.tools-table td:first-child { border: 1px solid #bbf7d0; border-left: 3px solid #16a34a; padding: 8px 10px; - font-family: 'JetBrains Mono', monospace; + font-family: var(--font-mono); font-size: 8pt; line-height: 1.5; white-space: pre-wrap;