SlideShare a Scribd company logo
Enhancing API
Security with
Runtime
Secrets &
Attestation
PRESENTED BY: Ted Miracco
2
Ted: Defense Electronics -> RF/Microwave CAE -> Electronic Design
Automation -> Anti-Piracy Technology -> Mobile App & API Security
Skip: Chip Design -> Reconfigurable Computing -> HW/SW ->
Embedded & Crypto Acceleration -> Mobile and API Security
approov.io
tedmiracco skiphovsmith
3
Outline
● Mobile Attack Surfaces
● Hiding API Secrets in App
● Moving Secrets Off Device
● App Attestation
● Summary & Next Steps
4
5 Mobile Attack Surfaces
● Attackers can use their
devices, emulators,
environments
for reconnaissance
● Better reconnaissance,
the more profitable
attacks
5
Danger - Hardcoded API Keys
● In the Headlines…
○ Automotive
○ Retail
○ Fintech
6
Attack: Static Analysis
● Search for high-entropy strings
● Use static analysis tools like
MobSF, JADX, AndroGuard
● Keys could be constants,
resources, or inside NDK
● Surprising how often this yields
results
7
Recently Published “Secrets Report”
● Looked at the top 200
Financial Apps - Sensor Tower
● Downloaded the APKs
● Performed Static Analysis
○ apk_api_key_extractor
○ Git Leaks
○ Trufflehog
● Categorized the Findings
● Grouped the Results by
Application Type and Country
8
Key Findings
9
Report Findings - By Country
1
0
Findings by Industry
Secrets
Hide &
Seek
1
2
Initial Defense: Obfuscation
● Obscure hardcoded secrets,
program flow, and security
code
● Use R8, ProGuard, or others
● Trade obscurity vs run time cost
● If a secret is valuable enough, it
may be reverse engineered
1
3
Attack: Run in Debugger
● Though secret is hidden in
code, it's still exposed in the
run time, go after it there
● Analyze code flow and call
signatures to identify values
exposed at run time
● Replace key functional blocks
1
4
Defense: Run Time Checking
● Block running in debugger and emulator
● See https://github.com/scottyab/rootbeer,
for simple approach
● Adds more functionality to protect and to
be protected
● Attacks evolve over time, do detection
tools keep pace?
1
5
Defense: Play Integrity
● Stronger form of run time
checking which guards
against rooting, tampering,
and repackaging
● Requires Google Play services
● Time and quotas may limit use
● Note that the verdict is evaluated off device
1
6
Attack: Manipulator in the Middle
● Pivot to the channel
● Manipulator pollutes the
device trust store and spoofs
the service identity.
● Manipulator decrypts and
reads and/or manipulates
credentials and API
calls/responses.
1
7
Defense: Certificate Pinning
● App compares public key
fingerprint of presented and
expected certificates.
● Fingerprint can be specified
statically in the android
manifest file or specified at
networking client
construction.
● Fingerprint is not a secret, but
should be write-protected.
1
8
Attack: Bypass Certificate Pinning
● Add instrumentation frameworks
to hook functions without
tampering
● Objection and Frida can detect
and bypass OkHttp pinning
● With obfuscation, may need to
search for function call signatures
blog.nviso.eu/2019/04/02/circumventing-
ssl-pinning-in-obfuscated-apps-with-
okhttp/
1
9
Defense: Trust On First Use
● On first launch, your app
requests some primary secrets
● Primary secrets no longer
hardcoded but are placed
in secure storage
● Primary secrets may be used to decrypt other hard coded
secrets
● Assumes app & channel are initially trustworthy and
storage is safe
Store secrets in secure storage
On first launch, request secrets
2
0
Defense: Harden Channel
● Use short-lived JWT Tokens
○ Use API secret to sign JWTs
○ Secret not exposed in channel
● Sign or encrypt API messages
○ Increases anti-tampering or
confidentiality
○ Requires more secrets, time, and
functionality
Moving
Secrets Off
Device
2
2
Hide & Seek Observations
Upsides
● Loading secrets remotely (TOFU) avoids
hardcoding them
● Play Integrity evaluates verdicts off app
● JWTs do not directly expose secrets in the
channel
Downsides
● TOFU requires blind trust
● More protection capabilities mean more
secrets and more functionality to hide
● Frequent code updates are required as
attacks evolve
2
3
Design Objectives
● Keep no secrets in app at rest
(in code or storage)
● Minimize amount of security
functionality in app
○ Measure app and run-time
environment
○ Make security decisions off app
● Provide live updates to both secrets
and security
2
4
Proposed Architecture
Protocol: Request - Measurement - Verdict - API Call - Validation
2
5
Making a 1st Party API Call
If app attests as healthy, a properly-signed token is validated by the
1st party recipes service
2
6
Making a 1st Party API Call
If app attests dirty, an improperly-signed token is rejected by the
recipes service
2
7
Changing the Signing Secret
● Ops team changes secret at the service and the gateway.
● Each app’s next attestation is signed with the new secret.
2
8
Making a 3rd Party API Call
● If app attests clean, the 3rd party API key is passed to the SDK.
● The SDK rewrites the API call to use the API key.
2
9
Changing an API Key
● Ops team changes the 3rd party API Key at the service.
● Each app’s next clean attestation returns the updated API key.
3
0
Managing Certificate Pinning
● Ops team changes certificate at the app auth service
● The next attestation updates the certificate, and the SDK generates a
new certificate-pinning client
3
1
Signing a Message
● If app attests clean, the message signing key is passed to the SDK.
● The SDK rewrites the API call after signing the message.
3
2
Updating Security Live
Security Posture
● Changing security posture is simply a
change in how measurements are used to
decide the attestation verdict
● Ops team can change security policies at
the app auth service
● Full measurements are still being reported
Security Enhancements
● Cannot update dex code of the app, but
can reconfigure the measurement service
inside the SDK after a clean attestation
Summary
and Next
Steps
3
4
Mobile Application Security
Verification Standard
● Impede Dynamic Analysis and Tampering
○ All detections can be split into measurements and verdicts
○ Detection and response are separated and further protected by
on/off app split (stealthy)
● Device Binding
○ Unique IDs enable different security policies per device and app
● Impede Comprehension
○ Small footprint SDK and auth channel can be rigorously shielded
○ Other portions of an app can be independently obfuscated
● Impede Eavesdropping
○ Certificate pinning and message encryption can be managed off
device
Resilience is strengthened by having secrets never at rest,
splitting measurement from verdict, and live updating:
3
5
API Secrets Exposed
● 23% Financial Applications
Immediately Revealed Secrets
● Code Obfuscation Ineffective
○ 93% with Obfuscation
○ 96% without Obfuscation
● Only 4% Used TLS Certificate
Pinning
● Vulnerabilities exist both at rest
and at runtime
3
6
App Auth as a Service
● Removed secrets in app code
and storage
● Minimized security
vulnerabilities in app by:
○ Measuring conditions in app
○ Deciding security verdicts off app
● Provide live updates to secrets
and security
● Provide live telemetry and
forensics
Thank You
approov.io
ted.miracco@approov.io
skip.hovsmith@approov.io
3
8
Questions
● How expensive is an attestation, and how often should a
running app be re-attested?
● What's the relationship between user authorization and app
attestation/authorization?
● Why is remote attestation better than really strong in-app
self-protection?
3
9
Man-in-the-Middle Attacks
MitM attacks occur when an attacker intercepts or manipulates mobile
device communications to gain access to sensitive information. Apps
were considered protected if pinning is detected in the network config
file and no other red flags are raised. They were rated vulnerable if (1)
user-generated trust anchors were permitted, (2) cleartext traffic its
permitted for non-localhost domains, or (3) Android SDK API level
below 25 is declared in the Android Manifest.

More Related Content

PDF
LF_APIStrat17_OWASP’s Latest Category: API Underprotection
PDF
Owasp masvs spain 17
PDF
Mobile - Your API Security Blindspot by David Stewart, Approov
PDF
2022 APIsecure_Shift Left API Security - The Right Way
PDF
apidays LIVE LONDON - API Abuse - Comprehension and Prevention by David Stewart
PPTX
apidays New York 2025 - Why an SDK is Needed to Protect APIs from Mobile Apps...
PDF
Security in mobile banking apps
PPTX
Security testing of mobile applications
LF_APIStrat17_OWASP’s Latest Category: API Underprotection
Owasp masvs spain 17
Mobile - Your API Security Blindspot by David Stewart, Approov
2022 APIsecure_Shift Left API Security - The Right Way
apidays LIVE LONDON - API Abuse - Comprehension and Prevention by David Stewart
apidays New York 2025 - Why an SDK is Needed to Protect APIs from Mobile Apps...
Security in mobile banking apps
Security testing of mobile applications

Similar to APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, Ted Miracco (Approov) (20)

PDF
Security Checklist: how iOS can help protecting your data.
PPTX
Hacking mobile apps
PPTX
Untitled 1
PDF
SecDevOps for API Security
PPTX
Hacking Mobile Apps
PDF
(ISC)2 Kamprianis - Mobile Security
PDF
CNIT 128 8: Mobile development security
PPTX
apidays LIVE New York 2021 - Playing with FHIR without getting burned by Dav...
PPTX
Standards and methodology for application security assessment
PPTX
Building Secure and Resilient APIs
PDF
App Security and Securing App
PDF
Building a Mobile App Pen Testing Blueprint
PDF
apidays New York 2023 - Putting yourself out there - how to secure your publi...
PPTX
Security Vulnerabilities in Mobile Applications (Kristaps Felzenbergs)
PDF
Certificate Pinning in Mobile Applications
PDF
Is my app secure?
PDF
Is My App Secure ?
PDF
API Security: the full story
PPTX
iOS Security - Secure-iOS-Guidelines - Apple | iOS | Swift
PPTX
19-f15-mobile-security.pptx
Security Checklist: how iOS can help protecting your data.
Hacking mobile apps
Untitled 1
SecDevOps for API Security
Hacking Mobile Apps
(ISC)2 Kamprianis - Mobile Security
CNIT 128 8: Mobile development security
apidays LIVE New York 2021 - Playing with FHIR without getting burned by Dav...
Standards and methodology for application security assessment
Building Secure and Resilient APIs
App Security and Securing App
Building a Mobile App Pen Testing Blueprint
apidays New York 2023 - Putting yourself out there - how to secure your publi...
Security Vulnerabilities in Mobile Applications (Kristaps Felzenbergs)
Certificate Pinning in Mobile Applications
Is my app secure?
Is My App Secure ?
API Security: the full story
iOS Security - Secure-iOS-Guidelines - Apple | iOS | Swift
19-f15-mobile-security.pptx
Ad

More from apidays (20)

PDF
apidays Munich 2025 - The Physics of Requirement Sciences Through Application...
PDF
apidays Munich 2025 - Developer Portals, API Catalogs, and Marketplaces, Miri...
PDF
apidays Munich 2025 - Making Sense of AI-Ready APIs in a Buzzword World, Andr...
PDF
apidays Munich 2025 - Integrate Your APIs into the New AI Marketplace, Senthi...
PDF
apidays Munich 2025 - The Double Life of the API Product Manager, Emmanuel Pa...
PDF
apidays Munich 2025 - Let’s build, debug and test a magic MCP server in Postm...
PDF
apidays Munich 2025 - The life-changing magic of great API docs, Jens Fischer...
PDF
apidays Munich 2025 - Automating Operations Without Reinventing the Wheel, Ma...
PDF
apidays Munich 2025 - Geospatial Artificial Intelligence (GeoAI) with OGC API...
PPTX
apidays Munich 2025 - GraphQL 101: I won't REST, until you GraphQL, Surbhi Si...
PPTX
apidays Munich 2025 - Effectively incorporating API Security into the overall...
PPTX
apidays Munich 2025 - Federated API Management and Governance, Vince Baker (D...
PPTX
apidays Munich 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (Aavista Oy)
PPTX
apidays Munich 2025 - Streamline & Secure LLM Traffic with APISIX AI Gateway ...
PPTX
apidays Munich 2025 - Building Telco-Aware Apps with Open Gateway APIs, Subhr...
PPTX
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
PDF
apidays Helsinki & North 2025 - REST in Peace? Hunting the Dominant Design fo...
PDF
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
PDF
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
PDF
apidays Helsinki & North 2025 - APIs in the healthcare sector: hospitals inte...
apidays Munich 2025 - The Physics of Requirement Sciences Through Application...
apidays Munich 2025 - Developer Portals, API Catalogs, and Marketplaces, Miri...
apidays Munich 2025 - Making Sense of AI-Ready APIs in a Buzzword World, Andr...
apidays Munich 2025 - Integrate Your APIs into the New AI Marketplace, Senthi...
apidays Munich 2025 - The Double Life of the API Product Manager, Emmanuel Pa...
apidays Munich 2025 - Let’s build, debug and test a magic MCP server in Postm...
apidays Munich 2025 - The life-changing magic of great API docs, Jens Fischer...
apidays Munich 2025 - Automating Operations Without Reinventing the Wheel, Ma...
apidays Munich 2025 - Geospatial Artificial Intelligence (GeoAI) with OGC API...
apidays Munich 2025 - GraphQL 101: I won't REST, until you GraphQL, Surbhi Si...
apidays Munich 2025 - Effectively incorporating API Security into the overall...
apidays Munich 2025 - Federated API Management and Governance, Vince Baker (D...
apidays Munich 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (Aavista Oy)
apidays Munich 2025 - Streamline & Secure LLM Traffic with APISIX AI Gateway ...
apidays Munich 2025 - Building Telco-Aware Apps with Open Gateway APIs, Subhr...
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
apidays Helsinki & North 2025 - REST in Peace? Hunting the Dominant Design fo...
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays Helsinki & North 2025 - APIs in the healthcare sector: hospitals inte...
Ad

Recently uploaded (20)

PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PPTX
innovation process that make everything different.pptx
PPTX
Internet___Basics___Styled_ presentation
DOCX
Unit-3 cyber security network security of internet system
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PPTX
artificial intelligence overview of it and more
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPT
tcp ip networks nd ip layering assotred slides
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PDF
Introduction to the IoT system, how the IoT system works
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
innovation process that make everything different.pptx
Internet___Basics___Styled_ presentation
Unit-3 cyber security network security of internet system
RPKI Status Update, presented by Makito Lay at IDNOG 10
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
WebRTC in SignalWire - troubleshooting media negotiation
artificial intelligence overview of it and more
introduction about ICD -10 & ICD-11 ppt.pptx
tcp ip networks nd ip layering assotred slides
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Power Point - Lesson 3_2.pptx grad school presentation
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Decoding a Decade: 10 Years of Applied CTI Discipline
Unit-1 introduction to cyber security discuss about how to secure a system
SASE Traffic Flow - ZTNA Connector-1.pdf
PptxGenJS_Demo_Chart_20250317130215833.pptx
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Introduction to the IoT system, how the IoT system works

APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, Ted Miracco (Approov)

  • 1. Enhancing API Security with Runtime Secrets & Attestation PRESENTED BY: Ted Miracco
  • 2. 2 Ted: Defense Electronics -> RF/Microwave CAE -> Electronic Design Automation -> Anti-Piracy Technology -> Mobile App & API Security Skip: Chip Design -> Reconfigurable Computing -> HW/SW -> Embedded & Crypto Acceleration -> Mobile and API Security approov.io tedmiracco skiphovsmith
  • 3. 3 Outline ● Mobile Attack Surfaces ● Hiding API Secrets in App ● Moving Secrets Off Device ● App Attestation ● Summary & Next Steps
  • 4. 4 5 Mobile Attack Surfaces ● Attackers can use their devices, emulators, environments for reconnaissance ● Better reconnaissance, the more profitable attacks
  • 5. 5 Danger - Hardcoded API Keys ● In the Headlines… ○ Automotive ○ Retail ○ Fintech
  • 6. 6 Attack: Static Analysis ● Search for high-entropy strings ● Use static analysis tools like MobSF, JADX, AndroGuard ● Keys could be constants, resources, or inside NDK ● Surprising how often this yields results
  • 7. 7 Recently Published “Secrets Report” ● Looked at the top 200 Financial Apps - Sensor Tower ● Downloaded the APKs ● Performed Static Analysis ○ apk_api_key_extractor ○ Git Leaks ○ Trufflehog ● Categorized the Findings ● Grouped the Results by Application Type and Country
  • 9. 9 Report Findings - By Country
  • 12. 1 2 Initial Defense: Obfuscation ● Obscure hardcoded secrets, program flow, and security code ● Use R8, ProGuard, or others ● Trade obscurity vs run time cost ● If a secret is valuable enough, it may be reverse engineered
  • 13. 1 3 Attack: Run in Debugger ● Though secret is hidden in code, it's still exposed in the run time, go after it there ● Analyze code flow and call signatures to identify values exposed at run time ● Replace key functional blocks
  • 14. 1 4 Defense: Run Time Checking ● Block running in debugger and emulator ● See https://github.com/scottyab/rootbeer, for simple approach ● Adds more functionality to protect and to be protected ● Attacks evolve over time, do detection tools keep pace?
  • 15. 1 5 Defense: Play Integrity ● Stronger form of run time checking which guards against rooting, tampering, and repackaging ● Requires Google Play services ● Time and quotas may limit use ● Note that the verdict is evaluated off device
  • 16. 1 6 Attack: Manipulator in the Middle ● Pivot to the channel ● Manipulator pollutes the device trust store and spoofs the service identity. ● Manipulator decrypts and reads and/or manipulates credentials and API calls/responses.
  • 17. 1 7 Defense: Certificate Pinning ● App compares public key fingerprint of presented and expected certificates. ● Fingerprint can be specified statically in the android manifest file or specified at networking client construction. ● Fingerprint is not a secret, but should be write-protected.
  • 18. 1 8 Attack: Bypass Certificate Pinning ● Add instrumentation frameworks to hook functions without tampering ● Objection and Frida can detect and bypass OkHttp pinning ● With obfuscation, may need to search for function call signatures blog.nviso.eu/2019/04/02/circumventing- ssl-pinning-in-obfuscated-apps-with- okhttp/
  • 19. 1 9 Defense: Trust On First Use ● On first launch, your app requests some primary secrets ● Primary secrets no longer hardcoded but are placed in secure storage ● Primary secrets may be used to decrypt other hard coded secrets ● Assumes app & channel are initially trustworthy and storage is safe Store secrets in secure storage On first launch, request secrets
  • 20. 2 0 Defense: Harden Channel ● Use short-lived JWT Tokens ○ Use API secret to sign JWTs ○ Secret not exposed in channel ● Sign or encrypt API messages ○ Increases anti-tampering or confidentiality ○ Requires more secrets, time, and functionality
  • 22. 2 2 Hide & Seek Observations Upsides ● Loading secrets remotely (TOFU) avoids hardcoding them ● Play Integrity evaluates verdicts off app ● JWTs do not directly expose secrets in the channel Downsides ● TOFU requires blind trust ● More protection capabilities mean more secrets and more functionality to hide ● Frequent code updates are required as attacks evolve
  • 23. 2 3 Design Objectives ● Keep no secrets in app at rest (in code or storage) ● Minimize amount of security functionality in app ○ Measure app and run-time environment ○ Make security decisions off app ● Provide live updates to both secrets and security
  • 24. 2 4 Proposed Architecture Protocol: Request - Measurement - Verdict - API Call - Validation
  • 25. 2 5 Making a 1st Party API Call If app attests as healthy, a properly-signed token is validated by the 1st party recipes service
  • 26. 2 6 Making a 1st Party API Call If app attests dirty, an improperly-signed token is rejected by the recipes service
  • 27. 2 7 Changing the Signing Secret ● Ops team changes secret at the service and the gateway. ● Each app’s next attestation is signed with the new secret.
  • 28. 2 8 Making a 3rd Party API Call ● If app attests clean, the 3rd party API key is passed to the SDK. ● The SDK rewrites the API call to use the API key.
  • 29. 2 9 Changing an API Key ● Ops team changes the 3rd party API Key at the service. ● Each app’s next clean attestation returns the updated API key.
  • 30. 3 0 Managing Certificate Pinning ● Ops team changes certificate at the app auth service ● The next attestation updates the certificate, and the SDK generates a new certificate-pinning client
  • 31. 3 1 Signing a Message ● If app attests clean, the message signing key is passed to the SDK. ● The SDK rewrites the API call after signing the message.
  • 32. 3 2 Updating Security Live Security Posture ● Changing security posture is simply a change in how measurements are used to decide the attestation verdict ● Ops team can change security policies at the app auth service ● Full measurements are still being reported Security Enhancements ● Cannot update dex code of the app, but can reconfigure the measurement service inside the SDK after a clean attestation
  • 34. 3 4 Mobile Application Security Verification Standard ● Impede Dynamic Analysis and Tampering ○ All detections can be split into measurements and verdicts ○ Detection and response are separated and further protected by on/off app split (stealthy) ● Device Binding ○ Unique IDs enable different security policies per device and app ● Impede Comprehension ○ Small footprint SDK and auth channel can be rigorously shielded ○ Other portions of an app can be independently obfuscated ● Impede Eavesdropping ○ Certificate pinning and message encryption can be managed off device Resilience is strengthened by having secrets never at rest, splitting measurement from verdict, and live updating:
  • 35. 3 5 API Secrets Exposed ● 23% Financial Applications Immediately Revealed Secrets ● Code Obfuscation Ineffective ○ 93% with Obfuscation ○ 96% without Obfuscation ● Only 4% Used TLS Certificate Pinning ● Vulnerabilities exist both at rest and at runtime
  • 36. 3 6 App Auth as a Service ● Removed secrets in app code and storage ● Minimized security vulnerabilities in app by: ○ Measuring conditions in app ○ Deciding security verdicts off app ● Provide live updates to secrets and security ● Provide live telemetry and forensics
  • 38. 3 8 Questions ● How expensive is an attestation, and how often should a running app be re-attested? ● What's the relationship between user authorization and app attestation/authorization? ● Why is remote attestation better than really strong in-app self-protection?
  • 39. 3 9 Man-in-the-Middle Attacks MitM attacks occur when an attacker intercepts or manipulates mobile device communications to gain access to sensitive information. Apps were considered protected if pinning is detected in the network config file and no other red flags are raised. They were rated vulnerable if (1) user-generated trust anchors were permitted, (2) cleartext traffic its permitted for non-localhost domains, or (3) Android SDK API level below 25 is declared in the Android Manifest.