CVE-2026-31898
jsPDF has a PDF Object Injection via FreeText color
jsPDF is a library to generate PDFs in JavaScript. Prior to version 4.2.1, user control of arguments of the createAnnotation method allows users to inject arbitrary PDF objects, such as JavaScript actions. If 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 the createAnnotation: color parameter. The vulnerability has been fixed in [email protected]. As a workaround, sanitize user input before passing it to the vulnerable API members.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
8.1
jsPDF has a PDF Object Injection via FreeText color
jsPDF is a library to generate PDFs in JavaScript. Prior to version 4.2.1, user control of arguments of the createAnnotation method allows users to inject arbitrary PDF objects, such as JavaScript actions. If 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 the createAnnotation: color parameter. The vulnerability has been fixed in [email protected]. As a workaround, sanitize user input before passing it to the vulnerable API members.
- Record
CVE-2026-31898- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N - Weakness
- CWE-116, CWE-94
- Updated
- 2026-11-02
EUVDEUVD-2026-12753
8.1
jsPDF is a library to generate PDFs in JavaScript. Prior to version 4.2.1, user control of arguments of the createAnnotation method allows users to inject arbitrary PDF objects, such as JavaScript actions. If 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 the createAnnotation: color parameter. The vulnerability has been fixed in [email protected]. As a workaround, sanitize user input before passing it to the vulnerable API members.
- Record
EUVD-2026-12753- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-7x6v-j9x4-qf24
8.1
jsPDF has a PDF Object Injection via FreeText color
Impact
User control of arguments of the createAnnotation method allows users to inject arbitrary PDF objects, such as JavaScript actions.
If 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..
createAnnotation:colorparameter
Example attack vector:
import { jsPDF } from 'jspdf'
const doc = new jsPDF();
const payload = '000000) /AA <</E <</S /Launch /F (calc.exe)>>>> (';
doc.createAnnotation({
type: 'freetext',
bounds: { x: 10, y: 10, w: 120, h: 20 },
contents: 'hello',
color: payload
});
doc.save('test.pdf');
Patches
The vulnerability has been fixed in [email protected].
Workarounds
Sanitize user input before passing it to the vulnerable API members.
- Record
GHSA-7x6v-j9x4-qf24- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N - Weakness
- CWE-116
- Updated
- 2026-11-02
NVD
8.1
jsPDF is a library to generate PDFs in JavaScript. Prior to version 4.2.1, user control of arguments of the createAnnotation method allows users to inject arbitrary PDF objects, such as JavaScript actions. If 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 the createAnnotation: color parameter. The vulnerability has been fixed in [email protected]. As a workaround, sanitize user input before passing it to the vulnerable API members.
- Record
CVE-2026-31898- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N - Weakness
- CWE-116, CWE-94
- Updated
- 2026-11-02
OSV
8.1
jsPDF has a PDF Object Injection via FreeText color
jsPDF is a library to generate PDFs in JavaScript. Prior to version 4.2.1, user control of arguments of the createAnnotation method allows users to inject arbitrary PDF objects, such as JavaScript actions. If 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 the createAnnotation: color parameter. The vulnerability has been fixed in [email protected]. As a workaround, sanitize user input before passing it to the vulnerable API members.
- Record
CVE-2026-31898- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N - Weakness
- CWE-116
- Updated
- 2026-11-02
OSVGHSA-7x6v-j9x4-qf24
8.1
jsPDF has a PDF Object Injection via FreeText color
Impact
User control of arguments of the createAnnotation method allows users to inject arbitrary PDF objects, such as JavaScript actions.
If 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..
createAnnotation:colorparameter
Example attack vector:
import { jsPDF } from 'jspdf'
const doc = new jsPDF();
const payload = '000000) /AA <</E <</S /Launch /F (calc.exe)>>>> (';
doc.createAnnotation({
type: 'freetext',
bounds: { x: 10, y: 10, w: 120, h: 20 },
contents: 'hello',
color: payload
});
doc.save('test.pdf');
Patches
The vulnerability has been fixed in [email protected].
Workarounds
Sanitize user input before passing it to the vulnerable API members.
- Record
GHSA-7x6v-j9x4-qf24- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N - Weakness
- CWE-116
- Updated
- 2026-11-02
Show 5 moreShow less
OSVCLSA-2026-1773620214 No score
TuxCare security update for jspdf (2 CVEs)
TuxCare rebuilt jspdf to address 2 CVEs. Fixed in 2.5.2-tuxcare.8.
- Record
CLSA-2026-1773620214- Updated
- 2026-11-02
OSVCLSA-2026-1775176117 No score
TuxCare security update for jspdf (2 CVEs)
TuxCare rebuilt jspdf to address 2 CVEs. Fixed in 3.0.4-tuxcare.7.
- Record
CLSA-2026-1775176117- Updated
- 2026-11-02
OSVCLSA-2026-1780534264 No score
TuxCare security update for jspdf (12 CVEs)
TuxCare rebuilt jspdf to address 12 CVEs. Fixed in 2.5.1-tuxcare.1.
- Record
CLSA-2026-1780534264- Updated
- 2026-11-02
OSVCLSA-2026-1780966320 No score
TuxCare security update for jspdf (9 CVEs)
TuxCare rebuilt jspdf to address 9 CVEs. Fixed in 1.4.1-tuxcare.2.
- Record
CLSA-2026-1780966320- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2026-31898 No score
CVE-2026-31898 in jspdf - Patched by Root
Root has patched CVE-2026-31898 in the jspdf package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2026-31898- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
jspdfnpm |
through 4.2.0 | 4.2.1 |
jspdfTuxCare:npm From an advisory covering 2 CVEs |
2.5.2-tuxcare.0 up to 2.5.2-tuxcare.8, plus listed versions 2.5.22.5.2-tuxcare.12.5.2-tuxcare.22.5.2-tuxcare.32.5.2-tuxcare.42.5.2-tuxcare.52.5.2-tuxcare.62.5.2-tuxcare.7 |
2.5.2-tuxcare.8 |
jspdfTuxCare:npm From an advisory covering 2 CVEs |
3.0.4-tuxcare.0 up to 3.0.4-tuxcare.7, plus listed versions 3.0.43.0.4-tuxcare.13.0.4-tuxcare.23.0.4-tuxcare.33.0.4-tuxcare.43.0.4-tuxcare.53.0.4-tuxcare.6 |
3.0.4-tuxcare.7 |
jspdfTuxCare:npm From an advisory covering 12 CVEs |
2.5.1-tuxcare.0 up to 2.5.1-tuxcare.1, plus listed versions 2.5.1 |
2.5.1-tuxcare.1 |
jspdfTuxCare:npm From an advisory covering 9 CVEs |
1.4.1-tuxcare.0 up to 1.4.1-tuxcare.2, plus listed versions 1.4.11.4.1-tuxcare.1 |
1.4.1-tuxcare.2 |
jspdfnpm |
before 4.2.1 | 4.2.1 |
jspdfRoot:npm |
before 4.0.0-aikido.1 | 4.0.0-aikido.1 |
@rootio/jspdfRoot:npm |
before 4.0.0-root.io.1 | 4.0.0-root.io.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-31898 is a high vulnerability (CVSS 8.1) in Parall Jspdf, published March 17, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.38%, the 32nd percentile. Fixed in jspdf 4.2.1.
References
github.com/parallax/jsPDF/security/advisories/GHSA-7x6v-j9x4-qf24
github.com/parallax/jsPDF/commit/4155c4819d5eca284168e51e0e1e81126b4f14b8
github.com/parallax/jsPDF/blob/b1607a9391d4cd65ea7ade25998aea8345ae1be3/src/modules/annotations.js
github.com/parallax/jsPDF/releases/tag/v4.2.1
access.redhat.com/security/cve/CVE-2026-31898
bugzilla.redhat.com/show_bug.cgi?id=2448547
Show 7 moreShow less
security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31898.json
access.redhat.com/errata/RHSA-2026:7110
access.redhat.com/errata/RHSA-2026:7128
nvd.nist.gov/vuln/detail/CVE-2026-31898
github.com/advisories/GHSA-7x6v-j9x4-qf24
github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31898.json
github.com/parallax/jsPDF