We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6fdbc77 commit b58404cCopy full SHA for b58404c
android/src/main/java/com/alpha0010/fs/FileAccessModule.kt
@@ -403,6 +403,9 @@ class FileAccessModule(reactContext: ReactApplicationContext) :
403
while (entry != null) {
404
val targetFile = File(targetFolder, entry.name)
405
when {
406
+ !targetFile.canonicalPath.startsWith(targetFolder.canonicalPath) -> {
407
+ throw SecurityException("Failed to extract invalid filename '${entry.name}'.")
408
+ }
409
entry.isDirectory -> {
410
targetFile.mkdirs()
411
}
0 commit comments