Skip to content
Engineering · · 4 min read

SDK Security: What to Audit Before You Integrate

By Tolinku Staff
|
SDK Security: What to Audit Before You Integrate

An SDK runs with your app's full privileges. It reaches your users' devices under your name, and your app store listing answers for what it does.

So the question before integrating is not whether the vendor seems reputable. It is what the package actually contains, which you can check yourself in about twenty minutes. Here are seven checks, in the order that finds problems fastest.

Count the Permissions

Open the manifest before you read the marketing. On Android an SDK can merge permissions into your app at build time, and they show up on your listing, not the vendor's.

Our own Android SDK declares exactly 1 permission, android.permission.INTERNET, and nothing else. That is a reasonable number for a linking SDK. Location, contacts, phone state or QUERY_ALL_PACKAGES in something that only resolves links should stop the review.

# every permission the merged manifest will carry, SDK included
./gradlew :app:processReleaseManifest
grep uses-permission app/build/intermediates/merged_manifests/release/AndroidManifest.xml

Count the Runtime Dependencies

Every dependency is code you ship and cannot see. Count them, then ask whether each is doing work the SDK could not do itself.

For comparison, our web SDK declares 0 runtime dependencies and 0 peer dependencies, and the iOS package declares 0 external dependencies for its library target. The Android SDK takes 4: okhttp, the Play Install Referrer library, and two coroutines modules. An SDK pulling in thirty is not necessarily wrong, but you now own thirty supply chains.

Check What the Dependencies Force on You

This is the check almost nobody runs, and it is where we found a real constraint in our own build.

okhttp-android declares a minCompileSdk of 36 from 5.4.0, and 37 from 5.5.1. That constraint does not stop at the library. It passes straight through to every app that depends on it, so taking the newest version would force every customer onto compileSdk 37. We pin 5.3.0 because it declares no floor at all.

Read your candidate SDK's dependency versions and check their metadata for the same thing. A transitive minCompileSdk can dictate your release timetable.

Ask What Identifier It Reads

This one decides which privacy regime you are in. An SDK that reads the advertising identifier puts you in tracking territory, with the consent prompts and the store declarations that follow.

None of the five Tolinku SDKs read the advertising identifier on any platform. The Android SDK reads coarse device signals instead: display metrics, locale, timezone and the OS release string. Those are compared to match an install back to a click and then discarded.

Grep the package for the identifier APIs directly rather than trusting a feature table.

# iOS: should return nothing for an SDK that claims not to track
grep -ri "ASIdentifierManager\|advertisingIdentifier\|ATTrackingManager" Sources/
# Android
grep -ri "AdvertisingIdClient\|ANDROID_ID" src/

Look for a Privacy Manifest

Apple expects an SDK to declare the data it collects and any required-reason APIs it calls, in a PrivacyInfo.xcprivacy inside the package. The developer embedding the SDK has to answer for its data flows in their own privacy label, and an absent manifest makes them guess.

Read it rather than noting its presence. A manifest that declares nothing while the binary calls those APIs is worse than none. It reads as an answer.

Running this check on our own packages is what produced it. The Flutter plugin shipped a manifest with no collected data types. That was true of the Swift in that directory. It was false of the package, because the Dart half makes the analytics and ecommerce calls. The native iOS package shipped no manifest at all, while calling UserDefaults in three places. That one is a required-reason API. Both now declare six data types, and the native package names the API category with reason CA92.1.

The React Native package still ships none. For a JavaScript package that is the right answer: no native iOS code, so no bundle to read a manifest out of. Ask for it in writing anyway.

Watch Where It Sends Traffic

Put a proxy in front of a debug build and exercise the SDK. You are looking for hosts you did not expect and payload fields you did not agree to.

Ours talks to one host, api.tolinku.com, and nothing else. Any SDK contacting a domain that is not the vendor's own deserves an explanation before it ships. The patterns here follow the same reasoning as our notes on deep linking security and privacy in deferred linking.

Weigh the Binary Cost

Size is a security question once you treat it as a proxy for surface area. More code means more to audit and more to go wrong, and it costs you install conversion as well. We break the measurements down in our SDK size comparison.

Running the Review

Do these in order and stop at the first one that cannot be answered. An SDK whose permission list you cannot explain will not get better three checks later.

  1. Merged permissions, and a reason for each.

    Runtime dependency count, and what each one does.

    Transitive constraints on compileSdk or minimum OS.

    Identifier access, grepped rather than asked.

    Privacy manifest present, and honest.

    Egress hosts under a proxy.

    Binary size against your install conversion.

    If you are comparing integrations across platforms, our cross-platform SDK integration guide covers the differences, and the deep linking documentation explains what the SDK is doing when it resolves a link.

Get deep linking tips in your inbox

One email per week. No spam.

Ready to add deep linking to your app?

Set up Universal Links, App Links, deferred deep linking and analytics in minutes. Free to start.