Path Traversal Vulnerability In Popular Android Apps Let Attackers Overwrite Files
- С сайта: Vulnerability(cybersecuritynews.com)
- Вернуться к списку новостей
Path Traversal Vulnerability In Popular Android Apps Let Attackers Overwrite Files
Author: Tushar Subhra DuttaHackers aim at well-known Android applications because many people use them, which means that when they attack, it can impact many users.
All these apps are rich in user data, which makes them even more lucrative for threat actors who may be looking forward to stealing personal details or spreading malware.
Recently, Microsoft identified a common path traversal vulnerability design in widely used Android apps. This vulnerability lets a malicious app overwrite files in the vulnerable apps’ home directories, leading to arbitrary code execution and token theft.
On Google Play Store, many vulnerable apps with more than four billion installs were found, and it is also expected to be present in other applications.
Microsoft has informed developers who were affected by this issue, helped them fix it, and partnered with Google to release recommendations for preventing such vulnerabilities.
Technical Analysis
The Android operating system enforces app isolation but provides the FileProvider component for secure file sharing between apps.
📁🄳🄾🄲🅄🄼🄴🄽🅃
However, improper FileProvider implementation can introduce vulnerabilities, enabling the bypassing of read and write restrictions within an app’s home directory.
Share targets are Android apps that declare themselves to handle data and files sent by other apps, such as mail clients, social networking apps, messaging apps, file editors, browsers, etc.
When a user clicks on a file, Android triggers a share-sheet dialog to select the receiving component.
![cyber security news](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWN0zsyH82dQc5Q70iwueTQ8Z_XKEaWgZSYq7SAiqbmnxnF0jf0RWBREMbSb9Gys1gVADDEBdzAyzbmtwcWQMLnURoJ7C74FpXtFPRCnUFnh6d9ozJQRhAxyQNfl1VFPxPALr2crON4UFbrsQFLmAz-WZTHrtsMaQwlA8E0KO64t4L0ARV0x-ndyY1dOI3/s16000/The%20Android%20share%20sheet%20dialog%20(Source%20-%20Microsoft).webp)
Suppose the sending app implements a malicious FileProvider version. In that case, it may cause the receiving app to overwrite critical files by exploiting the lack of validation on the received file’s content and using the provided filename to cache the file within the receiving app’s internal data directory.
Share targets can be exploited by a malicious Android app that creates a custom explicit intent to send a file directly to the share target’s file processing component without user approval.
The malicious app swaps in its own FileProvider implementation and gives the receiving share target app a filename it wrongly trusts.
Almost all reviewed share targets follow this flow:-
- Request the filename from the remote FileProvider
- Use it to initialize a file and output stream
- Create an input stream from the received content URI
- Copy input to the output stream
![cyber security news](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJg4QNyIwxxhSIsDF0PNASPSR0HU_fi9bVysSagFLr-iy5_yQ1ygw2L0TXZeiOQgUhtWv_9dt_IX78z4GsJbUW0UqAE_SvyGkXLa2oYINgjJ3RIoBBSB-yp8TrBF4ff5UIXTLe8y7VtpBfinXR9a_DjKFsS-gIUgf1UGu6qaUa_JqA9WdbDHUE_GzILpln/s16000/Getting%20remote%20access%20to%20local%20shares%20(Source%20-%20Microsoft).webp)
Because the rogue app controls both the filename and file content, sharing may lead to overwriting critical files in its private data space if this input is blindly trusted, which has serious consequences.
Microsoft found many well-known Android applications on the Google Play Store to contain a path traversal vulnerability, including Xiaomi’s File Manager and WPS Office, which have over 500 million installations each.
Recommendations
Here below we have mentioned all the recommendations:-
- Microsoft and Google offer guidance to Android developers on avoiding path traversal vulnerabilities.
- Developers should handle filenames from remote sources carefully, using random names or strict validation.
- Techniques like File.getCanonicalPath() and Uri.getLastPathSegment() should be used cautiously.
- Keep mobile apps updated from trusted sources to receive vulnerability fixes.
- For users who accessed shares through vulnerable Xiaomi app versions, reset credentials and monitor for irregularities.
- Microsoft Defender for Endpoint on Android detects malicious apps, while Defender Vulnerability Management identifies apps with known vulnerabilities.
#Android #Cyber_Security #Vulnerability #Android_Security #Microsoft_Research #Path_Traversal_Vulnerability
Оригинальная версия на сайте: