Every third-party SDK in a mobile app runs with the app's own permissions, identity and network access, so the app owner carries the risk and the accountability for whatever that code collects, sends or loads. Advertising, analytics, attribution, crash reporting and engagement SDKs are the most common source of undeclared data collection in mobile apps, and both app stores and regulators now treat the app publisher as responsible for them. This guide sets out a practical vetting and governance process for those SDKs: what to check before adoption, how to use Apple privacy manifests and the Google Play Data safety form as control points, how to handle the API keys and tokens SDKs carry, and how to keep watching an SDK after it ships.
The broader supply chain picture, including build pipelines and dependency integrity, is covered in the OWASP Mobile Top 10 M2 Inadequate Supply Chain Security Guide. This page goes deeper on the data and privacy side of SDK risk, which is where most enforcement has landed.
Key takeaways
- You own the SDK's behaviour. Apple states that when you use a third-party SDK, you are responsible for all the code it includes in your app, and Google says app developers are responsible for an SDK's data collection even if they do not use a particular function of it.
- Ad, analytics and attribution SDKs deserve the strictest review because their business model depends on collecting identifiers, location and behavioural data, often across many apps.
- Apple privacy manifests and SDK signatures, and the Google Play Data safety form, are useful control points, but they are declarations. Verify them with network and static analysis.
- SDK API keys, write keys and DSNs embedded in the app are non-human credentials that are public by design. Scope them so a leaked key cannot read data or change configuration.
- Consent must gate SDK initialisation, not just data upload. An SDK that starts before the consent decision has already collected data.
- Keep an SDK register with an owner, purpose, data categories, version, endpoints and review date for each SDK, and re-review on every version change.
Why mobile SDKs are a distinct risk
A mobile SDK is not a passive library. Once linked into an app it runs in the same process, inherits every runtime permission the user has granted (location, contacts, photos, Bluetooth, microphone), can read the app's own storage and keychain or keystore entries that are not separately protected, and can open network connections to its own servers. On Android it can also load code at run time. From the operating system's point of view, the SDK is the app.
That creates three kinds of exposure:
- Data harvesting. The SDK collects more data than the app needs, or sends it to parties the app's privacy policy does not mention. Location, advertising identifiers, installed app lists and device fingerprints are the usual targets.
- Undeclared behaviour change. A new SDK version adds collection, new endpoints or new permissions. Because SDK updates are often pulled in by dependency managers, the change can ship without anyone reading the release notes.
- Code integrity. A compromised SDK distribution channel, a repackaged binary or remotely fetched code changes what the app does after review.
Ad, analytics and attribution SDKs sit at the high end of all three. Their value to their vendor comes from aggregating signals across many apps, which is exactly the behaviour that app store policies and privacy law restrict.
What regulators and the stores now expect
Regulatory attention on SDKs has moved from the SDK vendor alone to the whole chain. In January 2024 the US Federal Trade Commission announced an order against data broker X-Mode Social and its successor Outlogic, which it charged with selling precise location data that could reveal visits to sensitive locations such as medical clinics, places of worship and domestic abuse shelters. According to the FTC, part of that data came from third-party apps that embedded the company's SDK. The proposed order prohibited sharing or selling sensitive location data, required deletion of previously collected location data unless consent was obtained or the data was deidentified, and required a supplier assessment programme to confirm that data providers obtain informed consent. For app publishers the lesson is direct: an SDK that monetises your users' location makes your app part of a data broker's supply chain.
The app stores have built the same principle into their submission rules.
Apple
Apple introduced privacy manifests and signatures for third-party SDKs at WWDC23. A privacy manifest describes the privacy practices of third-party code in a single standard format, and when you prepare to distribute your app Xcode combines the privacy manifests across all the third-party SDKs into a single report. When you adopt a new version of a third-party SDK, Xcode validates that it was signed by the same developer.
Apple publishes a list of commonly used SDKs, including widely used analytics, crash reporting, messaging and cross-platform framework components. You must include the privacy manifest for any listed SDK when you submit a new app that includes it, or an update that adds it, and signatures are also required where those SDKs are used as binary dependencies. Any version of a listed SDK, and any SDK that repackages one, is in scope. Apple also set dates for required reason APIs: from 13 March 2024 developers uploading apps that use those APIs without declared reasons received email warnings, and from 1 May 2024 approved reasons became a condition of uploading a new or updated app.
Google Play
Google Play's Data safety guidance says that data transmitted off the device by libraries or SDKs used in your app counts as collection by your app, and that data an SDK sends to a third party must be declared as sharing unless an exemption, such as a service provider processing only on your behalf, applies. Google is explicit that the developer alone is responsible for complete and accurate declarations and must reflect collection or sharing carried out by third-party code. Data an SDK only accesses on the device and never transmits does not need to be declared as collection.
Android's SDK guidance adds that before integrating an SDK you should know what permissions it uses, what data it collects and why, and that sharing location with a third party or SDK must be made known to users through the Prominent Disclosure and Consent requirements. It also points developers to the Google Play SDK Index, which shows which SDKs are registered on Play Console and which Android permissions they use.
Vetting an SDK before adoption
Treat a new SDK like onboarding a vendor that will run code on your customers' devices. A practical intake review covers the following questions, answered in writing and stored with the SDK register entry.
| Area | Questions to answer | Evidence |
|---|---|---|
| Purpose | Which business function needs it? Which features will be used? Is there a server-side alternative? | Named business owner and ticket |
| Data | What data categories does it collect by default and when enabled? Is any data shared with the SDK vendor's other customers or partners? | Vendor data documentation, privacy manifest, store disclosure guidance |
| Permissions | Which OS permissions does it request or use if granted? Does it read advertising identifiers or location? | Merged Android manifest diff, Play SDK Index entry, privacy manifest |
| Network | Which domains does it contact? Are they tracking domains? | Proxy capture from a test build |
| Code loading | Does it download or interpret code at run time? Can the vendor change behaviour remotely? | Vendor statement, static analysis |
| Consent | Can initialisation be deferred until consent? Does it honour opt-out and tracking authorisation states? | Integration test |
| Credentials | What key, token or DSN ships in the app? What can that credential do? | Vendor console permission model |
| Integrity | How is it distributed? Is it signed? Can you pin a version and checksum? | Package manager lock file, signature check |
| Contract | Is the vendor a processor or an independent controller? Is resale or cross-customer profiling excluded? | Data processing agreement |
For advertising and attribution SDKs, the contract row matters as much as the technical ones. If the vendor's terms allow it to use data from your app to build profiles across its customer base, Google's guidance treats that as sharing, and it is the pattern the FTC acted against. Ask for the restriction in writing or do not adopt the SDK.
Reject or escalate any SDK that cannot be initialised after consent, that downloads executable code at run time without a documented control, or whose vendor cannot say which domains it contacts.
Using privacy manifests and Data safety as control points
Store declarations are only useful if someone reconciles them with what the app does. Build the reconciliation into the release process.
On iOS
- Generate the Xcode privacy report from the release archive for every release candidate and store it as a build artefact.
- Compare the report with the previous release. Any new collected data type, new tracking domain or new required reason API category is a change that needs owner sign-off.
- Check that the privacy report, the App Store privacy label and your privacy policy say the same thing. Differences are a finding, whichever document is wrong.
- Make sure SDKs on Apple's list are consumed in versions that include their privacy manifest, and that binary SDKs carry a valid signature. Treat a signature identity change on an SDK update as a stop condition until you have confirmed the vendor changed signing on purpose.
- Domains declared as tracking domains should only be contacted after the user has granted tracking permission. Confirm this in testing.
On Android
- Diff the merged manifest between releases. New permissions, services, receivers and content providers contributed by an SDK are visible there before they reach users.
- Look up each SDK in the Play SDK Index and record the permissions listed.
- Maintain the Data safety form from the SDK register, not from memory. Each SDK entry should list the data types it transmits and whether that is collection or sharing.
- Check for SDKs that load interpreted code at run time. Android's guidance says such code must not allow violations of Play policies, which means the app owner needs a way to know what is loaded.
A declaration produced by the SDK vendor is a starting point. Your evidence is what the app actually sends, observed in the next step.
Verifying behaviour with testing
Run each release candidate through a short, repeatable behavioural test on real devices or emulators with an intercepting proxy. The aim is not a full penetration test but a check that observed behaviour matches declarations.
- Fresh install with consent declined. Record every outbound domain before and after the consent screen. No SDK that depends on consent should contact its endpoints.
- Fresh install with consent granted and tracking permission denied. Advertising identifiers should be absent or zeroed, and tracking domains should not be contacted.
- Consent granted and all permissions granted. Record which SDKs send location, device identifiers or app usage events, and at what frequency.
- Withdraw consent in the app settings. Confirm SDKs stop sending and that the app calls any vendor opt-out or deletion API you have documented.
Compare the domain list and payload categories with the SDK register and store declarations. Static analysis tools can complement this by listing embedded SDKs, hard-coded endpoints and secrets, and calls to sensitive APIs. The Mobile App Security Testing Guide covers tooling and method in more depth, and the OWASP MASVS and MASTG give a verification baseline for privacy and code quality controls.
SDK credentials as non-human identities
Almost every analytics, attribution, crash reporting and messaging SDK is configured with a credential that ships inside the app: an API key, a write key, a project identifier or a DSN. These are non-human identities. They identify your app to the vendor's service and authorise it to send data, and anyone who unpacks the app can extract them.
Because extraction is a given, the control is scope, not secrecy:
- Use the vendor's client-side or ingestion-only key type. A key embedded in a mobile app should be able to write events and nothing else. It must never be able to read data, export data, change configuration or manage users.
- Keep server-side keys for exports, data deletion requests and configuration on your backend, stored in a secrets manager, owned by a named team and rotated on a schedule.
- Apply platform restrictions where the vendor supports them, such as binding a key to your bundle identifier or package name and signing certificate. The Google API Keys Security Guide shows how this works for Firebase and Google Maps keys.
- Separate keys per environment and per app, so a key pulled from a debug build or a test app cannot be used to poison production analytics.
- Record every embedded SDK key in your non-human identity inventory with its scope, owner and rotation procedure. Rotating a key embedded in a shipped app means a release, so plan for overlapping validity.
Watch the vendor console side too. The human and service accounts that can administer your analytics or attribution project hold all the collected data. Put them behind SSO and MFA, remove leavers promptly and review API tokens created in those consoles.
Consent, initialisation and data minimisation
The most common SDK finding is not malicious code but premature initialisation. Many SDKs start collecting as soon as they are initialised in the application start-up path, which runs before any consent screen. By the time the user declines, the install event, device data and identifiers may already have left the device.
Design the integration so that:
- SDKs that need consent are initialised only after a recorded consent decision, using the vendor's delayed initialisation or explicit opt-in mode.
- A single consent state in the app drives every SDK, so a change in the settings screen reaches all of them.
- Optional features such as automatic screen tracking, location enrichment, IP collection and session replay are switched off unless a documented purpose requires them.
- Free text fields, search terms and form inputs are excluded from event capture, so personal data does not leak into analytics by accident.
- Data retention in each vendor console is set to the shortest period that meets the purpose.
Legal bases and consent records are covered in the Consent Management Guide: Cookies, CMPs and GPC. The security team's job is to prove technically that the app does what the consent record says.
Governance after the SDK ships
An SDK review at adoption is not enough, because SDKs change with every version. Ongoing governance needs four parts.
- An SDK register. One entry per SDK per app: business owner, purpose, version, data categories, permissions, domains, embedded credential and scope, consent dependency, contract status and last review date. Generate as much as possible from the build (dependency lock files, the iOS privacy report, the merged Android manifest) so the register cannot drift.
- Version pinning and change review. Pin SDK versions in lock files and route upgrades through a pull request that includes the privacy report or manifest diff. Automated dependency update tools are fine as long as the diff is reviewed. The Dependency Intake Review Checklist can be adapted for SDK upgrades.
- Software composition analysis and SBOM. Include mobile SDKs, including binary frameworks, in your SBOM so that vulnerability and vendor incident notices can be matched to apps quickly. See the SBOM Guide.
- Periodic removal review. At least annually, ask each owner whether the SDK is still used. Unused SDKs still collect data. Removing them is the cheapest privacy and security control available.
Also prepare for the day an SDK vendor has an incident or is named in enforcement action. The response plan should cover how to disable the SDK remotely through your own feature flag, how to ship a build without it, which store declarations to update, and who contacts the vendor about deletion of data already collected.
Common failure patterns
- Declaration by copy and paste. The Data safety form or privacy label is filled from the SDK vendor's marketing page and never compared with observed traffic.
- Consent screen after start-up. SDKs are initialised in the application start-up path, so data flows before the user decides.
- Unreviewed upgrades. A minor version bump adds a new tracking domain or permission and ships without a privacy report diff.
- Over-privileged embedded keys. A key with export or admin rights is shipped in the app because it was the only key the integration guide mentioned.
- Orphaned SDKs. An attribution or ad SDK from a past campaign stays in the build for years with no owner.
- Transitive SDKs. A mediation or cross-platform plugin pulls in further SDKs that never appear in the register.
- Remote configuration as a blind spot. SDK behaviour is changed from the vendor console without any change in the app, so release reviews never see it.
Practitioner checklist
- Every SDK in every app has a register entry with a business owner, purpose, data categories, domains and review date.
- New SDKs pass a written intake review covering data, permissions, network, code loading, consent, credentials, integrity and contract.
- Advertising and attribution SDK contracts exclude resale and cross-customer profiling of your users' data.
- The iOS privacy report and the merged Android manifest are generated and diffed for every release candidate.
- SDKs on Apple's commonly used SDK list ship with privacy manifests and, as binaries, valid signatures; signer changes block release until confirmed.
- App Store privacy labels, the Play Data safety form and the privacy policy are reconciled with observed network behaviour each release.
- Consent-dependent SDKs initialise only after a recorded consent decision, and withdrawal stops collection.
- Embedded SDK keys are ingestion-only, per environment, platform-restricted where possible and listed in the NHI inventory.
- Vendor console accounts and API tokens are behind SSO and MFA and reviewed quarterly.
- SDKs appear in the SBOM and an annual removal review is completed for each app.
Standards and references
- Apple: Third-party SDK requirements
- Apple Developer News: Privacy updates for App Store submissions (February 2024)
- Apple: Privacy manifest files
- Google Play Console Help: Provide information for Google Play's Data safety section
- Android Developers: SDK best practices
- FTC: Order prohibits data broker X-Mode Social and Outlogic from selling sensitive location data (January 2024)
- OWASP: Mobile Application Security Verification Standard
- NIST: SP 800-218 Secure Software Development Framework (SSDF) Version 1.1
Related NHI Mgmt Group resources: OWASP Mobile Top 10 M2 Inadequate Supply Chain Security Guide · Mobile App Security Guide · iOS App Security Guide · Android App Security Guide