Skip to content

Reflected XSS through crafted PDF metadata fields (Title and Author)

Low
Frooodle published GHSA-rjjx-43g5-mp76 May 23, 2026

Package

Stirling-PDF (Stirling-PDF)

Affected versions

1.3.2

Patched versions

2.0.0

Description

Summary

A Reflected Cross-Site Scripting (XSS) vulnerability exists in the /get-info-on-pdf endpoint. By uploading a specially crafted PDF file containing malicious JavaScript payloads in its metadata (Title or Author fields), an attacker can trigger execution of arbitrary JavaScript in any user’s browser who views the resulting page.

image

Details

The affected functionality extracts only the Title and Author metadata fields from uploaded PDF files and renders them back to the client via the /get-info-on-pdf page. These values are directly embedded into the returned HTML without proper HTML encoding or sanitization.

Because characters such as <, >, and " are not escaped, an attacker can inject arbitrary HTML or JavaScript into the response. This results in execution of attacker-controlled code in the context of the application's domain.

The root cause is the lack of output encoding for these untrusted PDF metadata fields (Title and Author).
Example vulnerable flow:

  • A PDF file is uploaded with metadata containing special characters.
  • The application parses the metadata and returns it inside the HTML response.
  • The browser interprets injected tags/scripts, leading to XSS execution.

PoC

Steps to reproduce:

  1. Create a PDF file and set its Title or Author metadata field to the following payload:

<img src=x onerror=alert(1)>

  1. Upload the crafted PDF file via the /get-info-on-pdf endpoint.

  2. Open the resulting page in a web browser.

  3. The JavaScript payload (alert(1)) will execute immediately upon page load, confirming the metadata is rendered without proper sanitization and enabling reflected XSS.

Impact

  • Type of vulnerability: Reflected Cross-Site Scripting (XSS).
  • Who is impacted: Any user who views the result of a specially crafted PDF uploaded to /get-info-on-pdf.

Potential attacker actions:

  • Execute arbitrary JavaScript in the context of the application.
  • Manipulate page content, redirect users, or perform phishing attacks.
  • Exfiltrate sensitive client-side data accessible in the browser (cookies, localStorage, DOM data).
    This vulnerability allows an attacker to compromise the integrity and confidentiality of the client-side environment, posing a significant security risk.

Severity

Low

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
High
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

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:H/PR:N/UI:R/S:U/C:L/I:N/A:N

CVE ID

CVE-2026-41580

Weaknesses

Improper Input Validation

The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. Learn more on MITRE.

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

Improper Encoding or Escaping of Output

The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. Learn more on MITRE.

Credits