larxius commited on
Commit
835b6a8
·
verified ·
1 Parent(s): a3f2381

Update backend_structured/scanners_core.py

Browse files
Files changed (1) hide show
  1. backend_structured/scanners_core.py +40 -46
backend_structured/scanners_core.py CHANGED
@@ -1780,54 +1780,48 @@ def generate_scan_pdf(scan, vulnerabilities):
1780
  elements.append(Paragraph(rem_final_text, normal))
1781
  elements.append(Spacer(1, 25))
1782
 
1783
- # --- APPENDIX: REQUIRES MANUAL VERIFICATION & LEGAL DISCLAIMER ---
1784
- elements.append(PageBreak())
1785
- elements.append(Paragraph("<b>Appendix: Requires Manual Verification</b>", heading2))
1786
- elements.append(Spacer(1, 5))
1787
- elements.append(Paragraph("The following findings were flagged by automated heuristic signatures or out-of-band probes, but lack full payload confirmation. They are excluded from executive summary severity counts and require manual verification by a security engineer.", normal))
1788
- elements.append(Spacer(1, 15))
1789
-
1790
- target_url = scan.target_url if (scan and getattr(scan, 'target_url', None)) else 'https://www.target.com'
1791
-
1792
- # Appendix Item A.1
1793
- elements.append(Paragraph("<b>A.1 Blind XSS Payloads Submitted to 1 Form(s) — Awaiting Callback [Requires Verification]</b>", styles['Heading3']))
1794
- a1_data = [
1795
- ["Status", Paragraph("<font color='#EA580C'>Requires Verification</font>", normal), "CVSS Score", "8.2"],
1796
- ["Category", "Blind XSS", "Severity", Paragraph("<font color='#99CC33'>Low</font>", normal)],
1797
- ["CVSS Vector", "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N", "", ""]
1798
  ]
1799
- a1_table = Table(a1_data, colWidths=[80, 150, 80, 150])
1800
- a1_table.setStyle(TableStyle([
1801
- ('BACKGROUND', (0,0), (-1,-1), colors.HexColor("#F9FAFB")),
1802
- ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#E5E7EB")),
1803
- ('FONTNAME', (0,0), (0,-1), 'Helvetica-Bold'),
1804
- ('FONTNAME', (2,0), (2,-1), 'Helvetica-Bold'),
1805
- ]))
1806
- elements.append(a1_table)
1807
- elements.append(Spacer(1, 8))
1808
- a1_desc = f"<b>Description:</b><br/>Out-of-band XSS payloads were submitted to 1 form endpoint(s).<br/>Callback listener configured at: <font name='Courier'>https://xss-reporting.internal/callback</font><br/>&bull; {html.escape(target_url)} (injection attempted)<br/><br/><i>This is NOT a confirmed finding. Blind XSS requires an external callback to verify execution. Monitor your XSS hunter / callback server for incoming requests from https://xss-reporting.internal/callback. If a callback is received, escalate to Critical.</i>"
1809
- elements.append(Paragraph(a1_desc, normal))
1810
- elements.append(Spacer(1, 15))
1811
 
1812
- # Appendix Item A.2
1813
- elements.append(Paragraph("<b>A.2 XML External Entity (XXE) — Error-Based Detection [Requires Verification]</b>", styles['Heading3']))
1814
- a2_data = [
1815
- ["Status", Paragraph("<font color='#EA580C'>Requires Verification</font>", normal), "CVSS Score", "3.9"],
1816
- ["Category", "Injection", "Severity", Paragraph("<font color='#99CC33'>Low</font>", normal)],
1817
- ["CVSS Vector", "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N", "", ""]
1818
- ]
1819
- a2_table = Table(a2_data, colWidths=[80, 150, 80, 150])
1820
- a2_table.setStyle(TableStyle([
1821
- ('BACKGROUND', (0,0), (-1,-1), colors.HexColor("#F9FAFB")),
1822
- ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#E5E7EB")),
1823
- ('FONTNAME', (0,0), (0,-1), 'Helvetica-Bold'),
1824
- ('FONTNAME', (2,0), (2,-1), 'Helvetica-Bold'),
1825
- ]))
1826
- elements.append(a2_table)
1827
- elements.append(Spacer(1, 8))
1828
- a2_desc = f"<b>Description:</b><br/>An Unconfirmed XXE indicator was detected at {html.escape(target_url)} via XML error messages.<br/>Error pattern matched: <font name='Courier'>XML</font><br/><b>Confidence:</b> Unconfirmed &mdash; this is based on a single error substring match. It may be a false positive (generic XML error on any malformed input). Manual verification is required before treating as exploitable.<br/>If a single payload(s) triggered this: 1 independent payload(s) matched error patterns."
1829
- elements.append(Paragraph(a2_desc, normal))
1830
- elements.append(Spacer(1, 20))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1831
 
