# CVE-2025-53626: pdfme XSS and prototype pollution in expression evaluation

Source: https://junglewise.ai/threats/cve-2025-53626-pdfme-xss-and-prototype-pollution-in-expression-evaluation  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-07-10. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2025-53626 · Severity: low · CVSS 3.1 · Published 2025-07-10

pdfme is a JavaScript library for generating PDF documents with dynamic templates. The expression evaluation feature in versions 5.2.0 through 5.4.0 contains vulnerabilities that allow attackers to escape the expression sandbox and execute arbitrary JavaScript code, steal sensitive data like cookies and authentication tokens, or modify application behavior through prototype pollution attacks. This requires user interaction to load a malicious template.

Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2025-53626 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-53626 being exploited in the wild.

**How severe is CVE-2025-53626?** Low severity, with a CVSS score of 3.1, published 10 July 2025.

**Which products and versions are affected?** @pdfme/common (npm) SEMVER:introduced=5.2.0,fixed=5.4.1.

**Is there a fix for CVE-2025-53626?** Yes. @pdfme/common (npm): upgrade to 5.4.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-53626 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2025-53626?** Check whether you run @pdfme/common (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @pdfme/common (npm): upgrade to 5.4.1 or later

  ```sh
  npm install @pdfme/common@5.4.1
  ```


## Technical details

The @pdfme/common library's expression evaluator implements a sandbox to safely evaluate template expressions, but this sandbox can be bypassed through multiple attack vectors. The primary vulnerability is a sandbox escape that allows attackers to obtain the Function constructor using indirect object property access methods like Object.getOwnPropertyDescriptor and Object.getPrototypeOf, enabling arbitrary JavaScript code execution in the application context. The secondary vulnerability involves prototype pollution through unfiltered access to prototype accessor methods (__lookupGetter__, __lookupSetter__, __defineGetter__, __defineSetter__) which can be exploited with Object.assign to pollute the prototype chain. The attack vector is network-based with low complexity and requires user interaction (loading a malicious PDF template). Affected versions are 5.2.0 through 5.4.0; a fix was released in version 5.4.1 implementing safeAssign and enhanced input sanitization.

## Affected products

- pdfme @pdfme/common 5.2.0 through 5.4.0

## Identifiers

- CVE-2025-53626
- GHSA-54xv-94qv-2gfg

## Timeline

- 2025-07-10: disclosed: GHSA-54xv-94qv-2gfg published
- 2025-07-09: patched: Version 5.4.1 released with XSS and prototype pollution fixes (commit 0dd5473)

## References

- [https://github.com/pdfme/pdfme/security/advisories/GHSA-54xv-94qv-2gfg](https://github.com/pdfme/pdfme/security/advisories/GHSA-54xv-94qv-2gfg)
- [https://github.com/pdfme/pdfme/pull/1117](https://github.com/pdfme/pdfme/pull/1117)
- [https://github.com/pdfme/pdfme/commit/0dd54739acff2c249ed68c001a896bee38f0fd85](https://github.com/pdfme/pdfme/commit/0dd54739acff2c249ed68c001a896bee38f0fd85)
- [https://github.com/pdfme/pdfme](https://github.com/pdfme/pdfme)
- [https://github.com/pdfme/pdfme/releases/tag/5.4.1](https://github.com/pdfme/pdfme/releases/tag/5.4.1)

## Related threats

- [PDFME SSRF in getB64BasePdf via unvalidated URL fetch](https://junglewise.ai/threats/cve-2026-82866-pdfme-ssrf-in-getb64basepdf-via-unvalidated-url-fetch)
