Android and iOS

Secrets embedded in mobile applications

Code tampering, account abuse, data exposure and client manipulation.

Threats and abuse1 min readEditorial methods

A publicly distributed application is not a secure vault for a shared secret. Obfuscation can increase analysis cost, but the confidentiality of an embedded long-lived key cannot be a permanent trust foundation.

Evaluation approach

Keep server secrets on the backend and give clients only the scope and lifetime they need. Device-specific keys and keys shared by all users carry different risks.

Application example

Assume an embedded third-party service key can be extracted, then prepare abuse limits and a revocation plan.

Limits and considerations

String encryption does not mean a value used during execution can never be recovered.

A distributed application is not a secret vault

Putting the same highly privileged server secret in every distributed package creates a broad exposure. String encryption or obfuscation may increase extraction cost without fixing the key's authority or lifecycle.

Meet client needs through narrowly scoped, revocable access where possible. Know which applications and services a shared-secret leak would affect. Rotation must not depend exclusively on waiting for the next mobile release.

Checks and decisions

  • Remove shared secrets
  • Rotate keys
  • Restrict authority

Do not indefinitely postpone secret-management problems by adding more elaborate client-side hiding code.

Sources

The primary references above provide the technical basis. Example workflows and evaluation suggestions are this publication’s explanations, not independent test results for a particular product.