CVE-2026-137954 in Pydantic Deepinfo

Summary

by MITRE • 11/27/2026

Pydantic Deep 0.2.18 before 0.4.0 contains a server-side request forgery and local file read vulnerability in the DeepResearch export_report handler for /export/pdf. Attackers can inject raw HTML into reports via the unauthenticated /upload endpoint, causing WeasyPrint to fetch internal URLs and embed local server files into exported PDFs.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/27/2026

The Pydantic Deep library versions prior to 0.4.0 contain a critical security flaw within its report generation functionality that allows for both Server-Side Request Forgery and Local File Inclusion attacks. This vulnerability specifically resides in the export_report handler associated with the /export/pdf endpoint, which relies on WeasyPrint to render HTML content into PDF documents. The core issue stems from insufficient validation of user-supplied input when processing reports, creating a pathway for attackers to manipulate the rendering process by injecting malicious payloads that exploit how external resources are resolved during document generation.

The attack vector begins at the unauthenticated /upload endpoint, where an attacker can submit raw HTML content without any form of authentication or access control checks. Because this endpoint does not verify the source or integrity of the uploaded data, it serves as a direct entry point for exploitation. Once the malicious HTML is stored and subsequently passed to the export_report handler, WeasyPrint processes the content by attempting to resolve all external resources referenced within the markup, such as images, stylesheets, or scripts. This behavior creates an opportunity for SSRF because the server will make HTTP requests on behalf of the attacker to any URL specified in the HTML payload.

By crafting a malicious HTML document that references internal network addresses using protocols like file:// or http:// targeting localhost and other private IP ranges, an attacker can force the vulnerable application to fetch sensitive data from internal services that are not exposed to the public internet. This capability effectively bypasses perimeter security controls since the requests originate from within the trusted server environment. Furthermore, if WeasyPrint is configured with default settings that allow file protocol access or if the underlying operating system permissions permit it, this mechanism can be leveraged for Local File Inclusion. The attacker can specify paths to sensitive configuration files, source code, or credentials stored on the local filesystem, causing these contents to be embedded directly into the exported PDF document.

The operational impact of this vulnerability is severe as it compromises both confidentiality and potentially integrity depending on subsequent exploitation steps. Through SSRF, attackers may discover internal services, map network topology, or interact with backend APIs that should remain inaccessible from external networks. The Local File Read aspect allows for direct exfiltration of sensitive server-side data by embedding file contents into the generated PDF output, which can then be downloaded and analyzed. This combination effectively turns a document generation feature into a powerful tool for reconnaissance and data theft against internal infrastructure components.

To mitigate this vulnerability, organizations must immediately upgrade Pydantic Deep to version 0.4.0 or later where these issues have been addressed through improved input validation and stricter handling of external resources in report exports. For systems that cannot be upgraded instantly, implementing a Web Application Firewall rule to block requests containing file:// protocols or suspicious URL patterns at the /export/pdf endpoint can provide temporary protection. Additionally, restricting access to the /upload endpoint by enforcing strong authentication mechanisms will prevent unauthenticated actors from injecting malicious HTML payloads. It is also recommended to configure WeasyPrint with security hardening options that disable external resource fetching entirely if such functionality is not strictly required for business operations, thereby eliminating the attack surface associated with SSRF and LFI vectors in this context. This vulnerability aligns with CWE-918 Server-Side Request Forgery and CWE-22 Path Traversal: Improper Limitation of a Pathname to a Restricted Directory as well as MITRE ATT&CK techniques related to Discovery via internal network scanning and Exfiltration Over Alternative Protocol through document embedding mechanisms.

Responsible

VulnCheck

Reservation

11/27/2026

Disclosure

11/27/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!