Skip to content
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] Fix Local File Inclusion Vulnerability in ViewSource Function. Version <= v0.9.2 #166

Closed
wants to merge 1 commit into from

Conversation

thongngo
Copy link

Hi Ajin,

I've found a Local File Inclusion Vulnerablity in StaticAnalyzer/views.py (Version <= v0.9.2)

Detail: Bypass "md5" varriable by

  • An actual md5 string (e.g: an uploaded file) at the head.
  • Null-byte at the end of string

PoC:
http://127.0.0.1:8000/ViewSource/
?file=de/robv/android/xposed/installer/repo/RepoDb.java
&md5=36570c6fac687ffe08107e6a72bd3da7/../../../../../../../../../../../private/etc/passwd%00
&type=apk

Before fixing: read /private/etc/passwd on MAC OS
1_modsf_v0 9 2_lfi_unfix
After Fixed
2_modsf_v0 9 2_lfi_fixed

I'm still working on contributing this great project.
Thanks for all

@ajinabraham
Copy link
Member

Nice Catch!.
There is an easy fix for this.
The regex that checks for MD5 is not bounded now. doing strict boundary check will prevent this bug.

@ajinabraham
Copy link
Member

ajinabraham commented May 26, 2016

@thongngo The reported bug should be fixed by ajinabraham@b9cdd1f

Can you please pull the latest master and see if this is fixed?

@thongngo
Copy link
Author

@ajinabraham Nice Fix! Ajin. The latest master works well. Thank you.

@ajinabraham
Copy link
Member

Verified the fix.

@ajinabraham ajinabraham added the security Security issues in MobSF label Jul 21, 2016
@ajinabraham ajinabraham changed the title Fix Local File Inclusion Vulnerability in ViewSource Function. Version <= v0.9.2 [security] Fix Local File Inclusion Vulnerability in ViewSource Function. Version <= v0.9.2 Dec 19, 2019
@ajinabraham ajinabraham changed the title [security] Fix Local File Inclusion Vulnerability in ViewSource Function. Version <= v0.9.2 [Security] Fix Local File Inclusion Vulnerability in ViewSource Function. Version <= v0.9.2 Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security Security issues in MobSF
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants