TL;DR: Mobile app research across more than 10,000 Android and iOS apps found hundreds of live credentials embedded in production builds, while LLM-assisted analysis identified thousands more hidden secrets that regex-based tools missed, according to Guardsquare and cited academic studies. The control problem is not just detection, but reducing on-device trust assumptions so leaked secrets have limited value.
At a glance
What this is: This analysis argues that mobile app security needs both scanning and protection because hardcoded secrets still ship in production builds and modern analysis, including AI-assisted methods, can uncover more than traditional scanners.
Why it matters: For IAM and NHI practitioners, this matters because embedded API keys, OAuth tokens, and cryptographic material behave like exposed non-human credentials that can expand blast radius across backend services, repositories, and mobile release pipelines.
By the numbers:
- In a 2025 study of 10,331 apps, researchers found 416 valid credentials across 65 services.
- LLM-based SecretLoc analysis scanned thousands of APKs and identified 4,800+ hidden secrets missed by traditional regex scanners.
👉 Read Guardsquare's analysis of why mobile app security needs both scanning and protection
Context
Mobile app secrets exposure is a governance problem, not just a code-quality problem. When API keys, OAuth tokens, or cryptographic material are embedded in client binaries, the app itself becomes a credential container that attackers can inspect after release. That makes mobile release pipelines part of identity and secrets governance, especially when those secrets unlock cloud services, payment systems, or internal repositories.
The article is strongest where it separates discovery from protection. Scanning helps find accidental leakage before release, while protection hardens the delivered app against reverse engineering, memory inspection, and tampering. For IAM and NHI programmes, the real issue is lifecycle control over embedded credentials, not whether a binary can be made opaque.
The article’s starting position is typical for modern mobile environments: even teams with mature development practices still leak secrets into shipped apps.
Key questions
Q: How should security teams govern hardcoded secrets in mobile apps?
A: Security teams should treat hardcoded secrets in mobile apps as revocable access credentials, not code trivia. Inventory them across source, build artefacts, and packaged binaries, then assign ownership, expiry, and rotation rules. The key control is making sure a leaked mobile secret can be invalidated quickly without waiting for an app release cycle.
Q: Why do embedded mobile secrets create such a large security risk?
A: Because once a binary is distributed, attackers can reverse engineer it, inspect memory, and extract values that were never meant to be public. A single exposed API key or token can unlock backend services, paid APIs, or private repositories, turning one release mistake into broader access abuse.
Q: What do teams get wrong about app obfuscation and secret protection?
A: They often assume obfuscation can compensate for poor secret handling. In practice, obfuscation only raises the cost of extraction. It does not remove the secret, revoke it, or prevent misuse if the credential is valid. That is why scanning, minimisation, and revocation must sit alongside protection.
Q: How do I know if mobile secret controls are actually working?
A: Look for three signals: fewer secrets in release builds, faster revocation of any leaked credential, and lower dependence on client-side keys in production. If app packages still contain live tokens or build exceptions never expire, the control is failing even if no incident has occurred yet.
Technical breakdown
Why hardcoded secrets keep appearing in mobile binaries
Hardcoded secrets enter mobile apps in two broad ways. Some are intentionally embedded because the app needs to call external services, such as maps or payment APIs, but the safer pattern is usually to move that trust boundary to the backend. Others arrive accidentally through test credentials, build scripts, bundled config files, or third-party SDKs. Once compiled into an APK or IPA, those values are effectively public because reverse engineering, memory inspection, and instrumentation are routine attacker techniques.
Practical implication: treat every on-device secret as a release risk and require explicit approval for any exception.
How scanning finds secrets that developers miss
Static secret scanning unpacks the application, extracts strings and code paths, and looks for indicators such as API keys, JWTs, and cryptographic material. The article’s research point is that scanners now need to go beyond regex matching because attackers and AI tools can identify intent, context, and obfuscated values. That matters for governance because a secret that is not detected before release becomes a live credential problem, not a coding defect.
Practical implication: scan compiled artifacts in CI/CD, not just source repositories.
Why protection is different from scanning
Protection controls do not remove secrets. Instead, they raise the cost of extraction and misuse by combining obfuscation, secure storage, runtime integrity checks, and backend restrictions. This is useful when a client-side secret is unavoidable, but it should be seen as blast-radius reduction, not as a substitute for secret elimination. In identity terms, the control objective is to reduce extractability and limit the credential’s usable scope, lifespan, and runtime exposure.
Practical implication: pair any unavoidable embedded secret with tight scope, short lifetime, and monitoring.
Threat narrative
Attacker objective: The attacker’s objective is to turn embedded mobile secrets into access to backend systems, private repositories, or paid services.
- Entry occurs when attackers obtain a shipped mobile binary or app store package and inspect it for embedded secrets.
- Escalation follows when a leaked API key, OAuth token, or repository credential is used to access backend services or private code.
- Impact is credential abuse at scale, including unauthorized data access, service misuse, or downstream supply chain exposure.
NHI Mgmt Group analysis
Mobile app secrets are a non-human identity governance issue as much as an AppSec issue. API keys, OAuth tokens, and embedded service credentials behave like production identities once they ship in a binary. That means lifecycle, scope, and revocation matter more than whether the secret was discovered by a developer or an attacker. The practical conclusion is that mobile security teams should manage embedded secrets as governed identities, not incidental strings.
Scanning and protection solve different failures in the same pipeline. Scanning addresses release hygiene by catching accidental leakage before distribution, while protection addresses post-release extractability and tampering. The article shows why one without the other leaves a gap. If a secret should never exist on-device, scanning is the control. If it must exist, protection is the control that limits damage.
AI-assisted discovery changes the economics of secret hunting. The shift from regex to LLM-assisted analysis means obfuscation alone is no longer a reliable barrier. Attackers can mine context, not just pattern matches, which expands the set of secrets at risk across Android and iOS builds. For practitioners, this reinforces the need for secure-by-design architecture rather than relying on binary hardening after the fact.
The mobile app attack surface now includes release artefacts, not just runtime behaviour. Source control, build scripts, package contents, and bundled configuration files all become identity-adjacent exposure points when they carry credentials. That widens governance responsibilities across engineering, security, and platform teams. The practitioner takeaway is to treat the release pipeline as part of the credential perimeter.
What this signals
Secret sprawl is now a lifecycle problem across build, release, and runtime. Mobile teams that only test source code will miss the credentials that appear in packaged artefacts, third-party SDKs, and release scripts. The practical shift is toward continuous artefact scanning, tighter exception handling, and secret revocation that is tied to release events rather than incident aftermath.
The programme signal is that embedded credentials should be managed as temporary, monitored access paths. That aligns with the wider identity control logic in the OWASP Non-Human Identity Top 10 and with access governance principles in the NIST Cybersecurity Framework 2.0. If your mobile estate still depends on durable client secrets, the governance model is already behind the threat.
For practitioners
- Scan compiled mobile artifacts in CI/CD Run secret detection against APK and IPA outputs on every build, not just against source repositories. Include package contents, scripts, and bundled configuration files so release artefacts are validated before distribution.
- Eliminate embedded secrets wherever possible Move authentication and API calls behind backend-issued tokens or server-side mediation so the client does not carry reusable credentials. Where a client-side secret is unavoidable, document the exception and assign an expiry date.
- Limit the blast radius of unavoidable keys Constrain each credential with the narrowest possible scope, rate limits, origin restrictions, and usage monitoring. Combine that with revocation playbooks so exposed secrets can be disabled quickly once leakage is suspected.
- Add runtime protection for high-risk apps Use obfuscation, secure storage, and runtime integrity checks together so reverse engineering, hooking, and memory inspection are harder to use for secret extraction. Protection should slow attackers, not replace secret governance.
Key takeaways
- Mobile apps still ship live credentials, and once they do, attackers can treat the binary as a credential store.
- Scanning and protection are complementary controls, not substitutes, because they address different stages of secret exposure.
- Practitioners should reduce on-device trust, scan release artefacts continuously, and make revocation part of the mobile build lifecycle.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-03 | The article centers on secret sprawl, rotation, and extractability risks. |
| NIST CSF 2.0 | PR.AC-1 | Mobile secrets expose access pathways that need lifecycle governance. |
| NIST SP 800-53 Rev 5 | IA-5 | The article emphasizes authentication material management and rotation. |
| MITRE ATT&CK | TA0006 , Credential Access; TA0010 , Exfiltration | The threat pattern is secret discovery followed by credential abuse and data access. |
| CIS Controls v8 | CIS-5 , Account Management | Embedded credentials behave like unmanaged accounts with uncontrolled lifecycle. |
Map secret-extraction scenarios to TA0006 and TA0010 to prioritise detection and revocation controls.
Key terms
- Hardcoded Secret: A hardcoded secret is a credential written directly into source code, scripts, configuration files, or build assets. It is convenient for development but dangerous in production because it can be copied, indexed, propagated, and reused outside the intended control boundary.
- Runtime Integrity: Runtime integrity is the assurance that what a system executes matches what defenders expect at the moment of execution. It matters because malware or exploit code can change memory, cache, or process behaviour without changing the on-disk file, which makes artifact-based checks incomplete on their own.
- Secrets Sprawl: The uncontrolled proliferation of sensitive credentials — API keys, tokens, passwords, certificates — across codebases, cloud environments, CI/CD pipelines, and configuration files. In 2024, over 50 million leaked secrets were found on the dark web.
What's in the full article
Guardsquare's full analysis covers the operational detail this post intentionally leaves for the source:
- Step-by-step guidance on integrating secret scanning into mobile CI/CD pipelines and release checks.
- Operational detail on obfuscation, runtime integrity, and secure storage choices for Android and iOS apps.
- Examples of how to limit the blast radius of unavoidable client-side keys through scope and monitoring.
- Practical recommendations for handling false positives, release exceptions, and rotation workflows.
Deepen your knowledge
The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, secrets management, and identity lifecycle control. It helps security and identity teams build durable controls for programmes that must manage credentials across cloud, software, and mobile environments.
Published by the NHIMG editorial team on August 19, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org