Class ZipSecurity


  • public final class ZipSecurity
    extends Object
    This type exposes helper methods to deal with attacks related to Zipping operations, most notably the "zip slip" attack.
    • Method Detail

      • createHardenedInputStream

        public static ZipInputStream createHardenedInputStream​(InputStream stream,
                                                               Charset charset)
        Returns a ZipInputStream that will check to make sure that paths encountered in the zip aren't absolute and don't contain escapes ("..") towards directories outside the zip's root.
      • createHardenedInputStream

        public static ZipInputStream createHardenedInputStream​(InputStream stream)
        Returns a ZipInputStream that will check to make sure that paths encountered in the zip aren't absolute and don't contain escapes ("..") towards directories beyond the root of the zip.