Summary

Add enhanced PDF exporter implementing the Exporter interface for professional vulnerability scan reports

Generate reports with executive summary dashboard, color-coded severity visualization, structured findings table, and detailed findings sections with automatic pagination

Include comprehensive unit tests with thread-safety verification and concurrent export testing

Changes

New: pkg/reporting/exporters/pdf/pdf.go - Enhanced PDF exporter implementation (216 lines)

New: pkg/reporting/exporters/pdf/pdf_test.go - 4 comprehensive unit tests (all passing)

Modified: pkg/types/types.go - Added PDFExport field to Options struct

Modified: pkg/reporting/options.go - Registered PDF exporter in configuration

Modified: cmd/nuclei/main.go - Added -pdf-export / -pe CLI flag

Modified: go.mod/go.sum - Added github.com/go-pdf/fpdf dependency (community-maintained fork)

PDF Report Features

Professional Layout:

  • A4 page size with proper margins (10mm left/right, 15mm top/bottom)
  • Header with “Nuclei Vulnerability Scan Report” + generation timestamp
  • Footer with automatic page numbering on all pages
  • Smart page breaks to avoid splitting findings

Executive Summary Dashboard:

  • Color-coded severity summary table
  • Counts for Critical, High, Medium, Low, Info, and Unknown severities
  • Visual severity indicators for quick scanning

Detailed Findings Section:

  • Severity-colored headers for each finding (Critical=Purple, High=Red, Medium=Orange, Low=Yellow, Info=Blue)
  • Template ID, Host, and URL information
  • Description and extracted data (when available)
  • Findings sorted by severity (Critical → Info)

Robust Handling:

  • Empty report support with “No vulnerabilities found” message
  • Thread-safe concurrent export operations
  • Proper mutex protection for data integrity

Usage

# Basic usage
nuclei -u http://example.com -pdf-export report.pdf
# With custom template
nuclei -u http://example.com -t template.yaml -pdf-export scan_results.pdf

Testing

Unit Tests - All Passing ✅

go test -v ./pkg/reporting/exporters/pdf/

Test Coverage:

  • TestNewExporter - Verifies exporter initialization
  • TestExportConcurrency - Tests thread-safety with 100 concurrent exports
  • TestExportEmpty - Validates empty report generation
  • TestExportWithVariousSeverities - Tests all severity levels (Critical, High, Medium, Low, Info, Unknown)

Results:

=== RUN TestNewExporter
--- PASS: TestNewExporter (0.00s)
=== RUN TestExportConcurrency
--- PASS: TestExportConcurrency (0.01s)
=== RUN TestExportEmpty
--- PASS: TestExportEmpty (0.00s)
=== RUN TestExportWithVariousSeverities
--- PASS: TestExportWithVariousSeverities (0.00s)
PASS
ok github.com/projectdiscovery/nuclei/v3/pkg/reporting/exporters/pdf 0.644s

Code Quality ✅

go fmt ./pkg/reporting/exporters/pdf/... # Formatting passed
go vet ./pkg/reporting/exporters/pdf/... # Linting passed
make build # Builds successfully

Implementation Highlights

Active Maintenance - Uses github.com/go-pdf/fpdf (community-maintained fork, not archived)

Color-Coded Visualization - Severity-based color coding (Critical=Purple, High=Red, Medium=Orange, Low=Yellow, Info=Blue, Unknown=Grey)

Thread-Safe Operations - Mutex-protected concurrent exports verified with 100 simultaneous operations

Smart Sorting - Automatic severity-based sorting (Critical → Info) for prioritized review

Professional Output - A4 layout with headers, footers, page numbers, and proper pagination

/claim #2063


Summary by CodeRabbit

New Features

Added professional PDF export for scan results with executive summary dashboard, color-coded severity visualization, structured findings table, detailed findings sections, automatic pagination, and timestamps; shows a friendly message when no findings exist.

Tests

Added 4 comprehensive unit tests covering exporter creation, concurrent exports (thread-safety with 100 operations), empty report generation, and multiple severity levels; all tests passing.

Chores

Updated dependencies with github.com/go-pdf/fpdf (community-maintained fork).

Summary by CodeRabbit

  • New Features

    • Added a CLI flag (–pdf-export / -pe) to export scan results as a structured PDF report with executive summary (severity breakdown) and detailed, color-coded findings.
    • New configuration option to enable/customize PDF output.
    • PDF output is generated even when no vulnerabilities are found.
  • Tests

    • Added tests covering exporter initialization, concurrent exports, closed-export handling, and output file creation.

Claim

Total prize pool $25
Total paid $0
Status Pending
Submitted February 09, 2026
Last updated February 09, 2026

Contributors

SR

SrijaVuppala

@SrijaVuppala295

100%

Sponsors

PR

ProjectDiscovery

@projectdiscovery

$25