Facebook for Android app had a serious vulnerability that could allow arbitrary code execution. Exploiting the bug could lead to app crash, and potentially device takeovers.
Facebook for Android Vulnerability
Security researcher Sayed Abdelhafiz discovered a vulnerability in the Facebook for Android app that could lead to code execution.
As described in his blog post, the bug basically affected the file download feature – that too – rather specifically.
As he explained, Facebook allows file download on its Android app in two ways. The first is via direct download from a post using the built-in DownloadManager. Whereas, the second one is by using the Files Tab which first fetches the file to the DownloadManager and then saves it to the Download director.
The second feature is where the bug existed. Abdelhafiz could successfully create a malicious file for download which then allowed executing arbitrary codes on the target device.
Regarding the payload, he explained,
I can upload files via Facebook mobile application. set-up burp suite proxy on my phone, enable white-hat settings on the application to bypass SSL pinning, intercepted upload file request, modify the filename to
../../../sdcard/PoC, file uploaded successfully and my payload is in the filename now!
While the file didn’t work via the first method, downloading it via the second method did work.
I was able to perform path traversal, I can now overwrite the native libraries and perform ACE attack.
In response to his tweet, the researcher stated the exploiting the bug might even allow device takeover. Though, this wasn’t established.
The researcher has shared the following video as PoC.
Facebook Awarded $10K Bounty
The researcher discovered the bug in Facebook’s Android app in April 2020. He then reached out to Facebook who acknowledged his findings.
The tech giant eventually fixed the bug in June 2020. For this report, the researcher won $10,000 as a bug bounty.