DevOps.com

Where the world meets DevOps

  • Latest
    • Articles
    • Features
    • Most Read
    • News
    • News Releases
  • Topics
    • AI
    • Continuous Delivery
    • Continuous Testing
    • Cloud
    • Culture
    • DevSecOps
    • Enterprise DevOps
    • Leadership Suite
    • DevOps Practice
    • ROELBOB
    • DevOps Toolbox
    • IT as Code
  • DevOps Chats
  • Webinars
    • Upcoming
    • On-Demand Webinars
  • Library
  • Events
    • Virtual Summits
    • Conferences
  • Sponsored Communities
    • CloudBees
    • IT as Code
  • Related Sites
    • MediaOps
    • Container Journal
    • Security Boulevard
    • SweetCode.io
    • Digital Anarchist
    • DevOps TV on YouTube
    • DevOps Chat on SoundCloud
    • DevOps Connect
    • DevOps Dozen
  • Media Kit
  • Follow Us
    • Twitter
    • Google News
    • LinkedIn
    • Facebook
    • DevOps TV on YouTube
    • Email
MENUMENU
  • AI
    • Better CX with AIOps

      Build Better CX Across the Entire User Journey with AIOps

      Putting Customer Communication at the Core of New Apps

      Putting Customer Communication at the Core of New Apps

      AIoT and Intelligence on the Edge

      AIoT and Intelligence on the Edge

      Threading the Needle on Kubernetes Complexity with AI-Powered Observability

      Threading the Needle on Kubernetes Complexity with AI-Powered Observability

      Enterprise AI Books to Read This Spring

      Enterprise AI Books to Read This Spring

  • Cloud
    • JFrog DevOps

      JFrog Makes Free DevOps Resources Available for COVID-19 Projects

      Scalyr

      Scalyr Alters Log Analytics Economics

      APM and Application Stability: Where Two Monitoring Roads Merge and Diverge

      APM and Application Stability: Where Two Monitoring Roads Merge and Diverge

      Google CloudBees

      Google Names CloudBees App Dev Partner of the Year

      Scalyr

      Sysdig Extends Cloud Monitoring Alliance With IBM

  • Continuous Delivery
    • CD Foundation

      CD Foundation Serves Up Tekton Pipelines Beta

      GitLab open source

      GitLab Shifts 18 Features Into Core Open Source Platform

      CircleCI DevOps

      CircleCI Surfaces More DevOps Insights

      SignalFX

      OverOps Allies With SonarQube To Improve Application Quality

      managed DevOps

      2nd Watch Allies With GitLab for Managed DevOps Service

  • Continuous Testing
    • Shift-Right Testing: The Emergence of TestOps

      Shift-Right Testing: The Emergence of TestOps

      What Developers Should Take Away from the Iowa Caucus App Debacle

      What Developers Should Take Away from the Iowa Caucus App Debacle

      survey testing

      Survey Sees Little Progress in Drive to Shift Testing Left

      DevOps Software Testing

      DevOps Places Software Testing in the Crosshairs

      testing

      DevOps Chats: Enterprise Continuous Testing With a Shift-Right Mindset

  • DevSecOps
    • Top iOS Security

      Top iOS Security Gotchas

      ClickShare Vulnerabilities

      ClickShare Vulnerabilities May Have Been Patched, But They Mask a Much Bigger Problem

      2020 DevSecOps Community Survey: Of 5,045 Developers, Guess How Many Are Happy?

      2020 DevSecOps Community Survey: Of 5,045 Developers, Guess How Many Are Happy?

      vault

      HashiCorp Strengthens Vault Secrets Management

      Palo Alto Networks

      Palo Alto Networks Advances DevSecOps in the Cloud

  • Leadership Suite
    • Digital Resiliency Wins

      The Way Forward: Digital Resiliency Wins

      Software delivery metrics

      Is It Time to End the Software Metric Madness?

      DevOps Institute

      DevOps Institute Cert Exams Now Available for Open Testing

      Coronavirus Economic Shutdown: Analysts Hit the Brakes on Global IT Spending Estimates

      Coronavirus Economic Shutdown: Analysts Hit the Brakes on Global IT Spending Estimates

      Digital Transformation Efforts Hindered by Lack of Upskilling

      Digital Transformation Efforts Hindered by Lack of Upskilling

  • Practices
    • Open Source Vulnerabilities

      Open Source Vulnerabilities Were Up 50% in 2019 — How Will It Impact Software Development in 2020?

      Top iOS Security

      Top iOS Security Gotchas

      DevOps - Open Source Logging

      Why DevOps are Keen on Open Source Logging

      TechStrong TV

      TechStrong TV: Celebrating the Strength of the Tech Community

      Keys to the Kingdom: Protect Your Server from Hackers

      Keys to the Kingdom: Protect Your Server from Hackers

  • ROELBOB
    • excuses

      Root Cause

      archived

      Archived

      scales

      Scales

      seo-optimization

      SEO Optimization

      figments-of-imagination

      Figments of Imagination

  • Toolbox
    • GitHub private repositories

      GitHub Makes Private Repositories Free for Unlimited Users

      GitLab GitHub

      GitLab Responds To GitHub Making Teams Free – We All Win

      Copado

      Copado Launches DevOps COVID-19 Initiative

      CircleCI DevOps

      CircleCI Surfaces More DevOps Insights

      compuware mainframe

      Compuware Shifts Mainframe App Testing Left

  • IT as Code
  • More Topics
    • Application Performance Management/Monitoring
    • Culture
    • Enterprise DevOps

