Android : SOP Bypass to steal system files.
A pre-installed SMS app exposed an exported activity that launched a WebView pointed at an arbitrary URL, and that WebView allowed access to the local file system. An attacker could open a crafted local HTML file in the WebView and read system files such as default.prop, then send them to a server they control.
Published on servicenger.com
Android / Mobile
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the exported activity accepted an attacker-controlled URL for its WebView and enabled local file access, so the WebView's same-origin protection could be bypassed to read local files.
Impact
An attacker could read system files such as default.prop from the device and exfiltrate them to a server they control.
What the attacker needed
Pre-installed SMS app on the device; victim opens a crafted link or file
How it was found
- Create an HTML file that loads a local file in an iframe and tries to read its contents.
- Serve the file with a content type that forces a download so it lands on the device storage.
- Use an intent to launch the SMS app's activity with the downloaded file as its URL.
- The file opens in the app's WebView and its contents are read and sent to the attacker's server.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Android apps can expose parts of themselves so other apps or links can open them. Here the SMS app let an outside link open a built-in browser view (a WebView) that was allowed to read files on the phone. Because of that, a page the attacker supplied could read protected system files and upload them.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.