CVE-2026-114609
SSRF/Path Traversal in fpdf2 image loader enables remote URLs and file reads.
- CVSS 5.8
- CWE-918
- Input Validation and Sanitization
- Remote
fpdf2 is a PDF creation library for Python. Prior to 2.8.8, fpdf2's shared image loader automatically dereferences attacker-controlled HTTP(S) URLs and raw local paths supplied through FPDF.image(), FPDF.write_html() HTML <img src> values, SVG <image href> or xlink:href values, and template image fields. This can cause outbound requests to attacker-selected internal or external services and local file open attempts, although local content is exposed only when it is a valid supported image or SVG resource. file:// URLs are not specially handled, so the local-path case requires a raw filesystem path. This issue is fixed in version 2.8.8.
- CWE
- CWE-918
- CVSS base score
- 5.8
- Published
- 2026-10-22
- OWASP
- A10 Server-Side Request Forgery (SSRF)
- Orthogonal defect classification
- Interface
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Path Traversal
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- fpdf2
- Fixed by upgrading
- Yes
Solution
Upgrade fpdf2 to version 2.8.8 or newer.
Vulnerable code sample
from fpdf import FPDF
class Report(FPDF):
def add_logo(self, src):
# VULNERABLE: loads attacker‑controlled URL or local path without validation
self.image(src, x=10, y=8, w=30, h=30)
def generate_report(image_source):
pdf = Report()
pdf.add_page()
pdf.add_logo(image_source)
return pdf.output(dest='S')Patched code sample
from fpdf import FPDF
from urllib.parse import urlparse
class Report(FPDF):
def add_logo(self, src):
# FIX: validate src to allow only http/https URLs and reject file paths
parsed = urlparse(src)
if parsed.scheme not in ('http', 'https') or not parsed.netloc:
raise ValueError("Invalid image source")
self.image(src, x=10, y=8, w=30, h=30)
def generate_report(image_source):
pdf = Report()
pdf.add_page()
pdf.add_logo(image_source)
return pdf.output(dest='S')Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Add configurable resource access policy for image loading (#1824) (py-pdf/fpdf2)
fpdf/enums.py,fpdf/errors.py,fpdf/fpdf.py,fpdf/fpdf.py · FPDF.image,fpdf/fpdf.py · FPDF.preload_glyph_image,fpdf/fpdf.py · FPDF.preload_image,fpdf/fpdf.py · FPDF._downscale_image,fpdf/fpdf.py · FPDF._raster_image,fpdf/fpdf.py · FPDF.__init__,fpdf/image_parsing.py,fpdf/image_parsing.py · get_img_info,fpdf/image_parsing.py · get_svg_infoand 9 more - fix rebinding issue (#1857) (py-pdf/fpdf2)
fpdf/image_parsing.py,fpdf/image_parsing.py · load_image,fpdf/image_parsing.py · _ResourceAccessPolicyRedirectHandler.redirect_request,fpdf/image_parsing.py · _ResourceAccessPolicyRedirectHandler.__init__,fpdf/image_parsing.py · _validate_remote_url_access
Cite this entry
@misc{vaitp:cve2026114609,
title = {{SSRF/Path Traversal in fpdf2 image loader enables remote URLs and file reads.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-114609},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-114609/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
