- java.lang.Object
-
- io.github.pixee.security.ZipSecurity
-
public final class ZipSecurity extends java.lang.ObjectThis type exposes helper methods to deal with attacks related to Zipping operations, most notably the "zip slip" attack.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.zip.ZipInputStreamcreateHardenedInputStream(java.io.InputStream stream)Returns aZipInputStreamthat 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.static java.util.zip.ZipInputStreamcreateHardenedInputStream(java.io.InputStream stream, java.nio.charset.Charset charset)Returns aZipInputStreamthat 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.
-
-
-
Method Detail
-
createHardenedInputStream
public static java.util.zip.ZipInputStream createHardenedInputStream(java.io.InputStream stream, java.nio.charset.Charset charset)Returns aZipInputStreamthat 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 java.util.zip.ZipInputStream createHardenedInputStream(java.io.InputStream stream)
Returns aZipInputStreamthat 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.
-
-