Home » Blogs » DevOps Practice » Top iOS Security Gotchas

Top iOS Security

Top iOS Security Gotchas

Phillip TennenBy Phillip Tennen on April 20, 2020 1 Comment

Ensuring the security of user data within your app is critical to building trust in your business and contributing to the online safety of customers.

Related Posts
  • Developing Apps for IOS 13: Things to Consider
  • A Guide to Public Cloud Security Tools
  • What approach to application hardening is right for your organization?
    Related Categories
  • Blogs
  • DevOps Practice
  • DevSecOps
    Related Topics
  • APIs
  • app security
  • App Transport Security
  • Apple
  • data protection
  • iOS security
  • NSSecureCoding
  • PII
  • SDK
Show more
Show less

Here’s a list of the top 10 essential security mechanisms that Apple offers to up the security posture of your iOS applications. Adopting these technologies and APIs within your products is an effective step toward writing more secure applications, giving you a lower risk of potential data compromise and increased confidence in your security posture.

Opting Out of System Data Protection

iOS provides the data protection setting, a robust way to automatically encrypt any files created by your app. This is an important security setting, however, it is turned off by default and many developers never enable it. Leveraging the system’s data protection mechanism is an easy win for increasing the security of user data within your app.

Transmitting Data Over Insecure Connections

It’s critical to ensure that any data-in-flight is transmitted over secure connections. By using encrypted HTTPS connections for all apps’ network activities, a wide variety of data-in-flight compromises are mitigated. Additionally, organizations are recommended to leverage SSL pinning for maximum transport-layer security.

Deserialization Fails

The default protocol to serialize and deserialize data on iOS, NSCoding, is vulnerable to object substitution attacks, which could potentially allow an attacker to gain remote code execution. Apple offers a near drop-in replacement, NSSecureCoding, which is not vulnerable to this attack. To convert a serialized class to use the NSSecureCoding mechanism, Apple has outlined steps in its documentation. Making the recommended changes allows the system to enforce safe deserialization.

Opting Out of App Transport Security

App Transport Security (ATS) is a mechanism provided by Apple to mediate all network connections made by the app and validate that data is being transmitted securely. Opting out of ATS by use of NSAllowArbitraryLoads, or similar exemptions, is an easy way to shoot yourself in the foot and turn off a powerful security mechanism.

Cryptography API Misuse

Encrypting user’s data is a no-brainer, but care must be taken to ensure that it’s done in a cryptographically secure way. Some system APIs, such as CommonCrypto, are easy to misuse. This results in the illusion of security, while still allowing an attack vector for user data to be compromised. Be sure to use these APIs with secure options, and never statically embed encryption keys or use an encryption key which is trivially derived.

Leaking PII to NSUserDefaults

When handling personally identifiable information (PII) within an app, it can be tempting to store it in a convenient and straightforward way, such as using an NSUserDefaults entry. However, this approach allows any other app on the device to read this potentially sensitive data. Sensitive data, especially identifiable user information, should always be stored in a secure location, such as the device’s keychain, and encrypted when necessary.

Unsafe Keychain Usage

While the keychain is the most secure store of data on the Apple device, developers must still take care to ensure they’re using it correctly. It’s possible for developers to save data to the keychain in such a way that the data is always unencrypted and accessible, even when the device is locked and data would otherwise be encrypted. When saving sensitive data to the keychain, ensure that you’re using the strongest possible data-protection settings to maximize security.

