/

CVE-2026-34367

Severity:

HIGH RISK

(7.6)

SSRF in InvoiceShelf PDF Generation

CVE-2026-34367

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Server-Side Request Forgery and Internal Network Probing

Severity:

HIGH RISK

(7.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

InvoiceShelf's invoice PDF generation module processes user-controlled HTML in the Notes field and passes it directly to the Dompdf rendering library.

Because Dompdf automatically fetches external resources referenced in that HTML, an attacker can cause the server to make arbitrary HTTP requests to internal or external URLs when a PDF is previewed or emailed.

Affected context

The vulnerability appears in environments where InvoiceShelf is deployed with PDF generation enabled and the Dompdf library is allowed to fetch remote resources.

It primarily affects workflows that render invoices to PDF, such as previewing invoices in the UI or triggering invoice emails that include PDF attachments.

The issue is present when user input in the invoice Notes field is treated as HTML and rendered without sanitization or restriction of external resource loading.

Exploit preconditions

  • Attack surface: Invoice creation and editing interfaces that accept content for the Notes field, including any API endpoints that set or update invoice notes.
  • Required access: Ability to create or modify an invoice (e.g., authenticated user, compromised account, or any integration that can submit invoice data).
  • Trigger point: Invoking PDF generation for an invoice via the PDF preview feature or email delivery endpoints.
  • Why exploitation is possible: The Notes field is interpreted as HTML and passed unsanitised to Dompdf; Dompdf then automatically resolves and fetches remote resources (e.g., images, stylesheets) from attacker-controlled URLs, allowing outbound HTTP requests initiated from the server.

Why this happens

This vulnerability stems from treating user-controlled HTML as trusted markup in a server-side rendering pipeline.

The InvoiceShelf PDF generation module passes the Notes field directly into Dompdf, which by design will fetch and embed external resources referenced in the HTML.

Without sanitizing the HTML or disabling/limiting remote resource fetching, attackers can supply crafted URLs that cause the server to perform arbitrary HTTP requests.

This behavior maps to CWE-918: Server-Side Request Forgery, where an application fetches remote resources based on user input and thereby exposes internal network access via the server.

Potential impact

  • Attackers can cause the server to send arbitrary HTTP requests to internal services (e.g., http://localhost, internal APIs, metadata endpoints).
  • Internal network enumeration and probing (e.g., detecting open ports or responding services).
  • Potential exposure of sensitive information if internal endpoints respond with data that is reflected or otherwise observable.
  • Abuse of the application server as a pivot or relay to reach otherwise unreachable network locations.
  • Increased risk of chaining with other vulnerabilities (e.g., hitting internal admin panels, cloud metadata services, or misconfigured management endpoints).

General mitigation guidance

Reducing SSRF risk in similar PDF or HTML-to-PDF pipelines generally involves controlling both the input HTML and how external resources are resolved.

Common mitigation patterns include:

  • Treat invoice notes and similar fields as plain text by default, escaping or stripping HTML tags before rendering.
  • If rich text is necessary, sanitize markup using a strict allowlist, removing tags and attributes that can trigger external fetches (e.g., <img src>, CSS url(), @import).
  • Configure the rendering engine (like Dompdf or similar libraries) to disable or tightly restrict remote resource loading, preferring local assets only.
  • Apply network-level egress controls so application servers cannot directly reach sensitive internal networks or cloud metadata endpoints.
  • Enforce least-privilege network access for web servers and rendering workers, segmenting them from critical internal services wherever possible.

These patterns help ensure that even if untrusted HTML is processed, it cannot freely drive outbound network calls.

How teams detect issues like this

Effective detection focuses on both code-level patterns and runtime behavior:

  • Static analysis and code review:
  • Flag any use of HTML/PDF rendering libraries where user-controlled HTML is passed directly without sanitization.
  • Identify calls to Dompdf (or similar tools) with remote resource fetching enabled, especially when URLs are derived from request parameters or stored user fields.
  • Review data flows for "notes", "description", or "HTML content" fields that end up in rendering pipelines.
  • Configuration and policy checks:
  • Enforce policies that disallow remote URL fetching from rendering components unless explicitly justified.
  • Maintain secure defaults in shared PDF/HTML utilities to treat untrusted input as text and disable external network resolution.
  • Runtime monitoring:
  • Log and monitor outbound HTTP requests from the application server or PDF rendering container, looking for unusual destinations (e.g., internal IP ranges or metadata endpoints).
  • Use network-level monitoring to detect anomalous egress patterns originating from PDF generation or background worker nodes.

Automated SAST and configuration scanning tools can be tuned to highlight these patterns during development and deployment.

Sources

SourceLink
github.comgithub.com/InvoiceShelf/InvoiceShelf/releases/tag/2.2.0
github.comgithub.com/InvoiceShelf/InvoiceShelf/security/advisories/GHSA-q9wx-ggwq-mcgh

Frequently asked

questions

It can be, if remote or low-privilege users are allowed to create or edit invoices and trigger PDF generation.

In that case, a remote attacker can induce the server to make outbound HTTP requests to destinations under their control or to internal services.

Typically, the attacker needs the same level of access as any user or integration that can submit invoice data with content in the Notes field and trigger PDF generation (preview or email).

Direct access to server configuration or the file system is not required.

The most robust approach is to treat user-provided text as untrusted data:

  • Do not render it as raw HTML unless it has been strictly sanitized with a conservative allowlist.
  • Configure the rendering engine to avoid fetching remote resources based on user-controlled content.
  • Where possible, convert rich text to a safe subset or plain text before it reaches the PDF engine.

Adopt design-time and coding practices that:

  • Avoid passing untrusted input directly into network-capable components (renderers, HTTP clients, URL resolvers).
  • Enforce HTML sanitization and output encoding for any user content used in emails, PDFs, or server-side rendering.
  • Apply default-deny network egress rules for application workloads and perform security reviews whenever a feature needs to fetch remote resources based on user input.
Find out what's already
exploitable in your codebase.