- by x32x01 ||
A mobile application penetration test can sometimes uncover vulnerabilities that go far beyond the mobile app itself. In this engagement, what started as reverse engineering a Flutter ride-hailing app eventually led to an Admin Account Takeover, followed by Remote Code Execution (RCE) on a shared server.
I extracted several endpoints, including those related to login, OTP verification, and registration, and organized them for further testing.
While reviewing the backend origins, I discovered that one of them belonged to an admin panel. Both the ride-hailing app and the admin dashboard appeared to share the same backend infrastructure.
That shifted the focus of the engagement from mobile testing to the web application.
While reviewing the login request and comparing it with the registration functionality available through another backend origin, I noticed an interesting difference in how the application handled authentication input.
The login handler's password validation was conditional on the password being present in the request body. This exposed a weakness in the authentication logic.
After testing the behavior in the authorized environment, I was able to bypass authentication without valid credentials.
The server returned Laravel session cookies. However, receiving session cookies alone wasn't sufficient to confirm an authenticated session. The actual proof came when I used the session in a browser and successfully accessed the dashboard with Super Admin privileges.
The result: Admin Account Takeover without valid credentials.
Among the features I found was a simple Profile Picture Upload functionality. It turned out to be more dangerous than it appeared.
The upload functionality had several security weaknesses:
Even more concerning, the upload functionality wasn't properly restricted by role-based permissions. A role such as Call Center could access functionality that ultimately exposed the server to RCE.
At that point, I stopped testing. Assessing other tenants on the shared infrastructure was outside the scope of the engagement.
Sometimes, the most interesting vulnerabilities aren't inside the mobile app itself, but in the backend infrastructure it exposes. 😄
🔍 Reverse Engineering the Flutter App
I started by reverse engineering the ride-hailing application and quickly discovered it was built with Flutter. The app had no string obfuscation, making its backend origins and API routes easy to identify.I extracted several endpoints, including those related to login, OTP verification, and registration, and organized them for further testing.
While reviewing the backend origins, I discovered that one of them belonged to an admin panel. Both the ride-hailing app and the admin dashboard appeared to share the same backend infrastructure.
That shifted the focus of the engagement from mobile testing to the web application.
🔐 Admin Authentication Bypass
I started testing the admin login endpoint for common vulnerabilities, including SQL Injection, but didn't find anything promising.While reviewing the login request and comparing it with the registration functionality available through another backend origin, I noticed an interesting difference in how the application handled authentication input.
The login handler's password validation was conditional on the password being present in the request body. This exposed a weakness in the authentication logic.
After testing the behavior in the authorized environment, I was able to bypass authentication without valid credentials.
The server returned Laravel session cookies. However, receiving session cookies alone wasn't sufficient to confirm an authenticated session. The actual proof came when I used the session in a browser and successfully accessed the dashboard with Super Admin privileges.
The result: Admin Account Takeover without valid credentials.
👑 From Super Admin to Remote Code Execution
After gaining Super Admin access, I reviewed the dashboard's available features and their potential security impact.Among the features I found was a simple Profile Picture Upload functionality. It turned out to be more dangerous than it appeared.
The upload functionality had several security weaknesses:
- Uploaded files were stored in a web-accessible directory.
- File extensions were not properly restricted or transformed.
- The server-side handling of uploaded files allowed executable content to be processed.
Even more concerning, the upload functionality wasn't properly restricted by role-based permissions. A role such as Call Center could access functionality that ultimately exposed the server to RCE.
💥 Impact on the Server
After confirming RCE, I was able to access sensitive application files, including the.env file, which exposed information such as:APP_KEY- Database credentials
- Application source code
At that point, I stopped testing. Assessing other tenants on the shared infrastructure was outside the scope of the engagement.
🛡️ Key Security Lessons
This engagement highlights how weaknesses across multiple layers can combine into a critical security issue:- Authentication: Missing or conditional validation can lead to authentication bypass.
- Authorization: Sensitive functionality must be restricted to the appropriate roles.
- File Uploads: Uploaded files should never be executable from publicly accessible directories.
- Server Configuration: Upload directories should not allow server-side execution.
- Secrets Management: Sensitive credentials and application keys should be protected.
- Mobile Security: Reverse engineering a mobile app can reveal backend attack surfaces that deserve deeper testing.
Sometimes, the most interesting vulnerabilities aren't inside the mobile app itself, but in the backend infrastructure it exposes. 😄