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
    • Pitfalls to Avoid While Building Out Your AI Tools

      6 Common Pitfalls to Avoid While Building Out Your AI Tools

      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

  • Cloud
    • Data fabric_developers

      Data: The Fabric of Developers’ Lives

      Multi-Cloud Cost Optimization

      Multi-Cloud Cost Optimization For The Enterprise

      Self-Service Portal From env0 Reins in Public Cloud Costs

      Self-Service Portal From env0 Reins in Public Cloud Costs

      Data Self-Service Program

      How to Implement a Data Self-Service Program

      JFrog DevOps

      JFrog Makes Free DevOps Resources Available for COVID-19 Projects

  • Continuous Delivery
    • SDM’s Holistic Approach

      How SDM’s Holistic Approach Connects Organizations and Streamlines Delivery Processes

      CD Foundation

      CD Foundation Serves Up Tekton Pipelines Beta

      GitLab Features - Core Open Source Platform

      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

  • Continuous Testing
    • Shift-Right Testing - 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
    • Enterprise Inertia Slowing Down DevSecOps

      Enterprise Inertia Slowing Down DevSecOps Integration

      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

  • Leadership Suite
    • IT budgets

      Despite Downturn, Enterprise IT Budgets Remain Intact

      Employment in the Age of Automation

      Metropolis Now: The Two Worlds of Employment in the Age of Automation

      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

  • Practices
    • Pitfalls to Avoid While Building Out Your AI Tools

      6 Common Pitfalls to Avoid While Building Out Your AI Tools

      DevOps_Value of Organizational Data

      3 Ways DevOps Can Increase the Value of Organizational Data

      Software Testing

      Software Testing: The Comeback Kid of the 2020s

      SDM’s Holistic Approach

      How SDM’s Holistic Approach Connects Organizations and Streamlines Delivery Processes

      Data fabric_developers

      Data: The Fabric of Developers’ Lives

  • ROELBOB
    • system-configuration

      System Configuration

      role-of-bots

      The Role of Bots

      excuses

      Root Cause

      archived

      Archived

      scales

      Scales

  • Toolbox
    • Pulumi

      Pulumi Tightens DevOps Platform Integration

      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

  • 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 State of Open Source Vulnerabilities 2020

The State of Open Source Vulnerabilities 2020

Open source components have become an integral part of today’s software applications — it’s impossible to keep up with the hectic pace of release cycles without them. As open source usage continues to grow, so does the number of eyes focused on open source security research, resulting in a record-breaking ... 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 27

An Open Source DevSecOps Platform for Securing Code & Dependencies

Mon, April 27, 1:00 pm - 2:00 pm EDT
Tue 28

Breakthrough DevOps – Successful DevOps Adoption Strategies

Tue, April 28, 8:00 am - 9:00 am EDT
Tue 28

Effective Cost Management for Azure Databricks

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

More Webinars

Past Webinars

Latest from DevOps.com

GigaSpaces Embraces Kubernetes Alternative for DataOps
April 24, 2020 | Mike Vizard
6 Common Pitfalls to Avoid While Building Out Your AI Tools
April 24, 2020 | Ramprakash Ramamoorthy
3 Ways DevOps Can Increase the Value of Organizational Data
April 24, 2020 | Aaron Williams
Software Testing: The Comeback Kid of the 2020s
April 24, 2020 | Wolfgang Platz
System Configuration
April 24, 2020 | ROELBOB

Most Read on DevOps.com

JFrog Makes Free DevOps Resources Available for COVID-19 Pro...
April 17, 2020 | Mike Vizard
Metropolis Now: The Two Worlds of Employment in the Age of A...
April 21, 2020 | Bob Reselman
AWS Adds GUI to Snow Edge Computing Family
April 17, 2020 | Mike Vizard
DevOps Deeper Dive: Git Turns 15
April 20, 2020 | Mike Vizard
Open Source Vulnerabilities Were Up 50% in 2019 — How Will I...
April 20, 2020 | Jeffrey Martin

On-Demand Webinars

DevOps.com Webinar ReplaysDevOps.com Webinar Replays

Download Free eBook

The 101 of Continuous Software Delivery