---
source: https://carbone.io/examples/penetration-test-report/
title: "Pentest Reporting Tool: Penetration Test Reports | Carbone"
description: "Pentest report template for your reporting tool: Carbone turns findings JSON into a penetration test report PDF with CVSS scores, evidence and remediation."
generated_at: "2026-11-24"
---

# Penetration test report

CVSS-scored findings and evidence from your pentest data, as a PDF

[![Penetration test report: PDF generated from a DOCX template and JSON data](/examples/penetration-test-report/thumb-result.webp)](/examples/penetration-test-report/result.pdf "Download the generated document")

[Download template](/examples/penetration-test-report/template.docx)

[Sample data](/examples/penetration-test-report/data.json)

[Download the generated PDF](/examples/penetration-test-report/result.pdf)

- **Template:** DOCX
- **Export as:** PDF, DOCX, ODT, HTML, PNG [+25 more](/documentation/developer/http-api/generate-reports.md#output-file-type)
- **Carbone:** 5.18+

Features

-   [Loop](/documentation/design/repetitions/with-arrays.md)
-   [Nested loop](/documentation/design/repetitions/with-arrays.md)
-   [Condition](/documentation/design/conditions/overview.md)
-   [Aggregation](/documentation/design/computation/aggregation.md)
-   [Image](/documentation/design/advanced-features/pictures.md)
-   [Date](/documentation/design/formatters/date.md)
-   Table of contents
-   Header and footer

## Generate penetration test reports from your pentest platform

Penetration testing firms, internal red teams and PTaaS platforms deliver a report at the end of every engagement, then reissue it after the client's factual review and after each retest. The findings already live in a reporting or vulnerability management platform: title, severity, CVSS vector, affected assets, evidence and remediation. Your application sends them to the Carbone API as JSON, and a Word template returns the PDF, with the summary tables, the counts and the contents page in line with the latest data.

In this example, Vantmere Security, a fictional pentest firm, reports nine findings on the contract management platform of Corbelline, a fictional SaaS company. The report follows the structure that [NIST SP 800-115](https://csrc.nist.gov/pubs/sp/800/115/final) and the [OWASP Web Security Testing Guide](https://owasp.org/www-project-web-security-testing-guide/v42/5-Reporting/README) describe for a test report: an executive summary for management, the scope and the methodology, then one detailed section per finding. Scores use the [CVSS v3.1](https://www.first.org/cvss/v3.1/specification-document) base metrics, and categories the [OWASP Top 10:2025](https://owasp.org/Top10/2025/).

In this example, you will:

-   design a cover with a full-height band and vertical text, without floating shapes;
-   count the findings by severity and by status with aggregators;
-   show a severity pill and a status pill that match each finding;
-   repeat the findings, their sections and their evidence blocks with nested loops;
-   keep the page numbers of the contents page live.

## The report, section by section

| Section | Content | What Carbone does |
| --- | --- | --- |
| Cover | Client, engagement, dates, testers, approver, version, classification | Prints the report fields and the dates |
| Document history | Each version issued, with its changes, and the distribution list | One row per version and per recipient |
| Contents | Sections and appendices with their page numbers | Updates the page numbers |
| 01 Executive summary | Narrative, scope, findings overview | Counts the findings by severity and by status |
| 02 Key themes | Root causes shared by several findings, with a recommendation each | One theme per item |
| 03 Threat ranking | Severity scale, CVSS ranges, target remediation times | Static text of the firm's methodology |
| 04 Findings summary | ID, severity, title, CWE, CVSS, status | One row per finding |
| Appendix A, B | Assets, test accounts, rules of engagement, test phases, limitations | One row per item |
| Appendix C | One finding per page: metadata, description, root cause, impact, attack scenario, proof of concept, remediation, retest | Nested loops; each section and block comes from the data |

## How to build a penetration test report in Word

### 1\. Design the cover with a table

The cover is its own section, with zero margins, so that the black band reaches the edges of the page. Its layout is a four-column table: the band, a gutter, the content and the right margin, with exact row heights. The band cells have a black fill, and the vertical line `{d.report.id} · {d.client.name} · v{d.report.version}` uses the text direction of its cell (Table Properties > Cell > Text Direction). The body section that follows has the running header and footer, with `PAGE` and `NUMPAGES` fields for "Page X of Y" ([headers and footers](/documentation/design/template-formats/docx.md#headers-and-footers)). The dates print with `{d.report.date:formatD('D MMMM YYYY')}`.

### 2\. Count the findings with aggregators

The findings overview counts the items of one array with an [array filter](/documentation/design/substitutions/array-search.md#simple-filters) and [`:aggCount`](/documentation/design/computation/aggregation.md#aggcount-partitionby): `{d.findings[severityKey='critical'].id:aggCount}` prints 1, `{d.findings[statusKey='open'].id:aggCount}` prints 6 and `{d.findings[].id:aggCount}` prints the total, 9. The counts come from the findings themselves, so they always match the summary table.

Above the counts, a stacked bar shows the same split. It is a one-row table with a [horizontal loop](/documentation/design/repetitions/with-arrays.md#horizontal-loops-repeat-columns): `{d.findings[i].severityKey}` in the first cell and `{d.findings[i+1].severityKey}` in the second repeat one cell per finding, sorted by severity in the data. Each cell gets the color of its severity with `{d.findings[i].severityKey:ifEQ(critical):show(#C0362C):ifEQ(high):show(#E5484D):...:color(cell, background)}` ([colors with conditions](/documentation/design/advanced-features/colors.md#condition-and-color)), so the length of each color segment matches its count.

### 3\. Show the right severity and status pill

Each severity cell holds five small pill pictures, one per severity. The alt text of each picture drops it unless it matches the finding: `{d.findings[i].severityKey:ifNE(critical):drop(img)}` ([smart conditions](/documentation/design/conditions/smart-conditions.md#drop-keep-element)). The status cell works the same way with `{d.findings[i].statusKey:ifNE(open):drop(img)}`. The pictures are repeated with the row, like any [picture in a loop](/documentation/design/template-formats/docx.md#pictures).

### 4\. Repeat the findings, their sections and their blocks

Appendix C is a three-level [nested loop](/documentation/design/template-formats/docx.md#loops-nested-loops). Each finding starts on a new page, and `{d.findings[i].id:print(.i):ifNE(0):drop(p)}` keeps the "Findings detail" title on the first one only. In each section, the title sits in a left column and the blocks in a right column of the same table row, so every block shares the same text edge. Each finding has its own list of sections, and each section a list of blocks:

```json
{
  "id": "CBL-03",
  "severityKey": "high",
  "statusKey": "open",
  "title": "SAML sign-in reads an unsigned assertion placed next to a signed one",
  "cvss": 7.4,
  "vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N",
  "sections": [
    { "title": "Root cause analysis", "blocks": [
      { "type": "p", "text": "Verification and extraction use two different lookups." },
      { "type": "code", "label": "services/auth/src/saml/acs.ts", "status": "", "text": "const doc = parseXml(form.SAMLResponse);
..." }
    ] }
  ]
}
```

The body of the block loop has one paragraph per block type: text, bullet, step, code, quote and exhibit. Each one ends with a condition that drops it when the type differs, like `{d.findings[i].sections[i].blocks[i].type:ifNE(code):drop(p)}`, so each block prints in its own style. `{d.findings[i].sections[i].blocks[i].text:convCRLF}` keeps the line breaks of the code and of the HTTP transcripts ([`:convCRLF`](/documentation/design/formatters/text.md#convcrlf)). A code block or an HTTP exchange prints in three shaded paragraphs that join into one box: the label ("Request", "Response" or a file name), the status line in bold, then the body. Each part ends with `:ifEM:drop(p)`, like `{d.findings[i].sections[i].blocks[i].status:ifEM:drop(p)}`, so an empty status or body leaves no blank line in the box. A finding without a proof of concept or a retest simply has no such section in the data.

### 5\. Keep the contents page live

The contents page is a table whose page numbers are `PAGEREF` fields that point to bookmarks on the section titles (Insert > Cross-reference > Bookmark > Page number). The converter updates them in the PDF, so Appendix C moves to its real page when the findings get longer. The titles also use heading styles, which give the PDF its bookmarks. To build the contents from a loop of chapters instead, see [chapters and table of contents](/documentation/design/template-formats/docx.md#chapters-and-table-of-contents).

## Related Examples

- [GHS safety data sheet](/examples/safety-data-sheet/index.md): DOCX template to PDF.
- [Master services agreement](/examples/master-services-agreement/index.md): DOCX template to DOCX.
- [CSRD sustainability statement](/examples/csrd-sustainability-report/index.md): HTML template to PDF.

## Related topics

- [Master services agreement](/examples/master-services-agreement/index.md)
- [Prescription with medication schedule](/examples/prescription/index.md)
- [CSRD sustainability statement](/examples/csrd-sustainability-report/index.md)
- [GHS safety data sheet](/examples/safety-data-sheet/index.md)
- [DPE energy performance certificate](/examples/dpe-energy-performance-certificate/index.md)
- [EU energy label](/examples/eu-energy-label/index.md)
