CVE-2025-53626: @pdfme/common Cross-Site Scripting Vulnerability
MODERATECVE-2025-53626 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting @pdfme/common libraries in the npm ecosystem. The issue involves @pdfme/common vulnerable to to xss and prototype pollution through its expression evaluation. Remediation is available by upgrading affected packages to version 5.4.1.
CVE-2025-53626 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2025-53626
To remediate this vulnerability, upgrade all affected @pdfme/common dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @pdfme/common@5.4.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @pdfme/common
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-53626, inspect your project dependencies using npm:
npm ls @pdfme/common
Analyze the terminal output to locate any version of @pdfme/common in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.4.1), your application is affected.
Note: The npm ls @pdfme/common command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In @pdfme/common, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-53626 Affected @pdfme/common Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@pdfme/common
|
npm |
≥ 5.2.0
< 5.4.1
|
5.4.1
|
References
Frequently Asked Questions
What is CVE-2025-53626?
Which @pdfme/common versions are affected?
What version fixes CVE-2025-53626?
Is @pdfme/common affected?
What is the CVSS score of CVE-2025-53626?
What CWE is associated with CVE-2025-53626?
How can I check npm dependencies for CVE-2025-53626?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-54xv-94qv-2gfg",
"modified" : "2025-07-10T23:23:06Z",
"published" : "2025-07-10T17:43:52Z",
"aliases" : [ "CVE-2025-53626" ],
"summary" : "@pdfme/common vulnerable to to XSS and Prototype Pollution through its expression evaluation",
"details" : "## 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```",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@pdfme/common"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.2.0"
}, {
"fixed" : "5.4.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pdfme/pdfme/security/advisories/GHSA-54xv-94qv-2gfg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-53626"
}, {
"type" : "WEB",
"url" : "https://github.com/pdfme/pdfme/pull/1117"
}, {
"type" : "WEB",
"url" : "https://github.com/pdfme/pdfme/commit/0dd54739acff2c249ed68c001a896bee38f0fd85"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pdfme/pdfme"
}, {
"type" : "WEB",
"url" : "https://github.com/pdfme/pdfme/releases/tag/5.4.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321", "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-07-10T17:43:52Z",
"nvd_published_at" : "2025-07-10T19:15:27Z"
}
}