Skip to content

Commit 1172f02

Browse files
authored
Show vulnerability IDs (#15115)
1 parent 48f9809 commit 1172f02

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

dojo/templates/dojo/finding_pdf_report.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ <h5>
104104
{% if finding.cwe > 0 %}
105105
<th>CWE</th>
106106
{% endif %}
107+
{% if finding.vulnerability_ids %}
108+
<th>Vulnerability IDs</th>
109+
{% endif %}
107110
{% endblock finding_header %}
108111
</tr>
109112
<tr>
@@ -147,6 +150,9 @@ <h5>
147150
</a>
148151
</td>
149152
{% endif %}
153+
{% if finding.vulnerability_ids %}
154+
<td>{{ finding.vulnerability_ids }}</td>
155+
{% endif %}
150156
{% endblock finding_data %}
151157
</tr>
152158
</table>

unittests/test_pdf_report_rendering.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Test,
1010
Test_Type,
1111
User,
12+
Vulnerability_Id,
1213
)
1314
from unittests.dojo_test_case import DojoTestCase, versioned_fixtures
1415

@@ -172,6 +173,16 @@ def test_report_field_contains_rendered_content(self):
172173
# Mitigation content should appear
173174
self.assertIn("Remove Debug Files From Public Directories", html)
174175

176+
def test_report_finding_table_includes_vulnerability_ids(self):
177+
"""Finding PDF reports should show vulnerability IDs in the finding table."""
178+
finding = self._create_finding()
179+
Vulnerability_Id.objects.create(finding=finding, vulnerability_id="CVE-2026-12345")
180+
181+
html = self._render_finding_report(Finding.objects.filter(pk=finding.pk))
182+
183+
self.assertIn("Vulnerability IDs", html)
184+
self.assertIn("CVE-2026-12345", html)
185+
175186
def test_long_unbroken_string_in_report_field(self):
176187
"""
177188
Fields with very long unbroken strings should render inside report-field

0 commit comments

Comments
 (0)