Account takeover in Android app via JSB #1510
Merged
+106
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
Target surface: Android app embedding a Chromium-based WebView with a JavaScript Bridge (JSB) registered as
xbridgeviaaddJavascriptInterface. The app also supports deep links and an in-app IM WebView.Goal: Steal the user’s authenticated session by exfiltrating the WebView cookie database and, more generally, read arbitrary files from the app sandbox.
Tools and setup:
- Reverse/decompile: <a href="https://github.com/skylot/ja...
🔧 Technical Details
JSB dispatcher abuse: When a bridge exposes a generic dispatcher (e.g.,
invokeMethod) that deserializes attacker JSON into aBridgeObject, sethandlerNameto a sensitive module and shapedatato hit dangerous native sinks. The callback/Promise mechanism returns results into page JS viaevaluateJavascript.Arbitrary file read via URI → File: If a handler does
Uri.parse(req.uri).getPath()→new File(...)without an allowlist, passing afile://URI lets you read app-sandbox files (e.g., WebView cookie DB) and exfiltrate them as Base64 through the JSB callback.Bypassing WebView privilege gates: Avoid host checks using
String.endsWith. Logic likehost.endsWith(".trusted.com") || ".trusted.com".endsWith(host)lets unrelated domains pass, loading a JSB-enabled WebView. Apply De Morgan’s law to simplify and spot the flawed OR con...🤖 Agent Actions
I analyzed the blog and the HackTricks repository and updated the existing Android WebView page with the new, highly technical exploitation techniques from the post.
What I changed
Added a dedicated subsection under the JavaScript Bridge area explaining:
Expanded References:
Why this location
References added
No other files were modified or created.
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.