iOS App Pentesting and Security with Real-World Case Studies Part 2
Two iOS apps embedded sensitive credentials in their code: a payment API key and an SSH private key for a cloud backend. An attacker who obtained the app could extract these secrets and use them to access the payment provider or the backend infrastructure, potentially performing unauthorised transactions or reading customer data.
Published on cobalt.io
Welcome to our ongoing blog series on iOS App Penetration Testing and Security, where we explore real-world case studies to better understand the challenges and vulnerabilities in today's iOS applications. In the previous blog, we delved into the risks posed by URL Schemes and the security concerns arising from using…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, developers embedded sensitive credentials (API keys, private keys) directly in the app's code or configuration files instead of storing them securely on a server.
Impact
An attacker could gain unauthorised access to a payment provider to perform fake payments, refunds, and view transaction history, or access a cloud backend to read customer names, addresses, shopping lists, and payment methods.
What the attacker needed
Ability to download the app; reverse engineering tools
The fix
Sensitive information should not be hardcoded in the app; instead, use secure storage, secret management services, and limit the scope of API keys.
How it was found
- Download the iOS app and decrypt it using reverse engineering tools.
- Unzip the iOS application and examine the source code using a disassembler.
- Discover hardcoded API key or private key in configuration files.
- Use the key to access the third-party payment provider or establish an SSH connection to the backend.
- Perform actions such as fake payments, refunds, or access sensitive data.
- Create a proof of concept and report findings.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When developers build a mobile app, they sometimes put secret passwords or keys directly into the app's files. Anyone who downloads the app can open it up and find those secrets, then use them to break into the systems they protect. This is like hiding a house key under the doormat: it is easy to find if you know where to look.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.