🎄 Join our Annual Holiday wargame and win prizes!


Hardcoded Credentials

Hardcoding secrets such as API keys, encryption keys, or sensitive credentials in mobile apps is a critical security risk because attackers can decompile or reverse-engineer the app to extract these secrets, even if obfuscated. This exposure can lead to unauthorised access to backend services, data breaches, and compromise of the app's integrity. Mobile apps operate in untrusted environments where users have full control over the device, making it unsafe to embed sensitive information.

Remediation

  • Fetch secrets securely at runtime from a trusted remote server after authenticating the app or user.
  • Use runtime integrity checks to detect rooted/jailbroken devices or debugging tools.
  • Use short-lived tokens that regularly refresh, minimising the impact of a leaked secret.

Metadata

  • Severity: medium
  • Slug: hardcoded-credentials

OWASP

  • M1:2024: Improper Credential Usage

Available Labs

Select a language to explore available labs for this vulnerability.

Deco line
Deco line

Play AppSec WarGames

Want to skill-up in secure coding and AppSec? Try SecDim Wargames to learn how to find, hack and fix security vulnerabilities inspired by real-world incidents.

Deco line
Deco line

Got a comment?

Join our secure coding and AppSec community. A discussion board to share and discuss all aspects of secure programming, AppSec, DevSecOps, fuzzing, cloudsec, AIsec code review, and more.

Read more