Every CVE Search/ Get API key

CVE-2026-31898

jsPDF has a PDF Object Injection via FreeText color

8.1 HighFix available

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

0.38%Up 0.3 points since Mar 18, 2026
90%50%10%1%

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 HighCVSS: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 HighCVSS: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: color parameter

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 HighCVSS: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 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
CVSS 3.1
6.5 MediumCVSS: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 HighCVSS: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: color parameter

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 HighCVSS: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

Affected packages
PackageAffectedFixed
jspdf
npm
through 4.2.0
4.2.1
jspdf
TuxCare: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
jspdf
TuxCare: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
jspdf
TuxCare: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
jspdf
TuxCare: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
jspdf
npm
before 4.2.1
4.2.1
jspdf
Root:npm
before 4.0.0-aikido.1
4.0.0-aikido.1
@rootio/jspdf
Root:npm
before 4.0.0-root.io.1
4.0.0-root.io.1

History

History
RecordedChangedSources
affected, facts
first indexedCVE 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

Show 7 moreShow less
MoveEnter Open