/

CVE-2026-34366

Severity:

HIGH RISK

(7.6)

SSRF in InvoiceShelf Payment Receipt PDF Generation

CVE-2026-34366

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Server-Side Request Forgery and Internal Network Exposure

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 payment receipt PDF generation module contains a Server-Side Request Forgery (SSRF) flaw where user-controlled HTML from the payment Notes field is rendered by Dompdf, which then fetches remote resources referenced in that markup.

An attacker who can submit crafted notes or directly hit the PDF receipt endpoint can cause the server to make arbitrary HTTP requests to internal or external hosts, potentially exposing internal services and metadata.

Affected context

The vulnerability appears in InvoiceShelf deployments that:

  • Allow users (or integrated systems) to provide free-form content in the payment Notes field
  • Generate payment receipt PDFs via an HTTP endpoint
  • Use Dompdf (or similar HTML-to-PDF tools) that automatically fetch remote resources referenced in HTML (e.g., images, styles)

The risk is higher where the InvoiceShelf server can reach internal infrastructure, cloud metadata endpoints, or other sensitive network segments.

Exploit preconditions

  • Attack surface: The payment receipt PDF generation endpoint.
  • Required access: Ability to supply or influence the payment Notes field contents, or direct access to the PDF receipt endpoint parameters.
  • Trigger point: Rendering of the payment receipt as a PDF by Dompdf, which processes the attacker-controlled HTML.
  • Why exploitation is possible: The application passes user-supplied HTML to Dompdf without sanitization or URL restriction, allowing arbitrary remote resource references (e.g., <img src="http://internal-service/endpoint">) that Dompdf will fetch server-side.

Why this happens

This issue stems from trusting user-controlled HTML in a context where it is interpreted by a server-side rendering engine that performs outbound HTTP requests.

By passing unvalidated, unsanitized HTML from the payment Notes field directly into Dompdf, the application permits attackers to define arbitrary remote resources that Dompdf will retrieve.

This behavior aligns with CWE-918: Server-Side Request Forgery (SSRF), where server-side components initiate network requests based on untrusted input without applying network or URL-level constraints.

Potential impact

  • Discovery and probing of internal network services that are not directly exposed to the internet
  • Access to cloud instance metadata services, potentially leaking credentials or configuration
  • Interaction with internal HTTP-based admin panels, APIs, or management interfaces
  • Leveraging the server as a pivot point for further attacks or network mapping
  • Triggering unintended side effects on internal services that respond to crafted requests

General mitigation guidance

Effective mitigation typically focuses on controlling how untrusted data reaches network-capable components and limiting where the server can connect:

  • Treat any HTML-accepting field as untrusted and avoid passing it directly to rendering engines that perform network calls.
  • Implement strict URL allowlists or blocklists at the HTTP client level used by Dompdf or the underlying environment, restricting outbound requests to known-safe domains.
  • Configure the rendering engine to disable or heavily restrict remote resource loading, preferring inline or local assets.
  • Normalize or sanitize user-supplied HTML, stripping or rewriting tags and attributes that can reference remote URLs (e.g., img, link, script).
  • Reduce network privileges for the application host, such as denying access to internal management networks and metadata endpoints via firewall or network policy.

How teams detect issues like this

High-level detection approaches can include:

  • Static analysis rules or manual code review to identify HTML-to-PDF or template rendering paths that accept user input and permit remote resource loading.
  • Inspection of configuration for libraries like Dompdf to ensure remote content fetching is disabled or constrained.
  • Network-level monitoring and anomaly detection for unusual outbound HTTP requests originating from the InvoiceShelf server, especially to internal IP ranges or metadata endpoints.
  • Automated security testing in CI/CD that exercises PDF generation endpoints with crafted URLs and observes resulting network activity in a controlled environment.

Sources

SourceLink
github.comgithub.com/InvoiceShelf/InvoiceShelf/releases/tag/2.2.0
github.comgithub.com/InvoiceShelf/InvoiceShelf/security/advisories/GHSA-38hf-fq8x-q49r

Frequently asked

questions

Yes. Anyone who can supply or influence the payment Notes field, or call the PDF receipt endpoint with crafted data, can potentially trigger SSRF from the server.

Typically, the attacker needs at least application-level access to create or modify payments or invoke the receipt PDF endpoint. In some deployments where the endpoint is not well protected, even low-privileged or unauthenticated access could be enough.

The safest approach is to prevent untrusted HTML from driving server-side network requests: sanitize or restrict HTML input, disable or tightly control remote resource fetching in Dompdf, and enforce outbound network restrictions so that application servers cannot freely access internal or sensitive endpoints.

Treat all user-controlled content as untrusted, particularly when passed into rendering engines or HTTP clients; apply defense-in-depth via input validation, renderer configuration, and network egress controls; and include SSRF-specific checks in security reviews and automated testing for any feature that makes server-side requests based on user input.

Find out what's already
exploitable in your codebase.