Wherever possible, utilize “kSecAttrAccessibleWhenUnlocked,” the strongest protection class, when saving items in the keychain. This protection class tells the system that data should be encrypted when the user is not actively using your application. If your app needs to access this data while running in the background, you may need to fall back on the “kSecAttrAccessibleAfterFirstUnlock” protection class, which ensures the data is encrypted only until the user has unlocked the device after boot.

Embedding Vulnerable SDKs

When an SDK is linked into your application, you’re also implicitly exposing your app to any potential vulnerabilities in the SDK. Compromised SDKs have led to a variety of mobile app attacks, such as a vulnerable AFNetworking version leading to data compromised through a MitM attack. Without a security audit of the SDKs used within the app, developers are blind to the potential vulnerabilities they are introducing.

Allowing Third Party Keyboards on Sensitive Input Fields

While installing third party keyboards are useful for user customization, they introduce a new vector for data leakage. This is because the developer of a third party keyboard may be able to extract any information typed on the keyboard. As a result, it’s in the user’s best interest to disable these keyboards when handling sensitive data, such as identifiable information or credit card numbers.

Leaking PII to Device Logs

It’s all too easy to leave debug logging, which may include PII, in production builds. Before release, validate that any log statements which might include sensitive data are scrubbed from the code. This might be achieved by way of flags, which only enable these log statements in debug builds. Since logs may be visible to anyone with physical access to the device, it’s paramount to exclude sensitive data from them.

Since adopting the newest technologies often introduces unforeseen risks, defensive security is a constant endeavor. However, following these top 10 tips will increase your organization’s security posture and reduce vulnerabilities introduced by iOS risks.

Filed Under: Blogs, DevOps Practice, DevSecOps Tagged With: APIs, app security, App Transport Security, Apple, data protection, iOS security, NSSecureCoding, PII, SDK

  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • More
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Tumblr (Opens in new window)

Like this:

Like Loading...
Sponsored Content
Featured eBook
The 101 of Continuous Software Delivery

The 101 of Continuous Software Delivery

Now, more than ever, companies who rapidly react to changing market conditions and customer behavior will have a competitive edge.  Innovation-driven response is successful not only when a company has new ideas, but also when the software needed to implement them is delivered quickly. Companies who have weathered recent events ... Read More
« Why DevOps are Keen on Open Source Logging
Accelerating IoT by Switching Gears to 5G »

TechStrong TV – Live Streaming

TechStrong TV - All Episodes

Top Stories of the Week

  • View DevOps.com Privacy Policy

Upcoming Webinars

Mon 20

Automating Security Beyond the Perimeter of Cloud Native Apps

Mon, April 20, 1:00 pm - 2:00 pm EDT
Tue 21

DevOps Patterns & Antipatterns for Continuous Software Updates

Tue, April 21, 11:00 am - 12:00 pm EDT
Tue 21

How Uber Reduced AWS Costs 15% in 30 Days

Tue, April 21, 1:00 pm - 2:00 pm EDT

More Webinars

Past Webinars

Latest from DevOps.com

Open Source Vulnerabilities Were Up 50% in 2019 — How Will I...
April 20, 2020 | Jeffrey Martin
The Way Forward: Digital Resiliency Wins
April 20, 2020 | George V. Hulme
Accelerating IoT by Switching Gears to 5G
April 20, 2020 | Sridhar Asvathanarayanan
Top iOS Security Gotchas
April 20, 2020 | Phillip Tennen
Why DevOps are Keen on Open Source Logging
April 20, 2020 | Ariel Assaraf

Most Read on DevOps.com

In IT, Purity Is Not Necessarily a Virtue
April 14, 2020 | Don Macvittie
Is It Time to End the Software Metric Madness?
April 16, 2020 | Brendan Hayes
GitLab Responds To GitHub Making Teams Free – We All W...
April 15, 2020 | Alan Shimel
Splunk Adds Remote Workforce Metrics Dashboard
April 13, 2020 | Mike Vizard
DevOps Chats: DevSecOps and OpenShift, with Red Hat
April 14, 2020 | Alan Shimel

On-Demand Webinars

DevOps.com Webinar ReplaysDevOps.com Webinar Replays

Download Free eBook

Hybrid Cloud Security 101
New call-to-action
  • Home
  • About DevOps.com
  • Meet our Authors
  • Write for DevOps.com
  • Business Directory
  • Media Kit
  • Sponsor Info
  • Copyright
  • TOS
  • Privacy Policy

© 2020 ·MediaOps Inc.All rights reserved.

FLASH POLL - Reasons You Prefer Working From Home After COVID-19
Vote. See the results instantly!
See the results of prior Flash Polls. Research provided by Accelerated Strategies Group. (20-135522)