-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security] Upload a malicious zip file can overwrite arbitary files >=v0.9.3.2 && <=0.9.4.1 #358
Comments
Done an initial analysis. It looks like an issue with Python My environment
I was not able to replicate this. The This is how MobSF do unzip: Mobile-Security-Framework-MobSF/StaticAnalyzer/views/shared_func.py Lines 63 to 103 in 81ef320
@DominikSchlecht, Can you see if this issue can be reproduced on a Windows Box.(My Windows VMs are bit messed up). I couldn't reproduce this on OSX using Python 2.7.10 @ic3z: What is your Python version? We should also investigate if the native os unzip binary have this issue:
|
Will have a look into this in some hours. Greetings, |
I can verify this on windows. Will start searching for a fix (maybe other zip-lib?). Greetings, |
Pushed a fix (996bc85) for windows. Using the extract-method, all "illegal characters" will be removed (doc). In Mac all tests pass, on windows there is a problem with the tests itself ;) But manual tests showed good results for both windows and android apps. @ic3z, @ajinabraham Please check, verify and merge if the solution is ok. Greetings, |
Good manual testing on windows. native os unzip binary not have this issue. But the file permissions after decompression is 000. chang create_zip function thank for testing on mac @AlkenePan |
cool |
@ic3z @AlkenePan |
@ic3z @AlkenePan Can you guys check if this is fixed in latest master |
@ajinabraham |
Ah sorry my bad. I tried with forward slash and looks like it's fixed in latest master. |
check this out @ic3z : http://bobao.360.cn/learning/detail/4503.html |
Generate malicious zip files
generate_zipfile.py
Upload evil.apk file
When the
evil.apk
is unpacked, the fileStaticAnalyzer\__init__.py
will be overwrittenThe text was updated successfully, but these errors were encountered: