org.webjars.npm:jszip@3.6.0 vulnerabilities

  • latest version

    3.10.1

  • latest non vulnerable version

  • first published

    8 years ago

  • latest version published

    2 years ago

  • licenses detected

  • package manager

  • Direct Vulnerabilities

    Known vulnerabilities in the org.webjars.npm:jszip 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
    • M
    Arbitrary File Write via Archive Extraction (Zip Slip)

    org.webjars.npm:jszip is a Create, read and edit .zip files with JavaScript http://stuartk.com/jszip

    Affected versions of this package are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip) due to improper sanitization of filenames when files are loaded with the loadAsync method.

    How to fix Arbitrary File Write via Archive Extraction (Zip Slip)?

    Upgrade org.webjars.npm:jszip to version 3.8.0 or higher.

    [,3.8.0)
    • M
    Denial of Service (DoS)

    org.webjars.npm:jszip is a Create, read and edit .zip files with JavaScript http://stuartk.com/jszip

    Affected versions of this package are vulnerable to Denial of Service (DoS). Crafting a new zip file with filenames set to Object prototype values (e.g __proto__, toString, etc) results in a returned object with a modified prototype instance.

    PoC

    const jszip = require('jszip');
    
    async function loadZip() {
    // this is a raw buffer of demo.zip containing 2 empty files:
    // - "file.txt"
    // - "toString"
    const demoZip = Buffer.from('UEsDBBQACAAIANS8kVIAAAAAAAAAAAAAAAAIACAAdG9TdHJpbmdVVA0AB3Bje2BmY3tgcGN7YHV4CwABBPUBAAAEFAAAAAMAUEsHCAAAAAACAAAAAAAAAFBLAwQUAAgACADDvJFSAAAAAAAAAAAAAAAACAAgAGZpbGUudHh0VVQNAAdPY3tg4FJ7YE9je2B1eAsAAQT1AQAABBQAAAADAFBLBwgAAAAAAgAAAAAAAABQSwECFAMUAAgACADUvJFSAAAAAAIAAAAAAAAACAAgAAAAAAAAAAAApIEAAAAAdG9TdHJpbmdVVA0AB3Bje2BmY3tgcGN7YHV4CwABBPUBAAAEFAAAAFBLAQIUAxQACAAIAMO8kVIAAAAAAgAAAAAAAAAIACAAAAAAAAAAAACkgVgAAABmaWxlLnR4dFVUDQAHT2N7YOBSe2BPY3tgdXgLAAEE9QEAAAQUAAAAUEsFBgAAAAACAAIArAAAALAAAAAAAA==', 'base64');
    
    const zip = await jszip.loadAsync(demoZip);
    zip.files.toString(); // this will throw
    return zip;
    }
    loadZip();
    

    How to fix Denial of Service (DoS)?

    Upgrade org.webjars.npm:jszip to version 3.7.1 or higher.

    [,3.7.1)