1832
  # Legal Disclaimer & Confidentiality Notice
1833
  elements.append(PageBreak())
 
1780
  elements.append(Paragraph(rem_final_text, normal))
1781
  elements.append(Spacer(1, 25))
1782
 
1783
+ # --- APPENDIX: REQUIRES MANUAL VERIFICATION (ONLY IF UNCONFIRMED FINDINGS EXIST) ---
1784
+ unconfirmed_findings = [
1785
+ v for v in (findings or [])
1786
+ if getattr(v, 'requires_verification', False)
1787
+ or (getattr(v, 'confidence', '') and str(getattr(v, 'confidence', '')).lower() in ['unconfirmed', 'requires verification', 'heuristic'])
 
 
 
 
 
 
 
 
 
 
1788
  ]
 
 
 
 
 
 
 
 
 
 
 
 
1789
 
1790
+ if unconfirmed_findings:
1791
+ elements.append(PageBreak())
1792
+ elements.append(Paragraph("<b>Appendix: Requires Manual Verification</b>", heading2))
1793
+ elements.append(Spacer(1, 5))
1794
+ elements.append(Paragraph("The following findings were flagged by automated heuristic signatures or out-of-band probes, but lack full payload confirmation. They are excluded from executive summary severity counts and require manual verification by a security engineer.", normal))
1795
+ elements.append(Spacer(1, 15))
1796
+
1797
+ target_url = scan.target_url if (scan and getattr(scan, 'target_url', None)) else 'https://www.target.com'
1798
+
1799
+ for u_idx, u_vuln in enumerate(unconfirmed_findings, start=1):
1800
+ u_title = getattr(u_vuln, 'title', f"Unconfirmed Finding #{u_idx}")
1801
+ u_cvss = str(getattr(u_vuln, 'cvss_score', '0.0'))
1802
+ u_cat = getattr(u_vuln, 'category', 'General')
1803
+ u_sev = getattr(u_vuln, 'severity', 'Low')
1804
+ u_desc = getattr(u_vuln, 'description', '')
1805
+ u_vec = getattr(u_vuln, 'cvss_vector', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N')
1806
+
1807
+ elements.append(Paragraph(f"<b>A.{u_idx} {html.escape(u_title)} [Requires Verification]</b>", styles['Heading3']))
1808
+ u_data = [
1809
+ ["Status", Paragraph("<font color='#EA580C'>Requires Verification</font>", normal), "CVSS Score", u_cvss],
1810
+ ["Category", u_cat, "Severity", Paragraph(f"<font color='#99CC33'>{u_sev}</font>", normal)],
1811
+ ["CVSS Vector", u_vec, "", ""]
1812
+ ]
1813
+ u_table = Table(u_data, colWidths=[80, 150, 80, 150])
1814
+ u_table.setStyle(TableStyle([
1815
+ ('BACKGROUND', (0,0), (-1,-1), colors.HexColor("#F9FAFB")),
1816
+ ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#E5E7EB")),
1817
+ ('FONTNAME', (0,0), (0,-1), 'Helvetica-Bold'),
1818
+ ('FONTNAME', (2,0), (2,-1), 'Helvetica-Bold'),
1819
+ ]))
1820
+ elements.append(u_table)
1821
+ elements.append(Spacer(1, 8))
1822
+ desc_p = f"<b>Description:</b><br/>{html.escape(u_desc)}"
1823
+ elements.append(Paragraph(desc_p, normal))
1824
+ elements.append(Spacer(1, 15))
1825
 
1826
  # Legal Disclaimer & Confidentiality Notice
1827
  elements.append(PageBreak())