I'm a security researcher from pwnzen at Shanghai,China.
First of all, thank you for your sharing .
We found that
+ (BOOL)unzipFileAtPath:(NSString *)path
toDestination:(NSString *)destination
preserveAttributes:(BOOL)preserveAttributes
overwrite:(BOOL)overwrite
nestedZipLevel:(NSInteger)nestedZipLevel
password:(nullable NSString *)password
error:(NSError **)error
delegate:(nullable id<SSZipArchiveDelegate>)delegate
progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler
{
[...]
if ([strPath rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"/\\"]].location != NSNotFound) {
strPath = [strPath stringByReplacingOccurrencesOfString:@"\\" withString:@"/"];
}
NSString *fullPath = [destination stringByAppendingPathComponent:strPath];
[...]
}
function may lead to arbitrary file over write
In case of holding path traversal filenames in the archive, strPath should be checked for whether it contains "../../../".
I'm a security researcher from pwnzen at Shanghai,China.
First of all, thank you for your sharing .
We found that
function may lead to arbitrary file over write
In case of holding path traversal filenames in the archive, strPath should be checked for whether it contains "../../../".