GIVE YOUR AGENT THE EVIDENCE

Set up in your agent.

One prompt to get started. Paste it into your coding agent to connect cve.new through MCP and bring vulnerability context into your workflow.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GIVE YOUR AGENT THE EVIDENCE

Investigate in your agent.

Turn this advisory into a focused investigation. Ask your agent to check your project’s versions, explain the evidence, and suggest a compatible fix.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

All vulnerabilities
GHSA-rw7v-4hrq-x6r9medium5.8

fpdf2 implicitly loads external URLs and local image paths when rendering attacker-controlled content

Check your stack

The advisory, in context

Summary

fpdf2 implicitly dereferences image resource references supplied to rendering APIs. If an application passes untrusted HTML, SVG, template data, or image paths into those APIs, fpdf2 may issue outbound HTTP(S) requests or attempt to open local filesystem paths.

This behavior is relevant in applications that render untrusted or user-provided input without sanitizing or restricting embedded resource references.

Description

In affected versions, fpdf2 uses a shared internal image-loading mechanism for multiple features. This loader:

  • fetches http:// and https:// URLs over the network
  • opens other string values as local filesystem paths

During document processing, resource references embedded in input content are automatically dereferenced using this mechanism.

This behavior is reachable through:

  • FPDF.image()
  • FPDF.write_html() via HTML <img src="...">
  • FPDF.image() when rendering SVG files containing <image href="..."> or xlink:href="...">
  • template image elements that forward values into FPDF.image()

If an application renders attacker-controlled input through these APIs, that input can cause:

  • outbound HTTP(S) requests to attacker-chosen destinations
  • local file open attempts for attacker-chosen paths

This may enable Server-Side Request Forgery (SSRF) in applications that render untrusted content.

Local file access impact is limited: the library attempts to open the referenced path, but successful embedding depends on the target being a valid and supported image or SVG resource.

file:// URLs are not specially handled; raw filesystem paths such as /path/to/file or ../../file.png are the relevant local-path cases.

Impact

This issue affects applications that render untrusted or partially trusted content using fpdf2.

Applications may be impacted if they:

  • pass untrusted HTML into write_html()
  • render untrusted SVG with embedded <image> references
  • pass user-controlled strings into image()
  • allow untrusted template definitions or template field values to control image paths

Potential impacts include:

  • outbound requests to internal or external network services
  • limited local file access attempts depending on file type and parsing success (limited to content that fpdf2 recognizes as a supported image or SVG resource)

The severity depends on how fpdf2 is integrated and whether untrusted input is allowed to control resource references.

Example scenarios

HTML:

pdf.write_html('<img src="http://127.0.0.1:8000/internal.png">')

SVG:

<image href="http://169.254.169.254/latest/meta-data/" />

Direct image path:

pdf.image("../../.env")

Workarounds

Applications can mitigate this by:

  • not rendering untrusted HTML, SVG, or template content
  • rejecting user-controlled src / href / image-path values
  • mapping resources through an application-defined allowlist
  • converting user-supplied images to trusted in-memory objects before passing them to fpdf2

Credits

  • @kule500 for identifying SSRF via HTML <img> handling
  • @BudongJW for identifying SVG <image> resource loading as an additional vector
  • @redyank for analysis of the shared image loading mechanism
  • @manop55555 for identifying a DNS rebinding bypass in the initial REMOTE_PUBLIC implementation

Affected packages

Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.

fpdf2 PyPI
Ecosystem versions

Earlier releases before 2.8.8

Fixed in 2.8.8

52 explicitly affected versions

2.0.0, 2.0.1, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.1.0, 2.1.0rc1, 2.2.0, 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.5.6, 2.5.7, 2.6.0, 2.6.1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.7.5, 2.7.6, 2.7.7, 2.7.8, 2.7.9, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.8.7

View affected-version evidence
{
  "ranges": [
    {
      "events": [
        {
          "introduced": "0"
        },
        {
          "fixed": "2.8.8"
        }
      ],
      "type": "ECOSYSTEM"
    }
  ],
  "versions": [
    "2.0.0",
    "2.0.1",
    "2.0.3",
    "2.0.4",
    "2.0.5",
    "2.0.6",
    "2.1.0",
    "2.1.0rc1",
    "2.2.0",
    "2.2.0rc1",
    "2.2.0rc2",
    "2.2.0rc3",
    "2.3.0",
    "2.3.1",
    "2.3.2",
    "2.3.3",
    "2.3.4",
    "2.3.5",
    "2.4.0",
    "2.4.1",
    "2.4.2",
    "2.4.3",
    "2.4.4",
    "2.4.5",
    "2.4.6",
    "2.5.0",
    "2.5.1",
    "2.5.2",
    "2.5.3",
    "2.5.4",
    "2.5.5",
    "2.5.6",
    "2.5.7",
    "2.6.0",
    "2.6.1",
    "2.7.0",
    "2.7.1",
    "2.7.2",
    "2.7.3",
    "2.7.4",
    "2.7.5",
    "2.7.6",
    "2.7.7",
    "2.7.8",
    "2.7.9",
    "2.8.1",
    "2.8.2",
    "2.8.3",
    "2.8.4",
    "2.8.5",
    "2.8.6",
    "2.8.7"
  ]
}

References